CRI ADX  Last Updated: 2024-07-17 10:47 p
CriAtomExPlayback API

Data Structures

struct  CriAtomExSourceInfoTag
 Playback source information. More...
 
struct  CriAtomExPlaybackInfoDetailTag
 Playback information details. More...
 

Macros

#define CRIATOMEX_INVALID_PLAYBACK_ID   (0xFFFFFFFF)
 Invalid playback ID. More...
 
#define CRIATOMEX_INVALID_BLOCK_INDEX   (0xFFFFFFFF)
 Invalid Block Index. More...
 

Typedefs

typedef enum CriAtomExPlaybackStatusTag CriAtomExPlaybackStatus
 Playback status. More...
 
typedef enum CriAtomExSourceTypeTag CriAtomExSourceType
 Playback source type. More...
 
typedef struct CriAtomExSourceInfoTag CriAtomExSourceInfo
 Playback source information. More...
 
typedef enum CriAtomExPlaybackEventTag CriAtomExPlaybackEvent
 Playback Event. More...
 
typedef struct CriAtomExPlaybackInfoDetailTag CriAtomExPlaybackInfoDetail
 Playback information details. More...
 
typedef void(* CriAtomExPlaybackEventCbFunc) (void *obj, CriAtomExPlaybackEvent playback_event, const CriAtomExPlaybackInfoDetail *info)
 Replay event callback function type. More...
 

Enumerations

enum  CriAtomExPlaybackStatusTag { CRIATOMEXPLAYBACK_STATUS_PREP = 1 , CRIATOMEXPLAYBACK_STATUS_PLAYING , CRIATOMEXPLAYBACK_STATUS_REMOVED , CRIATOMEXPLAYBACK_STATUS_ENUM_SIZE_IS_4BYTES = 0x7FFFFFFF }
 Playback status. More...
 
enum  CriAtomExSourceTypeTag {
  CRIATOMEX_SOURCE_TYPE_NONE = 0 , CRIATOMEX_SOURCE_TYPE_CUE_ID , CRIATOMEX_SOURCE_TYPE_CUE_NAME , CRIATOMEX_SOURCE_TYPE_CUE_INDEX ,
  CRIATOMEX_SOURCE_TYPE_DATA , CRIATOMEX_SOURCE_TYPE_FILE , CRIATOMEX_SOURCE_TYPE_CONTENT_ID , CRIATOMEX_SOURCE_TYPE_WAVE_ID ,
  CRIATOMEX_SOURCE_TYPE_VIBRATION_ID , CRIATOMEX_SOURCE_TYPE_SOUND_GENERATOR_ID , CRIATOMEX_SOURCE_TYPE_RAW_PCM_FLOAT_ID , CRIATOMEX_SOURCE_TYPE_INPUT_PORT ,
  CRIATOMEX_SOURCE_TYPE_ENUM_SIZE_IS_4BYTES = 0x7FFFFFFF
}
 Playback source type. More...
 
enum  CriAtomExPlaybackEventTag { CRIATOMEX_PLAYBACK_EVENT_ALLOCATE = 0 , CRIATOMEX_PLAYBACK_EVENT_FROM_VIRTUAL_TO_NORMAL , CRIATOMEX_PLAYBACK_EVENT_FROM_NORMAL_TO_VIRTUAL , CRIATOMEX_PLAYBACK_EVENT_REMOVE , CRIATOMEX_PLAYBACK_EVENT_ENUM_SIZE_IS_4BYTES = 0x7FFFFFFF }
 Playback Event. More...
 

Functions

void criAtomExPlayback_Stop (CriAtomExPlaybackId id)
 Stop the sound. More...
 
void criAtomExPlayback_StopWithoutReleaseTime (CriAtomExPlaybackId id)
 Stop the sound (ignoring the release time) More...
 
void criAtomExPlayback_Pause (CriAtomExPlaybackId id, CriBool sw)
 Pause/resume the sound. More...
 
void criAtomExPlayback_Resume (CriAtomExPlaybackId id, CriAtomExResumeMode mode)
 Resume the audio playback (paused by a specific pause method) More...
 
CriBool criAtomExPlayback_IsPaused (CriAtomExPlaybackId id)
 Get the pause status of the sound. More...
 
CriAtomExPlaybackStatus criAtomExPlayback_GetStatus (CriAtomExPlaybackId id)
 Get the playback status. More...
 
CriBool criAtomExPlayback_GetFormatInfo (CriAtomExPlaybackId id, CriAtomExFormatInfo *info)
 Get information about the format of the sound being played. More...
 
CriBool criAtomExPlayback_GetSource (CriAtomExPlaybackId id, CriAtomExSourceInfo *source)
 Get information about the source of the sound. More...
 
CriAtomPlayerHn criAtomExPlayback_GetAtomPlayer (CriAtomExPlaybackId id)
 Acquisition of an Atom player. More...
 
CriSint64 criAtomExPlayback_GetTime (CriAtomExPlaybackId id)
 Get the playback time. More...
 
CriSint64 criAtomExPlayback_GetTimeSyncedWithAudio (CriAtomExPlaybackId id)
 Get the playback time (synchronized with playback sound) More...
 
CriSint64 criAtomExPlayback_GetTimeSyncedWithAudioMicro (CriAtomExPlaybackId id)
 Get the playback time (synchronized with playback sound) More...
 
CriSint64 criAtomExPlayback_GetSequencePosition (CriAtomExPlaybackId id)
 Acquiring the sequence playback position. More...
 
CriBool criAtomExPlayback_GetNumPlayedSamples (CriAtomExPlaybackId id, CriSint64 *num_samples, CriSint32 *sampling_rate)
 Get the number of samples played. More...
 
CriBool criAtomExPlayback_GetNumRenderedSamples (CriAtomExPlaybackId id, CriSint64 *num_samples, CriSint32 *sampling_rate)
 Get the number of samples to write to the sound buffer. More...
 
CriBool criAtomExPlayback_GetParameterFloat32 (CriAtomExPlaybackId playback_id, CriAtomExParameterId parameter_id, CriFloat32 *value_float32)
 Get a parameter (floating point number) More...
 
