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

5.2 Data details


(1) Basic data


 List
 Title
Data specifications
 Data
Basic data
 Data Name
 No
1.0

 Model name
 explanation
 Uint8
 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. Take the following values.
FALSE fake
TRUE true


(2) Constant


 List
 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 has occurred
 PCM_ERR_OUT_OF_HANDLE
 Handle sold out
 PCM_ERR_NO_INIT
 Initialization function not called
 PCM_ERR_INVALID_HN
 Erase with illegal handle
 PCM_ERR_ILL_CREATE_MODE
 Different from the mode at the time of Create
 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
 No Common Chunk
 PCM_ERR_AFI_COMMPRESS
 Unsupported compression type
 PCM_ERR_NOT_DECLARE_ADPCM
 Not declared to use ADPCM
 PCM_ERR_ILLEGAL_PARA
 Wrong specification of argument
 PCM_ERR_ILLEGAL_HANDLE
 The handle is abnormal
 PCM_ERR_NEXT_HN_STATUS
 Abnormal state of continuous playback handle
 PCM_ERR_NEXT_HN_AUDIO
 Audio conditions do not match
 PCM_ERR_CHANGE_NO_ENTRY
 Changed without entry
 PCM_ERR_PAUSE_STATUS
 PCM_STAT_PLAY_TIME or
Call in a state other than PCM_STAT_PLAY_PAUSE
 PCM_ERR_PAUSE_WORK_NULL
 Work work abnormality for pause processing
 PCM_ERR_PAUSE_WORK_SIZE
 Work work abnormality for pause processing
 PCM_ERR_PAUSE_WORK_SET
 Invalid work specification for pause processing
 PCM_ERR_DMA_MODE
 Unsupported forwarding method
 PCM_ERR_DMA_CPU_PCM
 DMA ends abnormally
 PCM_ERR_GFS_READ
 Failed to read GFS
 PCM_ERR_RING_SUPPLY
 There was a supply in the ring buffer after the playback was completed.
(Supply was interrupted in time)
 PCM_ERR_TOO_SMALL_PCMBUF
 PCM buffer is too small
 PCM_ERR_ILL_SIZE_PCMBUF
 Incorrect PCM buffer size 


 List
 Title
Data specifications
 Data
Playback status
 Data Name
PCM_STAT_PLAY_ ~
 No
2.2
Represents 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 status
 PCM_STAT_PLAY_TIME
 Playing (timer start)
 PCM_STAT_PLAY_END
 End of playback 


 List
 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
 Unpause 

 List
 Title
Data specifications
 Data
Forced switchability check value
 Data Name
PCM_CHANGE_ ~
 No
2.4
Indicates the possibility of forced switching.
 Constant name
 explanation
 PCM_CHANGE_OK_AT_ONCE
 It is possible to forcibly switch immediately.
 PCM_CHANGE_NO_DATA
 There is a shortage of data supply. When forced switching (PCM_Change) is executed, continuous playback does not proceed smoothly.
 PCM_CHANGE_NO_ENTRY
 The next handle is not registered in PCM_EntryNext. Forced switching (PCM_Change) cannot be executed. 


 List
 Title
Data specifications
 Data
Data transfer method specified value
 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 Stealing)
 PCM_TRMODE_SCU
 SCU DMA


(3) Data type
 List
 Title
Data specifications
 Data
handle
 Data Name
PcmHn
 No
3.1 3.1

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


 List
 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; / * Work start address * /
                             / * Work area when this library is played * /
     Sint32 * ring_addr; / * Ring buffer address * /
                             / * When playing back data in memory, 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; / * Sound memory PCM buffer size [sample / 1ch] * /
} PcmCreatePara;

Notes on PCM buffers

 List
 Title
Data specifications
 Data
Error registration function
 Data Name
PcmErrFunc
 No
3.3

A function that is called when an error occurs.

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

 List
 Title
Data specifications
 Data
Playback information
 Data Name
PcmInfo
 No
3.4 3.4
Represents information for PCM playback.

 typedef struct {
     PcmFileType file_type; / * Filetype * /
     PcmDataType data_type; / * Data type * /
     Sint32 file_size; / * File size [byte]
                                      * Allows more supply to the link buffer *, 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 file samples [sample / 1ch] * /
     Sint32 compression_type; / * compression type * /
} PcmInfo;


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