Japanese
PROGRAMMER'S GUIDEPCM/ADPCM playback library
BackForward
PCM/ADPCM playback library

5.2 Data details


(1) Basic data


 one
View
table
 Title
data specifications
 Data
basic data
 Data Name
 No
1.0

 Model name
 explanation
 Uint8
 An unsigned 1-byte integer.
 Sint8
 Signed 1-byte integer.
 Uint16
 An unsigned 2-byte integer.
 Sint16
 Signed 2-byte integer.
 Uint32
 An unsigned 4-byte integer.
 Sint32
 Signed 4-byte integer.
 Bool
 Logical type. Takes the following values.
FALSE
TRUE


(2)Constant


 one
View
table
 Title
data specifications
 Data
Error code
 Data Name
PCM_ERR_~
 No
2.1
The following constants represent error codes.
 constant name
 explanation
 PCM_ERR_OK
 no error occurred
 PCM_ERR_OUT_OF_HANDLE
 Handle sold out
 PCM_ERR_NO_INIT
 Initialization function not called
 PCM_ERR_INVALID_HN
 Erase with invalid handle
 PCM_ERR_ILL_CREATE_MODE
 Different from the mode when creating
 PCM_ERR_TOO_LARGE_HEADER
 Header is too large
(buffer size is too small)
 PCM_ERR_HEADER_DATA
 header data error
 PCM_ERR_AFI_NO_COMMON
 There is no CommonChunk
 PCM_ERR_AFI_COMMPRESS
 Unsupported compression type
 PCM_ERR_NOT_DECLARE_ADPCM
 ADPCM use has not been declared
 PCM_ERR_ILLEGAL_PARA
 Incorrect argument specification
 PCM_ERR_ILLEGAL_HANDLE
 The handle is abnormal
 PCM_ERR_NEXT_HN_STATUS
 Abnormal status of continuous playback handle
 PCM_ERR_NEXT_HN_AUDIO
 Audio conditions do not match
 PCM_ERR_CHANGE_NO_ENTRY
 Changed without an entry
 PCM_ERR_PAUSE_STATUS
 PCM_STAT_PLAY_TIME or
Called in a state other than PCM_STAT_PLAY_PAUSE
 PCM_ERR_PAUSE_WORK_NULL
 Pose processing work abnormality
 PCM_ERR_PAUSE_WORK_SIZE
 Pose processing work abnormality
 PCM_ERR_PAUSE_WORK_SET
 Invalid work specification for pose processing
 PCM_ERR_DMA_MODE
 Unsupported transfer method
 PCM_ERR_DMA_CPU_PCM
 DMA terminated abnormally
 PCM_ERR_GFS_READ
 Failed to read GFS
 PCM_ERR_RING_SUPPLY
 The ring buffer was supplied after playback was completed.
(Supply was interrupted due to lack of time)
 PCM_ERR_TOO_SMALL_PCMBUF
 PCM buffer too small
 PCM_ERR_ILL_SIZE_PCMBUF
 Invalid PCM buffer size 


 one
View
table
 Title
data specifications
 Data
playback status
 Data Name
PCM_STAT_PLAY_~
 No
2.2
Indicates the playback status.
 constant name
 explanation
 PCM_STAT_PLAY_ERR_STOP
 Abnormal stop
 PCM_STAT_PLAY_CREATE
 generation state
 PCM_STAT_PLAY_PAUSE
 pause
 PCM_STAT_PLAY_START
 Start playing
 PCM_STAT_PLAY_HEADER
 Header processing state
 PCM_STAT_PLAY_TIME
 Playing (timer start)
 PCM_STAT_PLAY_END
 End of playback 


 one
View
table
 Title
data specifications
 Data
Pause control command
 Data Name
PCM_PAUSE_〜
 No
2.3
Represents pause control.
 constant name
 explanation
 PCM_PAUSE_ON_AT_ONCE
 Immediate pause
 PCM_PAUSE_OFF
 Cancel pause 

 one
View
table
 Title
data specifications
 Data
Forced switch possibility check value
 Data Name
PCM_CHANGE_~
 No
2.4
Represents the possibility of forced switching.
 constant name
 explanation
 PCM_CHANGE_OK_AT_ONCE
 Immediate forced switching is possible.
 PCM_CHANGE_NO_DATA
 Data supply is insufficient. Forced switch
Executing (PCM_Change) will result in smooth connection.
The playback does not continue.
 PCM_CHANGE_NO_ENTRY
 The next handle is registered with PCM_EntryNext.
Not yet. Forced switching (PCM_Change) is
I can't go.


 one
View
table
 Title
data specifications
 Data
Specified value of data transfer method
 Data Name
PCM_TRMODE_~
 No
2.5
Represents the data transfer method.
 constant name
 explanation
 PCM_TRMODE_CPU
 software transfer
 PCM_TRMODE_SDMA
 CPU DMA (cycle steal)
 PCM_TRMODE_SCU
 SCU DMA


(3) Data type
 one
View
table
 Title
data specifications
 Data
handle
 Data Name
PcmHn
 No
3.1

Represents information for each playback unit.
typedef void *PcmHn;


 one
View
table
 Title
data specifications
 Data
Creation parameters
 Data Name
PcmCreatePara
 No
3.2
Represents handle creation information. Set various parameter values to PCM_Create as a structure.

typedef struct {
     PcmWork *work; /* Start address of work */
                             /* Working area when this library plays */
     Sint32 *ring_addr; /* Ring buffer address */
                             /* When playing data in memory, use its address */
     Sint32 ring_size; /* Ring buffer size [byte] */
                             /* File size when playing data in memory */
     Sint32 *pcm_addr; /* Sound memory PCM buffer address */
     Sint32 pcm_size; /* PCM buffer size of sound memory [sample/1ch] */
} PcmCreatePara;

Notes on PCM buffers

 one
View
table
 Title
data specifications
 Data
Error registration function
 Data Name
PcmErrFunc
 No
3.3

Function called when an error occurs.

Format
void(*PcmErrFunc)(void *obj, Sint32 err_code)
input
 obj
 :Registered object
 err_code
 :Error code
output
none

 one
View
table
 Title
data specifications
 Data
Playback information
 Data Name
PcmInfo
 No
3.4
Represents information for PCM playback.

 typedef struct {
     PcmFileType file_type; /* File type */
     PcmDataType data_type; /* Data type */
     Sint32 file_size; /* file size[byte]
                                      * Allows more link buffers to be supplied * but does not process that part. */
     Sint32 channel; /* Number of channels */
     Sint32 sampling_bit; /* Number of sampling bits */
     Sint32 sampling_rate; /* Sampling rate[Hz] */
     Sint32 sample_file; /* Number of samples in file[sample/1ch]*/
     Sint32 compression_type; /* Compression type */
} PcmInfo;


BackForward
PROGRAMMER'S GUIDEPCM/ADPCM playback library
Copyright SEGA ENTERPRISES, LTD., 1997