CriBool criAtomExPlayback_GetParameterUint32 (CriAtomExPlaybackId playback_id, CriAtomExParameterId parameter_id, CriUint32 *value_uint32)
 Get a parameter (unsigned integer) More...
 
CriBool criAtomExPlayback_GetParameterSint32 (CriAtomExPlaybackId playback_id, CriAtomExParameterId parameter_id, CriSint32 *value_sint32)
 Get a parameter (signed integer) More...
 
CriBool criAtomExPlayback_GetAisacControlById (CriAtomExPlaybackId playback_id, CriAtomExAisacControlId control_id, CriFloat32 *control_value)
 Get the value of an AISAC control (specified by its ID) More...
 
CriBool criAtomExPlayback_GetAisacControlByName (CriAtomExPlaybackId playback_id, const CriChar8 *control_name, CriFloat32 *control_value)
 Get the value of an AISAC control (specified by its name) More...
 
void criAtomExPlayback_SetNextBlockIndex (CriAtomExPlaybackId id, CriAtomExBlockIndex index)
 Set the index of the next block. More...
 
CriAtomExBlockIndex criAtomExPlayback_GetCurrentBlockIndex (CriAtomExPlaybackId id)
 Get the current block index of the sound beng played back. More...
 
CriBool criAtomExPlayback_GetPlaybackTrackInfo (CriAtomExPlaybackId id, CriAtomExPlaybackTrackInfo *info)
 Get the playback track info. More...
 
CriBool criAtomExPlayback_GetBeatSyncInfo (CriAtomExPlaybackId id, CriAtomExBeatSyncInfo *info)
 Get the beat synchronization information. More...
 
CriBool criAtomExPlayback_SetBeatSyncOffset (CriAtomExPlaybackId id, CriSint16 time_ms)
 Beat sync offset setting. More...
 

Detailed Description

Macro Definition Documentation

◆ CRIATOMEX_INVALID_PLAYBACK_ID

#define CRIATOMEX_INVALID_PLAYBACK_ID   (0xFFFFFFFF)

Invalid playback ID.

Description:
Invalid playback ID that is returned when the criAtomExPlayer_Start function is called to start playback but voices could not be allocated (for example due to voice limit control).
Remarks:
Passing this ID to a function that requires a playback ID will not trigger an error callback.
(The function will simply return without doing anything.)
Therefore, regardless of the result of the criAtomExPlayer_Start function, functions that require a playback ID can still be called at any time without a problem.
See also
CriAtomExPlaybackId, criAtomExPlayer_Start

◆ CRIATOMEX_INVALID_BLOCK_INDEX

#define CRIATOMEX_INVALID_BLOCK_INDEX   (0xFFFFFFFF)

Invalid Block Index.

Description:
It is possible to get the index of the block being currently played by calling the criAtomExPlayback_GetCurrentBlockIndex function. However, if the sound being played is not a block sequence, this invalid block index is returned.
See also
criAtomExPlayback_GetCurrentBlockIndex

Typedef Documentation

◆ CriAtomExPlaybackStatus

Playback status.

Description:
The status of the audio played in the AtomEx player.
Call the criAtomExPlayback_GetStatus function to get the status.

Usually, the playback status changes in the following order:
  1. CRIATOMEXPLAYBACK_STATUS_PREP
  2. CRIATOMEXPLAYBACK_STATUS_PLAYING
  3. CRIATOMEXPLAYBACK_STATUS_REMOVED
Remarks:
CriAtomExPlaybackStatus is not the status of an AtomEx Player, but the status of a single voice being played back on the player (i.e. a voice for which the criAtomExPlayer_Start function was executed).

The audio resources allocated for the playback are destroyed when it is stopped.
Therefore, the status of the playback voice is switched to CRIATOMEXPLAYBACK_STATUS_REMOVED in the following cases:
  • When the playback is complete.
  • When the playback is stopped by calling the criAtomExPlayback_Stop function.
  • When a higher-priority request steals the voice currently being played.
  • When an error occurs during the playback.
See also
criAtomExPlayer_Start, criAtomExPlayback_GetStatus, criAtomExPlayback_Stop

◆ CriAtomExSourceType

Playback source type.

Description:
The source type of the audio to be played by the AtomEx player or being played by the AtomEx player.
See also
CriAtomExSourceInfo

◆ CriAtomExSourceInfo

Playback source information.

Description:
Structure that contains information about the source of a voice being played back by an AtomEx Player.
It can be acquired by calling the criAtomExPlayback_GetSource function.
Further details may be retrieved by passing the acquired information to functions such as criAtomExAcb_GetCueInfoByIndex .
Remarks:
The information that can be retrieved depends on the source type.
Check "type" and select which structure is relevant in the union "source" to access the data.
criAtomExPlayback_GetSource(playback_id, &source);
switch (source.type) {
case CRIATOMEXPLAYBACK_SOURCE_TYPE_CUE_ID:
{
CriAtomExCueInfo cue_info;
criAtomExAcb_GetCueInfoById(source.info.cue_id.acb, source.info.cue_id.id, &cue_info);
:
}
break;
:
}
CriBool criAtomExAcb_GetCueInfoById(CriAtomExAcbHn acb_hn, CriAtomExCueId id, CriAtomExCueInfo *info)
Get information about the Cue whose ID is specified.
CriBool criAtomExPlayback_GetSource(CriAtomExPlaybackId id, CriAtomExSourceInfo *source)
Get information about the source of the sound.
Cue information.
Definition: cri_le_atom_ex.h:3144
Playback source information.
Definition: cri_le_atom_ex.h:4236
CriAtomExSourceType type
Definition: cri_le_atom_ex.h:4238
See also
criAtomExPlayback_GetSource, criAtomExAcb_GetCueInfoByIndex

◆ CriAtomExPlaybackEvent

Playback Event.

Description:
A value indicating the type of playback event.
Passed as an argument to the playback event callback.
See also
CriAtomExPlaybackEventCbFunc, criAtomExPlayer_SetPlaybackEventCallback

◆ CriAtomExPlaybackInfoDetail

Playback information details.

Description:
It is a structure to notify detailed information about the playback when the playback event occurs.
Passed as an argument to the playback event callback.
See also
CriAtomExPlaybackEventCbFunc, criAtomExPlayer_SetPlaybackEventCallback

