CRI ADX
Last Updated: 2024-07-17 10:48 p
|
结构体 | |
struct | CriAtomStandardPlayerConfigTag |
struct | CriAtomAdxPlayerConfigTag |
struct | CriAtomHcaPlayerConfigTag |
struct | CriAtomHcaMxPlayerConfigTag |
struct | CriAtomWavePlayerConfigTag |
struct | CriAtomAiffPlayerConfigTag |
struct | CriAtomRawPcmPlayerConfigTag |
struct | CriAtomInstrumentPlayerConfigTag |
struct | CriAtomStreamingCacheConfigTag |
Streaming cache creation configuration structure 更多... | |
宏定义 | |
#define | CRIATOMPLAYER_NO_LOOP_LIMITATION (-1) |
Constant for canceling the restriction of the number of loops 更多... | |
#define | criAtomPlayer_SetDefaultConfigForStandardPlayer(p_config) |
Set default parameters for CriAtomStandardPlayerConfig 更多... | |
#define | criAtomPlayer_SetDefaultConfigForAdxPlayer(p_config) |
Set default parameters for CriAtomAdxPlayerConfig 更多... | |
#define | criAtomPlayer_SetDefaultConfigForHcaPlayer(p_config) |
Set default parameters for CriAtomHcaPlayerConfig 更多... | |
#define | criAtomPlayer_SetDefaultConfigForHcaMxPlayer(p_config) |
Set default parameters for CriAtomHcaMxPlayerConfig 更多... | |
#define | criAtomPlayer_SetDefaultConfigForWavePlayer(p_config) |
Set default parameters for CriAtomWavePlayerConfig 更多... | |
#define | criAtomPlayer_SetDefaultConfigForRawPcmPlayer(p_config) |
Set default parameters for CriAtomRawPcmPlayerConfig 更多... | |
#define | criAtomPlayer_SetDefaultConfigForInstrumentPlayer(p_config) |
Set default parameters for CriAtomInstrumentPlayerConfig 更多... | |
枚举 | |
enum | CriAtomParameterIdTag { CRIATOM_PARAMETER_ID_VOLUME = 0 , CRIATOM_PARAMETER_ID_FREQUENCY_RATIO = 1 , CRIATOM_PARAMETER_ID_ENUM_SIZE_IS_4BYTES = 0x7FFFFFFF } |
Parameters ID 更多... | |
enum | CriAtomPlayerStatusTag { CRIATOMPLAYER_STATUS_STOP = 0 , CRIATOMPLAYER_STATUS_PREP = 1 , CRIATOMPLAYER_STATUS_PLAYING = 2 , CRIATOMPLAYER_STATUS_PLAYEND = 3 , CRIATOMPLAYER_STATUS_ERROR = 4 , CRIATOMPLAYER_STATUS_ENUM_SIZE_IS_4BYTES = 0x7FFFFFFF } |
Playback status 更多... | |
函数 | |
CriSint32 | criAtomPlayer_CalculateWorkSizeForStandardPlayer (const CriAtomStandardPlayerConfig *config) |
Calculate work area size required for creating standard player 更多... | |
CriAtomPlayerHn | criAtomPlayer_CreateStandardPlayer (const CriAtomStandardPlayerConfig *config, void *work, CriSint32 work_size) |
Create standard player 更多... | |
CriSint32 | criAtomPlayer_CalculateWorkSizeForAdxPlayer (const CriAtomAdxPlayerConfig *config) |
Calculate work area size required for creating ADX player 更多... | |
CriAtomPlayerHn | criAtomPlayer_CreateAdxPlayer (const CriAtomAdxPlayerConfig *config, void *work, CriSint32 work_size) |
Create an ADX player 更多... | |
CriSint32 | criAtomPlayer_CalculateWorkSizeForHcaPlayer (const CriAtomHcaPlayerConfig *config) |
Calculate work area size required for creating HCA player 更多... | |
CriAtomPlayerHn | criAtomPlayer_CreateHcaPlayer (const CriAtomHcaPlayerConfig *config, void *work, CriSint32 work_size) |
Create an HCA player 更多... | |
CriSint32 | criAtomPlayer_CalculateWorkSizeForHcaMxPlayer (const CriAtomHcaMxPlayerConfig *config) |
Calculate work area size required for creating HCA-MX player 更多... | |
CriAtomPlayerHn | criAtomPlayer_CreateHcaMxPlayer (const CriAtomHcaMxPlayerConfig *config, void *work, CriSint32 work_size) |
Create an HCA-MX player 更多... | |
CriSint32 | criAtomPlayer_CalculateWorkSizeForWavePlayer (const CriAtomWavePlayerConfig *config) |
Calculate work area size required for creating WAVE player 更多... | |
CriAtomPlayerHn | criAtomPlayer_CreateWavePlayer (const CriAtomWavePlayerConfig *config, void *work, CriSint32 work_size) |
Create a WAVE player 更多... | |
CriSint32 | criAtomPlayer_CalculateWorkSizeForAiffPlayer (const CriAtomAiffPlayerConfig *config) |
Work area size calculation for AIFF player creation 更多... | |
CriAtomPlayerHn | criAtomPlayer_CreateAiffPlayer (const CriAtomAiffPlayerConfig *config, void *work, CriSint32 work_size) |
AIFF player creation 更多... | |
CriSint32 | criAtomPlayer_CalculateWorkSizeForRawPcmPlayer (const CriAtomRawPcmPlayerConfig *config) |
Calculate work area size required for creating raw PCM player 更多... | |
CriAtomPlayerHn | criAtomPlayer_CreateRawPcmPlayer (const CriAtomRawPcmPlayerConfig *config, void *work, CriSint32 work_size) |
Create raw PCM player 更多... | |
void | criAtomPlayer_Destroy (CriAtomPlayerHn player) |
Destroy Atom player 更多... | |
void | criAtomPlayer_SetData (CriAtomPlayerHn player, void *buffer, CriSint32 buffer_size) |
Set sound data (specify On-memory data) 更多... | |
void | criAtomPlayer_SetFile (CriAtomPlayerHn player, CriFsBinderHn binder, const CriChar8 *path) |
Set sound data (specify file) 更多... | |
void | criAtomPlayer_SetContentId (CriAtomPlayerHn player, CriFsBinderHn binder, CriSint32 id) |
Set sound data (specify CPK content ID) 更多... | |
void | criAtomPlayer_SetWaveId (CriAtomPlayerHn player, CriAtomAwbHn awb, CriSint32 id) |
Set sound data (specify sound data ID) 更多... | |
void | criAtomPlayer_SetPreviousDataAgain (CriAtomPlayerHn player) |
Re-set same sound data 更多... | |
void | criAtomPlayer_DeferCallback (CriAtomPlayerHn player) |
Callback function re-execution request 更多... | |
void | criAtomPlayer_Start (CriAtomPlayerHn player) |
Start playback 更多... | |
void | criAtomPlayer_Stop (CriAtomPlayerHn player) |
Stop playback 更多... | |
void | criAtomPlayer_Pause (CriAtomPlayerHn player, CriBool flag) |
Pause/resume playback 更多... | |
CriBool | criAtomPlayer_IsPaused (CriAtomPlayerHn player) |
Check whether player is paused 更多... | |
CriAtomPlayerStatus | criAtomPlayer_GetStatus (CriAtomPlayerHn player) |
Get status 更多... | |
CriSint32 | criAtomPlayer_GetNumChannels (CriAtomPlayerHn player) |
Get number of channels 更多... | |
CriBool | criAtomPlayer_GetNumPlayedSamples (CriAtomPlayerHn player, CriSint64 *num_played, CriSint32 *sampling_rate) |
Get number of played samples 更多... | |
CriBool | criAtomPlayer_GetNumRenderedSamples (CriAtomPlayerHn player, CriSint64 *num_rendered, CriSint32 *sampling_rate) |
Acquiring the number of samples to write to the sound buffer 更多... | |
CriSint64 | criAtomPlayer_GetDecodedDataSize (CriAtomPlayerHn player) |
Acquiring the size of decoded data 更多... | |
CriSint64 | criAtomPlayer_GetNumDecodedSamples (CriAtomPlayerHn player) |
Acquiring the number of decoded samples 更多... | |
CriSint64 | criAtomPlayer_GetTime (CriAtomPlayerHn player) |
Get playback time 更多... | |
CriBool | criAtomPlayer_GetFormatInfo (CriAtomPlayerHn player, CriAtomFormatInfo *info) |
Get playback sound format information 更多... | |
CriSint32 | criAtomPlayer_GetInputBufferRemainSize (CriAtomPlayerHn player) |
Get amount of data remaining in input buffer 更多... | |
CriSint32 | criAtomPlayer_GetOutputBufferRemainSamples (CriAtomPlayerHn player) |
Get amount of data remaining in output buffer 更多... | |
void | criAtomPlayer_SetStartTime (CriAtomPlayerHn player, CriSint64 start_time_ms) |
Specify playback start position 更多... | |
void | criAtomPlayer_SetVolume (CriAtomPlayerHn player, CriFloat32 vol) |
Specify volume 更多... | |
CriFloat32 | criAtomPlayer_GetVolume (CriAtomPlayerHn player) |
Volume specification 更多... | |
void | criAtomPlayer_SetChannelVolume (CriAtomPlayerHn player, CriSint32 ch, CriFloat32 vol) |
Specify volume for each channel 更多... | |
void | criAtomPlayer_SetSendLevel (CriAtomPlayerHn player, CriSint32 ch, CriAtomSpeakerId spk, CriFloat32 level) |
Set send level 更多... | |
void | criAtomPlayer_ResetSendLevel (CriAtomPlayerHn player) |
Reset send level 更多... | |
void | criAtomPlayer_SetPanAdx1Compatible (CriAtomPlayerHn player, CriSint32 ch, CriFloat32 pan) |
Set pan 更多... | |
void | criAtomPlayer_ResetPan (CriAtomPlayerHn player) |
Reset pan 更多... | |
void | criAtomPlayer_SetFrequencyRatio (CriAtomPlayerHn player, CriFloat32 ratio) |
Set frequency adjustment ratio 更多... | |
void | criAtomPlayer_SetMaxFrequencyRatio (CriAtomPlayerHn player, CriFloat32 ratio) |
Set max of frequency adjustment ratio 更多... | |
void | criAtomPlayer_LimitLoopCount (CriAtomPlayerHn player, CriSint32 count) |
Limit the number of loop playbacks 更多... | |
void | criAtomPlayer_SetHcaMxMixerId (CriAtomPlayerHn player, CriSint32 mixer_id) |
Sepcify HCA-MX decode destination mixer ID 更多... | |
void | criAtomPlayer_SetAsrRackId (CriAtomPlayerHn player, CriSint32 rack_id) |
Specifying the ASR Rack ID 更多... | |
void | criAtomPlayer_SetRawPcmFormat (CriAtomPlayerHn player, CriAtomPcmFormat pcm_format, CriSint32 num_channels, CriSint32 sampling_rate) |
Specify raw PCM format 更多... | |
void | criAtomPlayer_SetDataRequestCallback (CriAtomPlayerHn player, CriAtomPlayerDataRequestCbFunc func, void *obj) |
Register data request callback function 更多... | |
void | criAtomPlayer_SetStatusChangeCallback (CriAtomPlayerHn player, CriAtomPlayerStatusChangeCbFunc func, void *obj) |
Register status change callback function 更多... | |
void | criAtomPlayer_SetParameterChangeCallback (CriAtomPlayerHn player, CriAtomPlayerParameterChangeCbFunc func, void *obj) |
Register parameter change callback function 更多... | |
void | criAtomPlayer_SetFilterCallback (CriAtomPlayerHn player, CriAtomPlayerFilterCbFunc func, void *obj) |
Register wave filter callback function 更多... | |
void | criAtomPlayer_SetLoadRequestCallback (CriAtomPlayerHn player, CriAtomPlayerLoadRequestCbFunc func, void *obj) |
Registering a load request callback function 更多... | |
void | criAtomPlayer_SetHcaFormat (CriAtomPlayerHn player, CriSint32 num_channels, CriSint32 sampling_rate, CriSint32 bitrate) |
Specifying the HCA format 更多... | |
#define CRIATOMPLAYER_NO_LOOP_LIMITATION (-1) |
Constant for canceling the restriction of the number of loops
#define criAtomPlayer_SetDefaultConfigForStandardPlayer | ( | p_config | ) |
Set default parameters for CriAtomStandardPlayerConfig
[out] | p_config | pointer to the configuration structure for creating a standard player |
#define criAtomPlayer_SetDefaultConfigForAdxPlayer | ( | p_config | ) |
Set default parameters for CriAtomAdxPlayerConfig
[out] | p_config | pointer to the configuration structure for creating an ADX Player |
#define criAtomPlayer_SetDefaultConfigForHcaPlayer | ( | p_config | ) |
Set default parameters for CriAtomHcaPlayerConfig
[out] | p_config | pointer to the configuration structure for creating an HCA Player |
#define criAtomPlayer_SetDefaultConfigForHcaMxPlayer | ( | p_config | ) |
Set default parameters for CriAtomHcaMxPlayerConfig
[out] | p_config | pointer to the configuration structure for creating an HCA-MX Player |
#define criAtomPlayer_SetDefaultConfigForWavePlayer | ( | p_config | ) |
Set default parameters for CriAtomWavePlayerConfig
[out] | p_config | pointer to WAVE player creation configuration structure |
#define criAtomPlayer_SetDefaultConfigForRawPcmPlayer | ( | p_config | ) |
Set default parameters for CriAtomRawPcmPlayerConfig
[out] | p_config | pointer to the configuration structure for creating a raw PCM Player |
#define criAtomPlayer_SetDefaultConfigForInstrumentPlayer | ( | p_config | ) |
Set default parameters for CriAtomInstrumentPlayerConfig
[out] | p_config | pointer to the configuration structure for creating a Instrument Player |
typedef enum CriAtomParameterIdTag CriAtomParameterId |
Parameters ID
typedef struct CriAtomStandardPlayerConfigTag CriAtomStandardPlayerConfig |
Configuration structure for creating a standard player
typedef struct CriAtomAdxPlayerConfigTag CriAtomAdxPlayerConfig |
ADX player creation configuration structure
typedef struct CriAtomHcaPlayerConfigTag CriAtomHcaPlayerConfig |
HCA player creation configuration structure
typedef struct CriAtomHcaMxPlayerConfigTag CriAtomHcaMxPlayerConfig |
HCA-MX player creation configuration structure
typedef struct CriAtomWavePlayerConfigTag CriAtomWavePlayerConfig |
WAVE player creation configuration structure
typedef struct CriAtomAiffPlayerConfigTag CriAtomAiffPlayerConfig |
Configuration structure for AIFF player creation
typedef struct CriAtomRawPcmPlayerConfigTag CriAtomRawPcmPlayerConfig |
Raw PCM player creation configuration structure
typedef struct CriAtomInstrumentPlayerConfigTag CriAtomInstrumentPlayerConfig |
Instrument Player creation configuration structure
typedef enum CriAtomPlayerStatusTag CriAtomPlayerStatus |
Playback status
Immediately after an Atom Player is created, the player is in a stop status ( CRIATOMPLAYER_STATUS_STOP ).
By setting data using a function such as the criAtomPlayer_SetData function and then executing the criAtomPlayer_Start function, the player enters a playback preparation status ( CRIATOMPLAYER_STATUS_PREP ) and starts preparing for playback.
Once a sufficient amount of data is provided and the playback is ready, the player enters a playback status ( CRIATOMPLAYER_STATUS_PLAYING ) and starts audio playback.
When the playback of all data that have been set is complete, the player enters a playback completion status ( CRIATOMPLAYER_STATUS_PLAYEND ).
typedef struct CriAtomPlayerTag* CriAtomPlayerHn |
Atom player handle
typedef void( * CriAtomPlayerDataRequestCbFunc) (void *obj, CriAtomPlayerHn player) |
Data request callback function
[in] | obj | user specified object |
[in] | player | Atom player handle |
typedef void( * CriAtomPlayerStatusChangeCbFunc) (void *obj, CriAtomPlayerHn player) |
Status change callback function
[in] | obj | user specified object |
[in] | player | Atom player handle |
typedef void( * CriAtomPlayerParameterChangeCbFunc) (void *obj, CriAtomPlayerHn player, CriAtomParameterId id, CriFloat32 value) |
Parameters change callback function
[in] | obj | user specified object |
[in] | player | Atom player handle |
[in] | id | Parameter ID |
[in] | value | Parameter value |
typedef void( * CriAtomPlayerFilterCbFunc) (void *obj, CriAtomPcmFormat format, CriSint32 num_channels, CriSint32 num_samples, void *data[]) |
Wave filter callback function
[in] | obj | user specified object |
[in] | format | PCM format |
[in] | num_channels | number of channels |
[in] | num_samples | number of samples |
[in/out] | data PCM data channel layout |
(Because no clipping is performed during decoding, for CRIATOM_PCM_FORMAT_FLOAT32 , value slightly exceeding the above range is possible.)
typedef void( * CriAtomPlayerLoadRequestCbFunc) (void *obj, CriFsBinderHn binder, const CriChar8 *path, CriSint64 offset, CriSint64 length) |
Load request callback function
[in] | obj | User specified object |
[in] | binder | Binder to which the file is loaded |
[in] | path | File path |
[in] | offset | Load start position |
[in] | length | Load request size |
typedef struct CriAtomStreamingCacheConfigTag CriAtomStreamingCacheConfig |
Streaming cache creation configuration structure
Playback status
Immediately after an Atom Player is created, the player is in a stop status ( CRIATOMPLAYER_STATUS_STOP ).
By setting data using a function such as the criAtomPlayer_SetData function and then executing the criAtomPlayer_Start function, the player enters a playback preparation status ( CRIATOMPLAYER_STATUS_PREP ) and starts preparing for playback.
Once a sufficient amount of data is provided and the playback is ready, the player enters a playback status ( CRIATOMPLAYER_STATUS_PLAYING ) and starts audio playback.
When the playback of all data that have been set is complete, the player enters a playback completion status ( CRIATOMPLAYER_STATUS_PLAYEND ).
CriSint32 criAtomPlayer_CalculateWorkSizeForStandardPlayer | ( | const CriAtomStandardPlayerConfig * | config | ) |
Calculate work area size required for creating standard player
[in] | config | standard player creation configuration structure |
>= | 0 successfully completed |
-1 | error occurred |
CriAtomPlayerHn criAtomPlayer_CreateStandardPlayer | ( | const CriAtomStandardPlayerConfig * | config, |
void * | work, | ||
CriSint32 | work_size | ||
) |
Create standard player
[in] | config | standard player creation configuration structure |
[in] | work | work area |
[in] | work_size | work area size |
The specific code is as follows:
*If memory allocate/deallocate function is registered during library initialization, it need not be registered again when creating the standard player.
[Creating a Standard Player with the Fixed Memory Method]
When using the Fixed Memory method, the standard player create/destroy procedure is as follows:
The specific code is as follows:
When you execute the criAtomPlayer_CreateStandardPlayer function, Atom player is created and the handle (CriAtomPlayerHn ) to control the player is returned.
Atom player operations such as set data and decoder, start playback, and get status are all performed against the handle.
The procedure to play sound data using the created Atom player handle is as follows:
CriSint32 criAtomPlayer_CalculateWorkSizeForAdxPlayer | ( | const CriAtomAdxPlayerConfig * | config | ) |
Calculate work area size required for creating ADX player
[in] | config | ADX player creation configuration structure |
>= | 0 successfully completed |
-1 | error occurred |
CriAtomPlayerHn criAtomPlayer_CreateAdxPlayer | ( | const CriAtomAdxPlayerConfig * | config, |
void * | work, | ||
CriSint32 | work_size | ||
) |
Create an ADX player
[in] | config | ADX player creation configuration structure |
[in] | work | work area |
[in] | work_size | work area size |
The specific code is as follows:
*If memory allocation/release function is registered during library initialization, it need not be registered again when creating the ADX player.
[Creating an ADX Player with the Fixed Memory Method] When using the Fixed Allocator method, the ADX player create/destroy procedure is as follows:
The specific code is as follows:
When you execute the criAtomPlayer_CreateAdxPlayer function, Atom player is created and the handle (CriAtomPlayerHn ) to control the player is returned.
Atom player operations such as set data and decoder, start playback, and get status are all performed against the handle.
The procedure to play sound data using the created Atom player handle is as follows:
CriSint32 criAtomPlayer_CalculateWorkSizeForHcaPlayer | ( | const CriAtomHcaPlayerConfig * | config | ) |
Calculate work area size required for creating HCA player
[in] | config | HCA player creation configuration structure |
>= | 0 successfully completed |
-1 | error occurred |
CriAtomPlayerHn criAtomPlayer_CreateHcaPlayer | ( | const CriAtomHcaPlayerConfig * | config, |
void * | work, | ||
CriSint32 | work_size | ||
) |
Create an HCA player
[in] | config | HCA player creation configuration structure |
[in] | work | work area |
[in] | work_size | work area size |
CriSint32 criAtomPlayer_CalculateWorkSizeForHcaMxPlayer | ( | const CriAtomHcaMxPlayerConfig * | config | ) |
Calculate work area size required for creating HCA-MX player
[in] | config | HCA-MX player creation configuration structure |
>= | 0 successfully completed |
-1 | error occurred |
CriAtomPlayerHn criAtomPlayer_CreateHcaMxPlayer | ( | const CriAtomHcaMxPlayerConfig * | config, |
void * | work, | ||
CriSint32 | work_size | ||
) |
Create an HCA-MX player
[in] | config | HCA-MX player creation configuration structure |
[in] | work | work area |
[in] | work_size | work area size |
CriSint32 criAtomPlayer_CalculateWorkSizeForWavePlayer | ( | const CriAtomWavePlayerConfig * | config | ) |
Calculate work area size required for creating WAVE player
[in] | config | WAVE player creation configuration structure |
>= | 0 successfully completed |
-1 | error occurred |
CriAtomPlayerHn criAtomPlayer_CreateWavePlayer | ( | const CriAtomWavePlayerConfig * | config, |
void * | work, | ||
CriSint32 | work_size | ||
) |
Create a WAVE player
[in] | config | WAVE player creation configuration structure |
[in] | work | work area |
[in] | work_size | work area size |
CriSint32 criAtomPlayer_CalculateWorkSizeForAiffPlayer | ( | const CriAtomAiffPlayerConfig * | config | ) |
Work area size calculation for AIFF player creation
[in] | config | Configuration structure for AIFF player creation |
0 | or greater Processing finished normally |
-1 | Error occurred |
CriAtomPlayerHn criAtomPlayer_CreateAiffPlayer | ( | const CriAtomAiffPlayerConfig * | config, |
void * | work, | ||
CriSint32 | work_size | ||
) |
AIFF player creation
[in] | config | Configuration structure for AIFF player creation |
[in] | work | Work area |
[in] | work_size | Work area size |
CriSint32 criAtomPlayer_CalculateWorkSizeForRawPcmPlayer | ( | const CriAtomRawPcmPlayerConfig * | config | ) |
Calculate work area size required for creating raw PCM player
[in] | config | raw PCM player creation configuration structure |
>= | 0 successfully completed |
-1 | error occurred |
CriAtomPlayerHn criAtomPlayer_CreateRawPcmPlayer | ( | const CriAtomRawPcmPlayerConfig * | config, |
void * | work, | ||
CriSint32 | work_size | ||
) |
Create raw PCM player
[in] | config | raw PCM player creation configuration structure |
[in] | work | work area |
[in] | work_size | work area size |
void criAtomPlayer_Destroy | ( | CriAtomPlayerHn | player | ) |
Destroy Atom player
[in] | player | Atom player handle |
void criAtomPlayer_SetData | ( | CriAtomPlayerHn | player, |
void * | buffer, | ||
CriSint32 | buffer_size | ||
) |
Set sound data (specify On-memory data)
[in] | player | Atom player handle |
[in] | buffer | buffer address |
[in] | buffer_size | buffer size |
void criAtomPlayer_SetFile | ( | CriAtomPlayerHn | player, |
CriFsBinderHn | binder, | ||
const CriChar8 * | path | ||
) |
Set sound data (specify file)
[in] | player | Atom player handle |
[in] | binder | binder handle |
[in] | path | file path |
void criAtomPlayer_SetContentId | ( | CriAtomPlayerHn | player, |
CriFsBinderHn | binder, | ||
CriSint32 | id | ||
) |
Set sound data (specify CPK content ID)
[in] | player | Atom player handle |
[in] | binder | binder handle |
[in] | id | content ID |
void criAtomPlayer_SetWaveId | ( | CriAtomPlayerHn | player, |
CriAtomAwbHn | awb, | ||
CriSint32 | id | ||
) |
Set sound data (specify sound data ID)
[in] | player | Atom player handle |
[in] | awb | AWB handle |
[in] | id | wave data ID |
void criAtomPlayer_SetPreviousDataAgain | ( | CriAtomPlayerHn | player | ) |
Re-set same sound data
[in] | player | Atom player handle |
void criAtomPlayer_DeferCallback | ( | CriAtomPlayerHn | player | ) |
Callback function re-execution request
[in] | player | Atom player handle |
void criAtomPlayer_Start | ( | CriAtomPlayerHn | player | ) |
Start playback
[in] | player | Atom player handle |
At the time Atom player is created, the status of the Atom player is stop status ( CRIATOMPLAYER_STATUS_STOP ).
After setting the sound data to play, the Atom player status changes to preparation status ( CRIATOMPLAYER_STATUS_PREP ) when this function is executed.
(In CRIATOMPLAYER_STATUS_PREP status, the player is waiting to receive data or start decoding.)
When there is sufficient data to start playing, the Atom player status changes to playing status ( CRIATOMPLAYER_STATUS_PLAYING ) and sound output starts.
When playback of all set data completes, the Atom player status changes to play end status ( CRIATOMPLAYER_STATUS_PLAYEND ).
If an error occurs during playback, the Atom player status changes to error status ( CRIATOMPLAYER_STATUS_ERROR ).
By checking the Atom player status and switching processing according to status, you can create a program that is linked with sound playback status.
For example, code as follows to continue processing after waiting for sound playback to complete.
void criAtomPlayer_Stop | ( | CriAtomPlayerHn | player | ) |
Stop playback
[in] | player | Atom player handle |
void criAtomPlayer_Pause | ( | CriAtomPlayerHn | player, |
CriBool | flag | ||
) |
Pause/resume playback
[in] | player | Atom player handle |
[in] | flag | operation flag (CRI_TRUE = pause, CRI_FALSE = resume) |
[About pause/resume sound output] When an active Atom player is paused, the sound that was output is interrupted.
When a paused Atom player is resumed, playback resumes where it was interrupted.
[About cuing streaming playback] Pause can also be used for Atom player before starting playback.
When an Atom player is paused before starting playback, no sound is output when the criAtomPlayer_Start function is issued for the paused Atom player.
However, preparation for playback is made and if sufficient data is supplied, the status changes to CRIATOMPLAYER_STATUS_PLAYING .
Atom player stopped at status CRIATOMPLAYER_STATUS_PLAYING can start sound output when playback is resumed.
Therefore, the sound output timing for streaming output can be synchronized with other actions according to the following procedure:
The specific code is as follows:
CriBool criAtomPlayer_IsPaused | ( | CriAtomPlayerHn | player | ) |
Check whether player is paused
[in] | player | Atom player handle |
CriAtomPlayerStatus criAtomPlayer_GetStatus | ( | CriAtomPlayerHn | player | ) |
Get status
[in] | player | Atom player handle |
At the time Atom player is created, the status of the Atom player is stop status ( CRIATOMPLAYER_STATUS_STOP ).
After setting the sound data to play, execute the criAtomPlayer_Start function to change the Atom player status to preparation status ( CRIATOMPLAYER_STATUS_PREP ).
(In CRIATOMPLAYER_STATUS_PREP status, the player is waiting to receive data or start decoding.)
When there is sufficient data to start playing, the Atom player status changes to playing status ( CRIATOMPLAYER_STATUS_PLAYING ) and sound output starts.
When playback of all set data completes, the Atom player status changes to play end status ( CRIATOMPLAYER_STATUS_PLAYEND ).
If an error occurs during playback, the Atom player status changes to ( CRIATOMPLAYER_STATUS_ERROR ).
By checking the Atom player status and switching processing according to status, you can create a program that is linked with sound playback status.
For example, code as follows to continue processing after waiting for sound playback to complete.
CriSint32 criAtomPlayer_GetNumChannels | ( | CriAtomPlayerHn | player | ) |
Get number of channels
[in] | player | Atom player handle |
CriBool criAtomPlayer_GetNumPlayedSamples | ( | CriAtomPlayerHn | player, |
CriSint64 * | num_played, | ||
CriSint32 * | sampling_rate | ||
) |
Get number of played samples
[in] | player | Atom player handle |
[out] | num_played | number of played samples (sample units) |
[out] | sampling_rate | sampling rate (Hz) |
The number of played samples returned by this function is the cumulative value of the output sound data.
Therefore, even during loop playback or seamless concatenated playback, the number of samples will not be rewound according to the playback position.
Also, the player when paused with the criAtomPlayer_Pause function, counting of played samples will also stop.
(Counting will resume when the player is resumed.)
CriBool criAtomPlayer_GetNumRenderedSamples | ( | CriAtomPlayerHn | player, |
CriSint64 * | num_rendered, | ||
CriSint32 * | sampling_rate | ||
) |
Acquiring the number of samples to write to the sound buffer
[in] | player | Atom player handle |
[out] | num_rendered | Number of written samples (in units of sample) |
[out] | sampling_rate | Sampling rate (in Hz) |
CriSint64 criAtomPlayer_GetDecodedDataSize | ( | CriAtomPlayerHn | player | ) |
Acquiring the size of decoded data
[in] | player | Atom player handle |
CriSint64 criAtomPlayer_GetNumDecodedSamples | ( | CriAtomPlayerHn | player | ) |
Acquiring the number of decoded samples
[in] | player | Atom player handle |
CriSint64 criAtomPlayer_GetTime | ( | CriAtomPlayerHn | player | ) |
Get playback time
[in] | player | Atom player handle |
CriBool criAtomPlayer_GetFormatInfo | ( | CriAtomPlayerHn | player, |
CriAtomFormatInfo * | info | ||
) |
Get playback sound format information
[in] | player | Atom player handle |
[out] | info | format information |
CriSint32 criAtomPlayer_GetInputBufferRemainSize | ( | CriAtomPlayerHn | player | ) |
Get amount of data remaining in input buffer
[in] | player | Atom player handle |
CriSint32 criAtomPlayer_GetOutputBufferRemainSamples | ( | CriAtomPlayerHn | player | ) |
Get amount of data remaining in output buffer
[in] | player | Atom player handle |
void criAtomPlayer_SetStartTime | ( | CriAtomPlayerHn | player, |
CriSint64 | start_time_ms | ||
) |
Specify playback start position
[in] | player | Atom player handle |
[in] | start_time_ms | playback start position (milliseconds) |
void criAtomPlayer_SetVolume | ( | CriAtomPlayerHn | player, |
CriFloat32 | vol | ||
) |
Specify volume
[in] | player | Atom player handle |
[in] | vol | volume |
For example, if this function set 0.5f and the criAtomPlayer_SetChannelVolume function also sets 0.5f, the volume of the output sound will be 0.25f times the original sound.
(Calculated as 0.5f x 0.5f=0.25f.)
Even when specifying volume over 1.0f, whether the sound is played at the volume greater than the source waveform depends on the platform or the audio compression codec.
Therefore, when adjusting volume on the multi-platform title, it is recommended not to use volume over 1.0f.
(If specifying volume over 1.0f, even when playing the same waveform, it may be played at the different volume depending on the platform.)
And, even on the platform where volume can be increased, its hardware has the upper limit of the volume at which the sound can be output, and a noise caused by the sound cracking may be generated.
CriFloat32 criAtomPlayer_GetVolume | ( | CriAtomPlayerHn | player | ) |
Volume specification
[in] | player | Atom player handle |
void criAtomPlayer_SetChannelVolume | ( | CriAtomPlayerHn | player, |
CriSint32 | ch, | ||
CriFloat32 | vol | ||
) |
Specify volume for each channel
[in] | player | Atom player handle |
[in] | ch | channel number |
[in] | vol | volume (0.0f to 1.0f) |
void criAtomPlayer_SetSendLevel | ( | CriAtomPlayerHn | player, |
CriSint32 | ch, | ||
CriAtomSpeakerId | spk, | ||
CriFloat32 | level | ||
) |
Set send level
[in] | player | Atom player handle |
[in] | ch | channel number |
[in] | spk | speaker ID |
[in] | level | volume (0.0f to 1.0f) |
void criAtomPlayer_ResetSendLevel | ( | CriAtomPlayerHn | player | ) |
Reset send level
[in] | player | Atom player handle |
void criAtomPlayer_SetPanAdx1Compatible | ( | CriAtomPlayerHn | player, |
CriSint32 | ch, | ||
CriFloat32 | pan | ||
) |
Set pan
[in] | player | Atom player handle |
[in] | ch | channel number |
[in] | pan | pan setting (-1.0f to 1.0f) |
void criAtomPlayer_ResetPan | ( | CriAtomPlayerHn | player | ) |
Reset pan
[in] | player | Atom player handle |
void criAtomPlayer_SetFrequencyRatio | ( | CriAtomPlayerHn | player, |
CriFloat32 | ratio | ||
) |
Set frequency adjustment ratio
[in] | player | Atom player handle |
[in] | ratio | frequency adjustment ratio |
void criAtomPlayer_SetMaxFrequencyRatio | ( | CriAtomPlayerHn | player, |
CriFloat32 | ratio | ||
) |
Set max of frequency adjustment ratio
[in] | player | Atom player handle |
[in] | ratio | maximum value of frequency adjustment ratio |
void criAtomPlayer_LimitLoopCount | ( | CriAtomPlayerHn | player, |
CriSint32 | count | ||
) |
Limit the number of loop playbacks
[in] | player | Atom player handle |
[in] | count | number of loop playbacks to be limited |
Only the ADX and HCA codecs can be used to limit the number of loops with this function.
Do not execute this function for platform-dependent audio codecs.
(Doing so may result in playback not finishing, noise, or other issues.)
void criAtomPlayer_SetHcaMxMixerId | ( | CriAtomPlayerHn | player, |
CriSint32 | mixer_id | ||
) |
Sepcify HCA-MX decode destination mixer ID
[in] | player | Atom player handle |
[in] | mixer_id | mixer id |
void criAtomPlayer_SetAsrRackId | ( | CriAtomPlayerHn | player, |
CriSint32 | rack_id | ||
) |
Specifying the ASR Rack ID
[in] | player | Atom player handle |
[in] | rack_id | ASR Rack ID |
void criAtomPlayer_SetRawPcmFormat | ( | CriAtomPlayerHn | player, |
CriAtomPcmFormat | pcm_format, | ||
CriSint32 | num_channels, | ||
CriSint32 | sampling_rate | ||
) |
Specify raw PCM format
[in] | player | Atom player handle |
[in] | pcm_format | raw PCM data format |
[in] | num_channels | number of channels |
[in] | sampling_rate | sampling rate (Hz) |
void criAtomPlayer_SetDataRequestCallback | ( | CriAtomPlayerHn | player, |
CriAtomPlayerDataRequestCbFunc | func, | ||
void * | obj | ||
) |
Register data request callback function
[in] | player | Atom player handle |
[in] | func | data request callback function |
[in] | obj | user specified object |
If you try to concatenate waveforms with different parameters, you may encounter problems such as unintended speed of audio data playback or error callbacks.
Also, when waveform data with loop information is set within the data request callback function, the loop playback is not performed.
(The loop points are discarded, and the playback ends.)
Do not destroy the Atom player within the callback function.
Since the resource of the relevant handle is access within the server process for a while after exiting the callback, severe problems such as access violation may occur.
Only one callback function can be registered.
If you register more than once, the already registered callback function will be overwritten by the callback function you registered later.
You can unregister a registered function by specifying NULL for func.
void criAtomPlayer_SetStatusChangeCallback | ( | CriAtomPlayerHn | player, |
CriAtomPlayerStatusChangeCbFunc | func, | ||
void * | obj | ||
) |
Register status change callback function
[in] | player | Atom player handle |
[in] | func | status change callback function |
[in] | obj | user specified object |
void criAtomPlayer_SetParameterChangeCallback | ( | CriAtomPlayerHn | player, |
CriAtomPlayerParameterChangeCbFunc | func, | ||
void * | obj | ||
) |
Register parameter change callback function
[in] | player | Atom player handle |
[in] | func | status change callback function |
[in] | obj | user specified object |
void criAtomPlayer_SetFilterCallback | ( | CriAtomPlayerHn | player, |
CriAtomPlayerFilterCbFunc | func, | ||
void * | obj | ||
) |
Register wave filter callback function
[in] | player | Atom player handle |
[in] | func | wave filter callback function |
[in] | obj | user specified object |
void criAtomPlayer_SetLoadRequestCallback | ( | CriAtomPlayerHn | player, |
CriAtomPlayerLoadRequestCbFunc | func, | ||
void * | obj | ||
) |
Registering a load request callback function
[in] | player | Atom player handle |
[in] | func | Load request callback function |
[in] | obj | User specified object |
void criAtomPlayer_SetHcaFormat | ( | CriAtomPlayerHn | player, |
CriSint32 | num_channels, | ||
CriSint32 | sampling_rate, | ||
CriSint32 | bitrate | ||
) |
Specifying the HCA format
[in] | player | Atom player |
[in] | num_channels | Number of channels |
[in] | sampling_rate | Sampling rate |
[in] | bitrate | Bitrate |