◆ CriAtomExPlaybackEventCbFunc

typedef void( * CriAtomExPlaybackEventCbFunc) (void *obj, CriAtomExPlaybackEvent playback_event, const CriAtomExPlaybackInfoDetail *info)

Replay event callback function type.

Parameters
[in]objUser specified object
[in]playback_eventPlayback Event
[in]infoInformation
Description:
The type of callback function used to notify of playback events.
By registering a callback function of this function type in the criAtomExPlayer_SetPlaybackEventCallback function, it is possible to receive a callback when a playback event occurs.
Attention
If you block processing for a long time in this callback function, problems such as sound disconnection may occur.
See also
criAtomExPlayer_SetPlaybackEventCallback, CriAtomExPlaybackEvent, CriAtomExPlaybackInfoDetail

Enumeration Type Documentation

◆ CriAtomExPlaybackStatusTag

Playback status.

Description:
The status of the audio played in the AtomEx player.
Call the criAtomExPlayback_GetStatus function to get the status.

Usually, the playback status changes in the following order:
  1. CRIATOMEXPLAYBACK_STATUS_PREP
  2. CRIATOMEXPLAYBACK_STATUS_PLAYING
  3. CRIATOMEXPLAYBACK_STATUS_REMOVED
Remarks:
CriAtomExPlaybackStatus is not the status of an AtomEx Player, but the status of a single voice being played back on the player (i.e. a voice for which the criAtomExPlayer_Start function was executed).

The audio resources allocated for the playback are destroyed when it is stopped.
Therefore, the status of the playback voice is switched to CRIATOMEXPLAYBACK_STATUS_REMOVED in the following cases:
  • When the playback is complete.
  • When the playback is stopped by calling the criAtomExPlayback_Stop function.
  • When a higher-priority request steals the voice currently being played.
  • When an error occurs during the playback.
See also
criAtomExPlayer_Start, criAtomExPlayback_GetStatus, criAtomExPlayback_Stop
Enumerator
CRIATOMEXPLAYBACK_STATUS_PREP 

In preparation for playback

CRIATOMEXPLAYBACK_STATUS_PLAYING 

In playback

CRIATOMEXPLAYBACK_STATUS_REMOVED 

Removed

◆ CriAtomExSourceTypeTag

Playback source type.

Description:
The source type of the audio to be played by the AtomEx player or being played by the AtomEx player.
See also
CriAtomExSourceInfo
Enumerator
CRIATOMEX_SOURCE_TYPE_NONE 

Not set

CRIATOMEX_SOURCE_TYPE_CUE_ID 

Cue ID

CRIATOMEX_SOURCE_TYPE_CUE_NAME 

Cue name

CRIATOMEX_SOURCE_TYPE_CUE_INDEX 

Cue index

CRIATOMEX_SOURCE_TYPE_DATA 

In-memory data

CRIATOMEX_SOURCE_TYPE_FILE 

File name

CRIATOMEX_SOURCE_TYPE_CONTENT_ID 

CPK content ID

CRIATOMEX_SOURCE_TYPE_WAVE_ID 

Audio data ID

CRIATOMEX_SOURCE_TYPE_VIBRATION_ID 

Vibration ID

CRIATOMEX_SOURCE_TYPE_SOUND_GENERATOR_ID 

Sound generator ID

CRIATOMEX_SOURCE_TYPE_RAW_PCM_FLOAT_ID 

RawPcmFloatID

CRIATOMEX_SOURCE_TYPE_INPUT_PORT 

Input port

◆ CriAtomExPlaybackEventTag

Playback Event.

Description:
A value indicating the type of playback event.
Passed as an argument to the playback event callback.
See also
CriAtomExPlaybackEventCbFunc, criAtomExPlayer_SetPlaybackEventCallback
Enumerator
CRIATOMEX_PLAYBACK_EVENT_ALLOCATE 

Allocating new playback resources.

Description:
This value indicates that the resources required for cue playback have been secured.
When resources are allocated, no voices are assigned and no sound is produced (they are created in a virtualized state).
CRIATOMEX_PLAYBACK_EVENT_FROM_VIRTUAL_TO_NORMAL 

Voice assignment.

Description:
This value indicates that a voice has been assigned to the virtual state playback resource.
When a voice is assigned, the cue will be playbacked.
Remarks:
If the cue contains multiple waveform data, this event occurs when one of the waveform data is played back.
(This event occurs when the number of voices related to cue playback changes from 0 to 1)
This event does not occur at the timing when additional voices are assigned while voices have already been assigned.
CRIATOMEX_PLAYBACK_EVENT_FROM_NORMAL_TO_VIRTUAL 

Virtualization.

Description:
A value indicating that cue playback has been virtualized.
Raised when a voice is disconnected from the currently playing cue due to any of the following factors.
  • The voice is no longer needed because the waveform data contained in the cue has been played back to the end
  • The waveform data being played back was stopped by calling the criAtomExPlayer_Stop function etc.
  • Priority control stops waveform data being played back and voices are stolen
Remarks:
This event indicates that the "waveform data" included in the cue is no longer played back.
Cue playback has not ended at the time of this event.
(the CRIATOMEX_PLAYBACK_EVENT_REMOVE event will occur when cue playback is complete.)

If the cue contains multiple waveform data, this event occurs when all waveform data is not reproduced.
(This event occurs when the number of voices related to cue playback changes from 1 to 0)
This event does not occur if one of the voices is assigned and one of them is stopped.
CRIATOMEX_PLAYBACK_EVENT_REMOVE 

Releasing playback resources.

Description:
This value indicates that the playback resource has been released.
This event occurs when playback of the cue is completed, or when the cue is stopped due to a stop playback request.
Remarks:
If waveform data included in the cue is being played back, the CRIATOMEX_PLAYBACK_EVENT_FROM_NORMAL_TO_VIRTUAL event always occurs before this event occurs.

Function Documentation

◆ criAtomExPlayback_Stop()

void criAtomExPlayback_Stop ( CriAtomExPlaybackId  id)

Stop the sound.

Parameters
[in]idplayback ID
Description:
Stops the specified sound.
You can use this function to stop individual sounds from being played by the player without stopping the player itself.
Remarks:
If you want to stop all the sounds being played back by an AtomEx player, use the criAtomExPlayer_Stop function instead.
(The criAtomExPlayer_Stop function stops all sounds being played back by the specified player.)
Attention
When a sound is stopped with this function, its status changes to CRIATOMEXPLAYBACK_STATUS_REMOVED .
Since the Voice resource is also destroyed when the sound is stopped, once the status changes to CRIATOMEXPLAYBACK_STATUS_REMOVED , no information can be obtained from that playback ID anymore.
See also
criAtomExPlayer_Stop, criAtomExPlayback_GetStatus

◆ criAtomExPlayback_StopWithoutReleaseTime()

void criAtomExPlayback_StopWithoutReleaseTime ( CriAtomExPlaybackId  id)

Stop the sound (ignoring the release time)

Parameters
[in]idplayback ID
Description:
Stops the specified sound.
This function stops the sound immediately, even when a release time has been set for the envelope.
You can use this function to stop individual sounds from being played by the player without stopping the player itself.
Remarks:
If you want to stop all the sounds being played back by a player, use the criAtomExPlayer_StopWithoutReleaseTime function instead.
Attention
When a sound is stopped with this function, its status changes to CRIATOMEXPLAYBACK_STATUS_REMOVED .
Since the Voice resource is also destroyed when the sound is stopped, once the status changes to CRIATOMEXPLAYBACK_STATUS_REMOVED , no information can be obtained from that playback ID anymore.
See also
criAtomExPlayer_StopWithoutReleaseTime

◆ criAtomExPlayback_Pause()

void criAtomExPlayback_Pause ( CriAtomExPlaybackId  id,
CriBool  sw 
)

Pause/resume the sound.

Parameters
[in]idplayback ID
[in]swswitch ( CRI_FALSE = resume, CRI_TRUE = pause )
Description:
Pauses/unpauses each playback sound.
If you specify CRI_TRUE for sw and execute this function, the sound with the specified ID will be paused (temporarily stopped).
If you specify CRI_FALSE for sw and execute this function, the sound with the specified ID will be unpaused and playback of the paused sound will resume.

You can use this function to pause/resume individual sounds being played back by the player without pausing/resuming the player itself.
Remarks:
If you want to pause/resume all the sounds being played back by a player, use the criAtomExPlayer_Pause function instead.

When you use this function to pause/resume individual sounds having a fader attached, the crossfading will be performed according to the pause status.
For example, if you pause both audio tracks using the criAtomExPlayer_Pause function during a crossfade, the crossfade process will resume if you unpause the audio track that is fading in, but it will not resume if you unpause the audio track that is fading out.
Attention
When passing CRI_FALSE in the second argument (sw), both a sound previously paused by this function or a sound in playback preparation (if you called criAtomExPlayer_Prepare ) will start to play.
(This is done to maintain compatibility with the older versions.)
If you want to cancel the pause only for the audio that was paused by this function, do not use this function, but execute criAtomExPlayback_Resume(id, CRIATOMEX_RESUME_PAUSED_PLAYBACK); to cancel the pause.

When you release the pause for a sound which as a fader attached, if a playback resource used for the fade-in sound cannot be allocated or if it has been stolen by another sound, the pause cannot be released and the sound to be faded-out can never be started.
For a sound played by a player whith a fader attached, release the pause by calling criAtomExPlayer_Pause instead of this function.
See also
criAtomExPlayback_IsPaused, criAtomExPlayer_Pause, criAtomExPlayback_Resume

◆ criAtomExPlayback_Resume()

void criAtomExPlayback_Resume ( CriAtomExPlaybackId  id,
CriAtomExResumeMode  mode 
)

Resume the audio playback (paused by a specific pause method)

Parameters
[in]idplayback ID
[in]moderesume target
Description:
Resumes the audio playback which was paused with a specific method.
Unlike the criAtomExPlayback_Pause function, it is possible to resume audio that is waiting to be played using the criAtomExPlayer_Prepare function and audio that is paused using the criAtomExPlayer_Pause function (or the criAtomExPlayback_Pause function) separately.

Executing this function when the argument (mode) is set to CRIATOMEX_RESUME_PAUSED_PLAYBACK resumes the playback of the audio that was paused by the criAtomExPlayer_Pause or the criAtomExPlayback_Pause functions.
Executing this function when the argument (mode) is set to CRIATOMEX_RESUME_PREPARED_PLAYBACK starts the playback of the audio prepared by the criAtomExPlayer_Prepare function.

If you use the criAtomExPlayer_Prepare function to prepare for playback on a player that has been paused using the criAtomExPlayback_Pause function, the audio will not start playing until both the pause release process specified by CRIATOMEX_RESUME_PAUSED_PLAYBACK and the pause release process specified by CRIATOMEX_RESUME_PREPARED_PLAYBACK are performed.
Remarks:
When you use this function to pause/resume individual sounds having a fader attached, the crossfading will be performed according to the pause status.
For example, when the criAtomExPlayer_Pause function is used during crossfading to pause the sounds on both sides, canceling the pause of the sound on the fade-in side will resume the crossfading. However, the crossfading cannot be resumed by canceling the pause of the sound on the fade-out side.
Attention
When you release the pause for a sound which as a fader attached, if a playback resource used for the fade-in sound cannot be allocated or if it has been stolen by another sound, the pause cannot be released and the sound to be faded-out can never be started.
For a sound played by a player whith a fader attached, release the pause by calling criAtomExPlayer_Pause instead of this function.
See also
criAtomExPlayback_IsPaused, criAtomExPlayer_Resume, criAtomExPlayer_Pause

◆ criAtomExPlayback_IsPaused()

CriBool criAtomExPlayback_IsPaused ( CriAtomExPlaybackId  id)

Get the pause status of the sound.

Parameters
[in]idplayback ID
Returns
CriBool whether the sound is paused or not (CRI_FALSE = not paused, CRI_TRUE = paused)
Description:
Returns whether the sound specified by the playback ID is paused or not.
See also
criAtomExPlayback_Pause

◆ criAtomExPlayback_GetStatus()

CriAtomExPlaybackStatus criAtomExPlayback_GetStatus ( CriAtomExPlaybackId  id)

Get the playback status.

Parameters
[in]idplayback ID
Returns
CriAtomExPlaybackStatus playback status
Description:
Gets the status of a sound being played back by calling the criAtomExPlayer_Start function.
Remarks:
While the criAtomExPlayer_GetStatus function returns the status of an AtomEx player, this function gets status of an individual sound already being played.

The voice resource for the sound being played back can be removed in the following occasions:
  • When the playback has finished.
  • When the current sound is stopped by the criAtomExPlayback_Stop function.
  • When the current Voice has been stolen by a playback request with a higher priority.
  • When an error has occurred during playback.

So, regardless of whether the sound was explicitly stopped using the criAtomExPlayback_Stop function or its playback was stopped due to other factors, its status changes to CRIATOMEXPLAYBACK_STATUS_REMOVED .
(Consequently, if you need to know if there was an error, you must use the criAtomExPlayer_GetStatus function instead of this function to check the status of the AtomEx player itself.)

See also
criAtomExPlayer_Start, criAtomExPlayer_GetStatus, criAtomExPlayback_Stop

◆ criAtomExPlayback_GetFormatInfo()

CriBool criAtomExPlayback_GetFormatInfo ( CriAtomExPlaybackId  id,
CriAtomExFormatInfo info 
)

Get information about the format of the sound being played.

Parameters
[in]idplayback ID
[out]infoformat information
Returns
CriBool whether the information could be retrieved or not (CRI_TRUE = success, CRI_FALSE = fail)
Description:
Gets information about the format of the sound being played by calling the criAtomExPlayer_Start function.

If the format information could be retrieved, this function returns CRI_TRUE.
If the corresponding Voice has already been removed, it returns CRI_FALSE.
Remarks:
When a cue with multiple sounds is being played back, the information about the first detected sound data is returned.
Attention
This function can get the format information only during sound playback.
If playback is being prepared, if it is finished, or if the voice has been stolen due its low priority, this function will fail to get the format information.
Please note that the voice playback status cannot be obtained using the criAtomExPlayback_GetStatus function.
See also
criAtomExPlayer_Start, criAtomExPlayer_GetStatus

◆ criAtomExPlayback_GetSource()

CriBool criAtomExPlayback_GetSource ( CriAtomExPlaybackId  id,
CriAtomExSourceInfo source 
)

Get information about the source of the sound.

Parameters
[in]idplayback ID
[out]sourcesource information
Return values
CRI_TRUE= information was successfully retrieved
CRI_FALSE= failed to get information
Description:
Gets information about the source of the sound played back by the criAtomExPlayer_Start function.
By using functions such as criAtomExAcb_GetCueInfoByIndex on the data returned, it is possible to get even more detailed information.

If the source information could be retrieved, this function returns CRI_TRUE.
If the corresponding Voice has already been removed, it returns CRI_FALSE.
Remarks:
The information that can be retrieved depends on the source type.
Check the "type" field of info and use the right data structure to examine the "source" union.
criAtomExPlayback_GetSource(playback_id, &source);
switch (source.type) {
case CRIATOMEXPLAYBACK_SOURCE_TYPE_CUE_ID:
{
CriAtomExCueInfo cue_info;
criAtomExAcb_GetCueInfoById(source.info.cue_id.acb, source.info.cue_id.id, &cue_info);
:
}
break;
:
}
Attention
This function can retrieve the information about the source only when the sound is being played back.
If the playback has finished or the Voice was removed, any attempt to get the information will fail.
See also
criAtomExPlayer_Start, criAtomExPlayer_GetStatus

◆ criAtomExPlayback_GetAtomPlayer()

CriAtomPlayerHn criAtomExPlayback_GetAtomPlayer ( CriAtomExPlaybackId  id)

Acquisition of an Atom player.

Parameters
[in]idPlayback ID
Return values
CriAtomPlayerHnAtom player handle
Description:
Gets the voice (= Atom player handle) associated with the given playback ID.
Remarks:
When playing a cue containing multiple waveforms - and therefore voices - this function returns the Atom player handle corresponding to the first voice that was found.
If no waveform data is being played, this function returns NULL.

◆ criAtomExPlayback_GetTime()

CriSint64 criAtomExPlayback_GetTime ( CriAtomExPlaybackId  id)

Get the playback time.

Parameters
[in]idplayback ID
Returns
Sint64 playback time (in milliseconds)
Description:
Gets the playback time of a sound played by calling the criAtomExPlayer_Start function.

If the playback time was successfully acquired, this function returns a value of 0 or larger.
If this function failed to get the playback time (for example because it could not acquire a voice), it returns a negative value.
Remarks:
The playback time returned by this function is the time since the playback is started.
The playback time is never decremented based on the playback position, even with loop playback or seamless concatenated playback.

When the criAtomExPlayer_Pause function pauses the playback, the counting of the playback time is also stopped.
(The counting starts again when the playback is resumed.)
The accuracy of the time returned by this function depends on the frequency of server processing.
(Time is updated at each server process.)
If you need a more accurate time, use the criAtomExPlayback_GetNumPlayedSamples function to get the number of samples that have been played.
Attention
Although the type of the return value is long, its precision is currently only 32 bits.
If you control the playback based on the playback time, note that the playback time will be invalid in about 24 days.
(The playback time overflows and becomes negative when it exceeds 2147483647 milliseconds.)

This function can retrieve the time only when a sound is being played back.
(unlike the criAtomExPlayer_GetTime function, this function can get the time for each sound being played back, but it is not possible to get the time once playback has ended.)
When the playback has finished or a Voice was removed by the playback control, attempts to get the playback time will fail.
(A negative value will be returned.)

Even if the sound data is not supplied temporarily (for example due to a read-retry by the disk), the counting of the playback time does not stop.
(The time continues to be incremented even when playback is stopped due to an insufficient supply of data.)
Therefore, if you synchronize the sound with a video based on the time acquired by this function, synchronization may be getting worse with each read retry.
If you must synchronize wave data with video very precisely, use the criAtomExPlayback_GetNumPlayedSamples function to synchronize with the number of samples that have been played.
See also
criAtomExPlayer_Start, criAtomExPlayer_GetTime, criAtomExPlayback_GetNumPlayedSamples

◆ criAtomExPlayback_GetTimeSyncedWithAudio()

CriSint64 criAtomExPlayback_GetTimeSyncedWithAudio ( CriAtomExPlaybackId  id)

Get the playback time (synchronized with playback sound)

Parameters
[in]idplayback ID
Returns
Sint64 playback time (in milliseconds)
Description:
Gets the playback time of a sound played by calling the criAtomExPlayer_Start function.

If the playback time was successfully acquired, this function returns a positive value (including 0).
If this function failed to get the playback time (for example because it could not acquire a voice), it returns a negative value.
Remarks:
Unlike the value corresponding to the "elapsed time since playback started" returned by the criAtomExPlayback_GetTime function, playback time synchronized with the sound being played can be acquired from this function.
When the supply of audio data is interrupted (e.g. due to read-retry processing of the device), or when audio output is disturbed by an interrupt from the system, the playback time counting temporarily stops.
Therefore, if you want something to be strictly synchronized with the reproduced sound, please use the time returned by this function.
However, even when performing loop playback or seamless concatenated playback, the time will not be rewound depending on the playback position.
For a sequence Cue with a low waveform density, it is not possible to acquire the playback time normally.

When the criAtomExPlayer_Pause function pauses the playback, the counting of the playback time is also stopped.
(The counting starts again when the playback is resumed.)
To obtain the playback time using this function, set enable_audio_synced_timer of CriAtomExPlayerConfig structure to CRI_TRUE when creating the corresponding AtomEx player.
By default it is disabled.

Although the type of the return value is long, its precision is currently only 32 bits.
If you control the playback based on the playback time, note that the playback time will become invalid after about 24 days.
(The playback time overflows and becomes negative when it exceeds 2147483647 milliseconds.)

This function can retrieve the time only when a sound is being played back.
(unlike the criAtomExPlayer_GetTime function, this function can get the time for each sound being played back, but it is not possible to get the time once the playback has ended.)
When the playback has finished or a Voice was removed by the playback control, attempts to get the playback time will fail.
(A negative value will be returned.)

This function internally calculates time, and depending on the platform, processing load may be a problem. It also returns the updated time for each call, even within the same frame than the application.
Basically, this function should be used only once per frame, although it depends on how the application uses the playback time.
See also
criAtomExPlayer_Create, criAtomExPlayer_Start, criAtomExPlayback_GetTime

◆ criAtomExPlayback_GetTimeSyncedWithAudioMicro()

CriSint64 criAtomExPlayback_GetTimeSyncedWithAudioMicro ( CriAtomExPlaybackId  id)

Get the playback time (synchronized with playback sound)

Parameters
[in]idplayback ID
Returns
Sint64 playback time (in microseconds)
Description:
Gets the playback time of a sound played by calling the criAtomExPlayer_Start function.

If the playback time was successfully acquired, this function returns a positive value (including 0).
If this function failed to get the playback time (for example because it could not acquire a voice), it returns a negative value.
Remarks:
Unlike the value corresponding to the "elapsed time since playback started" returned by the criAtomExPlayback_GetTime function, this function returns the playback time synchronized with the sound being played.
This means that when the supply of audio data is interrupted (e.g. due to read-retry processing of the device), or when audio output is halted by an interrupt from the system, the playback time counting temporarily stops.
Therefore, if you want something to be strictly synchronized with the reproduced sound, please use the time returned by this function.
However, even when performing loop playback or seamless concatenated playback, the time will not be rewound depending on the playback position.
For sequence Cues with a low waveform density, it is not possible to acquire the playback time normally.

When the criAtomExPlayer_Pause function pauses the playback, the counting of the playback time is also stopped.
(The counting starts again when the playback is resumed.)
To obtain the playback time using this function, set the enable_audio_synced_timer property of the CriAtomExPlayerConfig structure to CRI_TRUE when creating the corresponding AtomEx player.
By default it is disabled.

This function can retrieve the time only when a sound is being played back.
(unlike the criAtomExPlayer_GetTime function, this function can get the time for each sound being played back, but it is not possible to get the time once the playback has ended.)
When the playback has finished or when a Voice was removed by the playback control, attempts to get the playback time will fail.
(A negative value will be returned.)

This function internally calculates time, and depending on the platform, the processing load may be a problem. It also returns the updated time for each call, even within the same frame of the application.
Basically, this function should be used only once per frame, although it depends on how the application uses the playback time.
See also
criAtomExPlayer_Create, criAtomExPlayer_Start, criAtomExPlayback_GetTime

◆ criAtomExPlayback_GetSequencePosition()

CriSint64 criAtomExPlayback_GetSequencePosition ( CriAtomExPlaybackId  id)

Acquiring the sequence playback position.

Parameters
[in]idPlayback ID
Returns
Sint64 Sequence playback position (milliseconds)
Description:
Acquires the sequence playback position of the sound that was played with the criAtomExPlayer_Start function.

If the playback position was successfully acquired, this function returns a value of 0 or larger.
If the specified sequence has already been removed, this function returns a negative value.
Remarks:
The playback time returned by this function is the playback position on the sequence data.
After a sequence loop and block transition, the value after the rewind is returned.

The sequencer works for playback only by Cue specification. For playback except by Cue specification, this function returns a negative value.

When the criAtomExPlayer_Pause is used to pause playback, the update of the playback position is also stopped.
(When playback is resumed, the update starts again.)
Accuracy of the time that can be acquired by this function depends on the frequency of server processing.
(Time is updated at each server process.)
Attention
Although the type of the return value is CriSint64, accuracy is currently limited to 32 bits.
If you control playback based on the playback position, note that the playback position becomes invalid in about 24 days for data without settings such as a sequence loop.
(The playback position overflows and becomes a negative value when it exceeds 2147483647 milliseconds.)

This function can acquire the position only when sound is being played.
When playback has finished or the sequence was removed by control of the number of played sounds, it fails in acquiring the playback position.
(A negative value is returned.)

◆ criAtomExPlayback_GetNumPlayedSamples()

CriBool criAtomExPlayback_GetNumPlayedSamples ( CriAtomExPlaybackId  id,
CriSint64 *  num_samples,
CriSint32 *  sampling_rate 
)

Get the number of samples played.

Parameters
[in]idplayback ID
[out]num_samplesthe number of samples already played back
[out]sampling_ratesampling rate
Returns
CriBool whether the number of samples could be retrieved or not (CRI_TRUE = success, CRI_FALSE = fail)
Description:
Returns the number of samples played back by the criAtomExPlayer_Start function and the sampling rate.

If the number of samples played is obtained, this function returns true.
If the specified voice was already removed, this function returns false.
(If an error occurs, num_samples and sampling_rate are also negative.)
Remarks:
The accuracy of the number of samples returned depends on the sound library of the platform SDK.
(Depending on the platform, the accuracy of the number of played samples varies.)
When a Cue with multiple sounds is played back, the information about the first sound detected is returned.
Attention
If the sound data is not supplied temporarily because the device reads or writes, the counting of the samples played will stop.
(The counting will be resumed at the same time than the data supply.)

This function can retrieve the number of samples played only during sound playback.
Once the playback is finished or if the voice was stolen due to its lower priority, it will fail to obtain the number of samples played.
See also
criAtomExPlayer_Start

◆ criAtomExPlayback_GetNumRenderedSamples()

CriBool criAtomExPlayback_GetNumRenderedSamples ( CriAtomExPlaybackId  id,
CriSint64 *  num_samples,
CriSint32 *  sampling_rate 
)

Get the number of samples to write to the sound buffer.

Parameters
[in]idplayback ID
[out]num_samplesNumber of written samples (in units of sample)
[out]sampling_rateSampling rate (in Hz)
Returns
CriBool whether the number of samples is obtained ( CRI_TRUE = obtained, CRI_FALSE = not obtained)
Description:
Returns the number of samples written to the sound buffer and the sampling rate for the audio played by the criAtomExPlayer_Start function.
Unlike the criAtomExPlayback_GetNumPlayedSamples function, this function returns a value that includes the number of unoutput audio data samples written to the sound buffer.
If the number of written samples can be obtained, this function returns CRI_TRUE.
This function returns CRI_FALSE if the specified voice has already been erased.
(When an error occurs, the values of num_samples and sampling_rate will also be negative.)
Remarks:
The accuracy of the written samples value depends on the platform SDK's sound library.
(Accuracy of written samples varies by platform.)

When playing a cue containing multiple audio data, the information of the first audio data found is returned.
Attention
If the drive is subjected to read retry processing, etc. and the audio data supply is interrupted, the count-up of the number of written samples will stop.
(If the data supply is resumed, the count-up will be resumed.)

This function can acquire the number of written samples only during audio playback.
If the voice is deleted after the end of playback or by controlling the number of pronunciations, the acquisition of the number of written samples will fail.
See also
criAtomExPlayback_GetNumPlayedSamples

◆ criAtomExPlayback_GetParameterFloat32()

CriBool criAtomExPlayback_GetParameterFloat32 ( CriAtomExPlaybackId  playback_id,
CriAtomExParameterId  parameter_id,
CriFloat32 *  value_float32 
)

Get a parameter (floating point number)

Parameters
[in]playback_idplayback ID
[in]parameter_idparameter ID
[out]value_float32parameter value
Returns
Whether the parameter was obtained or not (CRI_TRUE = obtained, CRI_FALSE = not obtained)
Description:
Gets the value of a specific parameter (specified by its ID) of a sound played back by the criAtomExPlayer_Start function.
The value is returned as a floating point number.
This function returns CRI_TRUE when the parameter is successfully obtained.
If the specified Voice was already removed, or the parameter could not be obtained for some other reason, this function returns CRI_FALSE.
Attention
This function can only obtain the value of the parameter while the sound is being played back.
Once the playback has completed or the Voice has been removed due to priority control, this function will fail to obtain the parameter.
See also
CriAtomExParameterId, criAtomExPlayback_GetParameterUint32, criAtomExPlayback_GetParameterSint32

◆ criAtomExPlayback_GetParameterUint32()

CriBool criAtomExPlayback_GetParameterUint32 ( CriAtomExPlaybackId  playback_id,
CriAtomExParameterId  parameter_id,
CriUint32 *  value_uint32 
)

Get a parameter (unsigned integer)

Parameters
[in]playback_idplayback ID
[in]parameter_idparameter ID
[out]value_uint32parameter value
Returns
Whether the parameter was obtained or not (CRI_TRUE = obtained, CRI_FALSE = not obtained)
Description:
Gets the value of a specific parameter (specified by its ID) of a sound played back by the criAtomExPlayer_Start function.
The value is returned as an unsigned integer.
This function returns CRI_TRUE when the parameter is successfully obtained.
If the specified Voice was already removed, or the parameter could not be obtained for some other reason, this function returns CRI_FALSE.
Attention
This function can only obtain the value of the parameter while the sound is being played back.
Once the playback has completed or the Voice has been removed due to priority control, this function will fail to obtain the parameter.
See also
CriAtomExParameterId, criAtomExPlayback_GetParameterFloat32, criAtomExPlayback_GetParameterSint32

◆ criAtomExPlayback_GetParameterSint32()

CriBool criAtomExPlayback_GetParameterSint32 ( CriAtomExPlaybackId  playback_id,
CriAtomExParameterId  parameter_id,
CriSint32 *  value_sint32 
)

Get a parameter (signed integer)

Parameters
[in]playback_idplayback ID
[in]parameter_idparameter ID
[out]value_sint32parameter value
Returns
Whether the parameter was obtained or not (CRI_TRUE = obtained, CRI_FALSE = not obtained)
Description:
Gets the value of a specific parameter (specified by its ID) of a sound played back by the criAtomExPlayer_Start function.
The value is returned as a signed integer.
This function returns CRI_TRUE when the parameter is successfully obtained.
If the specified Voice was already removed, or the parameter could not be obtained for some other reason, this function returns CRI_FALSE.
Attention
This function can only obtain the value of the parameter while the sound is being played back.
Once the playback has completed or the Voice has been removed due to priority control, this function will fail to obtain the parameter.
See also
CriAtomExParameterId, criAtomExPlayback_GetParameterFloat32, criAtomExPlayback_GetParameterUint32

◆ criAtomExPlayback_GetAisacControlById()

CriBool criAtomExPlayback_GetAisacControlById ( CriAtomExPlaybackId  playback_id,
CriAtomExAisacControlId  control_id,
CriFloat32 *  control_value 
)

Get the value of an AISAC control (specified by its ID)

Parameters
[in]playback_idplayback ID
[in]control_idcontrol ID
[out]control_valuecontrol value (from 0.0f to 1.0f, -1.0f if not set)
Returns
Whether the AISAC control value was obtained or not (CRI_TRUE = obtained, CRI_FALSE = not obtained)
Description:
Gets the AISAC control value set for the audio played by the criAtomExPlayer_Start function by specifying the control ID.
This function returns CRI_TRUE if the AISAC control value is successfully obtained (including if it is -1.0f because the value is not set).
If the specified Voice was already removed, or the value could not be obtained for some other reason, this function returns CRI_FALSE.
Attention
This function can only obtain the AISAC control value while the sound is being played back.
After the playback is complete or if the Voice was removed due to priority control, this function will fail to obtain the AISAC control value.
See also
criAtomExPlayer_SetAisacControlById, criAtomExPlayback_GetAisacControlByName

◆ criAtomExPlayback_GetAisacControlByName()

CriBool criAtomExPlayback_GetAisacControlByName ( CriAtomExPlaybackId  playback_id,
const CriChar8 *  control_name,
CriFloat32 *  control_value 
)

Get the value of an AISAC control (specified by its name)

Parameters
[in]playback_idplayback ID
[in]control_namecontrol name
[out]control_valuecontrol value (0.0f to 1.0f. If not set, -1.0f.)
Returns
Whether the AISAC control value was obtained (CRI_TRUE = obtained, CRI_FALSE = not obtained)
Description:
Gets the AISAC control value set for the audio played by the criAtomExPlayer_Start function by specifying the control ID.
This function returns CRI_TRUE if the AISAC control value is successfully obtained (including if it is -1.0f because the value is not set).
If the specified Voice was already removed, or the value could not be obtained for some other reason, this function returns CRI_FALSE.
Attention
This function can only obtain the AISAC control value while the sound is being played back.
After the playback is complete or if the Voice was removed due to priority control, this function will fail to obtain the AISAC control value.
See also
criAtomExPlayer_SetAisacControlById, criAtomExPlayback_GetAisacControlByName

◆ criAtomExPlayback_SetNextBlockIndex()

void criAtomExPlayback_SetNextBlockIndex ( CriAtomExPlaybackId  id,
CriAtomExBlockIndex  index 
)

Set the index of the next block.

Parameters
[in]idplayback ID
[in]indexblock index
Description:
Performs a block transition at the next possible occasion.
By executing this function, the sound with the specified ID - if it has a block sequence - will transit to the specified block. The timing of the transition is determined by the settings.
Remarks:
Use the criAtomExPlayer_SetFirstBlockIndex function to specify the playback starting block, and use the criAtomExPlayback_GetCurrentBlockIndex function to obtain the current block index during playback.
See also
criAtomExPlayer_SetFirstBlockIndex, criAtomExPlayback_GetCurrentBlockIndex

◆ criAtomExPlayback_GetCurrentBlockIndex()

CriAtomExBlockIndex criAtomExPlayback_GetCurrentBlockIndex ( CriAtomExPlaybackId  id)

Get the current block index of the sound beng played back.

Parameters
[in]idplayback ID
Returns
CriAtomExBlockIndex current block index
Description:
Gets the current block index in the block sequence started by calling the criAtomExPlayer_Start function.
Remarks:
If the sound whose playback ID is specified is not a block sequence, CRIATOMEX_INVALID_BLOCK_INDEX is returned.
See also
criAtomExPlayer_Start, criAtomExPlayer_SetFirstBlockIndex, criAtomExPlayback_SetNextBlockIndex

◆ criAtomExPlayback_GetPlaybackTrackInfo()

CriBool criAtomExPlayback_GetPlaybackTrackInfo ( CriAtomExPlaybackId  id,
CriAtomExPlaybackTrackInfo info 
)

Get the playback track info.

Parameters
[in]idplayback ID
[out]infoplayback track info
Returns
CriBool Success / Failed
Description:
Get track information of the cue being played back.
Track information that can be acquired is only information immediately under the cue, information on subsequences and cue links can not be acquired.
Remarks:
If data corresponding to the following is being played, acquisition of track information will fail.
  • Data other than the cue is being played. (Because track information does not exist)
  • The cue being played is a polyphonic type or a switch type with a selector reference. (There is a possibility that there are two or more pieces of track information)
  • The cue being played is the track transition type. (Since the playback track changes due to the transition)

◆ criAtomExPlayback_GetBeatSyncInfo()

CriBool criAtomExPlayback_GetBeatSyncInfo ( CriAtomExPlaybackId  id,
CriAtomExBeatSyncInfo info 
)

Get the beat synchronization information.

Parameters
[in]idplayback ID
[out]infobeat synchronization info
Returns
CriBool Success / Failed
Description:
Get beat synchronization information of the cue being played back.
Can get the current BPM, bar count, beat count, beat progress ratio (0.0 - 1.0).
Beat synchronization information must be set in the cue.
It is not possible to get the information of the cue playing in cue link or start action.
Remarks:
Getting of beat synchronization information will fail if data corresponding to the following is playing.
  • Non-Cue data is being played. (Beat synchronization information does not exist)
  • The cue for which beat synchronization information is not set is being played.
  • The cue for which the beat synchronization information is set is played "indirectly". (It is playing with cue link and start action)

◆ criAtomExPlayback_SetBeatSyncOffset()

CriBool criAtomExPlayback_SetBeatSyncOffset ( CriAtomExPlaybackId  id,
CriSint16  time_ms 
)

Beat sync offset setting.

Parameters
[in]idplayback ID
[in]time_msOffset time
Returns
CriBool Success / Failed
Description:
Sets the beat sync offset for the playing cue.
Beat synchronization information must be set for the cue.
You cannot set to the cue that is playing with cue link or start action.
Remarks:
Setting of beat synchronization information will fail if data corresponding to the following is playing.
  • Non-Cue data is being played. (Beat synchronization information does not exist)
  • The cue for which beat synchronization information is not set is being played.
  • The cue for which the beat synchronization information is set is played "indirectly". (It is playing with cue link and start action)