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

Macros

#define CRIATOMAWB_WORKSIZE_FOR_LOADFROMMEMORY   (64)
 Work area size required for creating on-memory AWB handle. More...
 
#define CRIATOMAWB_ILLEGAL_ID   (-1)
 Invalid waveform data ID. More...
 
#define CRIATOM_DEFAULT_DBAS_MAX_BPS
 Default initialization maximum bit rate for creating D-BAS. More...
 

Typedefs

typedef struct CriAtomAwbTag * CriAtomAwbHn
 AWB handle. More...
 
typedef enum CriAtomAwbStatusTag CriAtomAwbStatus
 AWB status. More...
 
typedef enum CriAtomAwbTypeTag CriAtomAwbType
 AWB type. More...
 

Enumerations

enum  CriAtomAwbStatusTag { CRIATOMAWB_STATUS_STOP = 0 , CRIATOMAWB_STATUS_LOADING , CRIATOMAWB_STATUS_COMPLETE , CRIATOMAWB_STATUS_ERROR , CRIATOMAWB_STATUS_ENUM_SIZE_IS_4BYTES = 0x7FFFFFFF }
 AWB status. More...
 
enum  CriAtomAwbTypeTag { CRIATOMAWB_TYPE_TOC = 0 , CRIATOMAWB_TYPE_ONMEMORY , CRIATOMAWB_TYPE_ERROR , CRIATOMAWB_TYPE_ENUM_SIZE_IS_4BYTES = 0x7FFFFFFF }
 AWB type. More...
 

Functions

CriSint32 criAtomAwb_CalculateWorkSizeForLoadToc (CriSint32 num)
 Calculate work area size required for loading AWB file's TOC information. More...
 
CriAtomAwbHn criAtomAwb_LoadToc (CriFsBinderHn binder, const CriChar8 *path, void *work, CriSint32 work_size)
 Load AWB file's TOC information (synchronous version) More...
 
CriAtomAwbHn criAtomAwb_LoadTocById (CriFsBinderHn binder, CriUint16 id, void *work, CriSint32 work_size)
 Load AWB file's TOC information specifying ID (synchronous version) More...
 
CriAtomAwbHn criAtomAwb_LoadTocAsync (CriFsBinderHn binder, const CriChar8 *path, void *work, CriSint32 work_size)
 Load AWB file's TOC information (asynchronous version) More...
 
CriAtomAwbHn criAtomAwb_LoadTocAsyncById (CriFsBinderHn binder, CriUint16 id, void *work, CriSint32 work_size)
 Load AWB file's TOC information specifying ID (asynchronous version) More...
 
CriAtomAwbHn criAtomAwb_LoadFromMemory (void *awb_mem, CriSint32 awb_mem_size, void *work, CriSint32 work_size)
 Create on-memory AWB handle. More...
 
CriAtomAwbType criAtomAwb_GetType (CriAtomAwbHn awb)
 Get value indicating AWB handle type. More...
 
CriBool criAtomAwb_GetWaveFileInfo (CriAtomAwbHn awb, CriSint32 id, CriSint64 *offset, CriUint32 *size)
 Get wave data file information from AWB TOC information. More...
 
void criAtomAwb_GetWaveDataInfo (CriAtomAwbHn awb, CriSint32 id, void **wave_data_start, CriUint32 *size)
 Get wave data information from on-memory AWB. More...
 
CriUint16 criAtomAwb_GetNumContents (CriAtomAwbHn awb)
 Get number of contents in AWB file through AWB handle. More...
 
void criAtomAwb_Release (CriAtomAwbHn awb)
 Release AWB handle. More...
 
CriBool criAtomAwb_IsReadyToRelease (CriAtomAwbHn awb)
 Check whether AWB handle can be released immediately. More...
 
CriAtomAwbStatus criAtomAwb_GetStatus (CriAtomAwbHn awb)
 Get AWB handle status. More...
 
CriSint32 criAtomAwb_GetIdByIndex (CriAtomAwbHn awb, CriUint16 index)
 Get waveform data ID. More...
 
CriFloat32 criAtomDsp_ConvertParameterFromCent (CriFloat32 cent)
 Convert from cent to DSP parameter. More...
 

Detailed Description

Macro Definition Documentation

◆ CRIATOMAWB_WORKSIZE_FOR_LOADFROMMEMORY

#define CRIATOMAWB_WORKSIZE_FOR_LOADFROMMEMORY   (64)

Work area size required for creating on-memory AWB handle.

Description:
Work area size required for creating on-memory AWB handle.
See also
criAtomAwb_LoadFromMemory

◆ CRIATOMAWB_ILLEGAL_ID

#define CRIATOMAWB_ILLEGAL_ID   (-1)

Invalid waveform data ID.

Description:
The value returned when the criAtomAwb_GetIdByIndex function fails.
See also
criAtomAwb_GetIdByIndex

◆ CRIATOM_DEFAULT_DBAS_MAX_BPS

#define CRIATOM_DEFAULT_DBAS_MAX_BPS
Value:
(criAtom_CalculateAdxBitrate(CRIATOM_DEFAULT_INPUT_MAX_CHANNELS,\
CRIATOM_DEFAULT_INPUT_MAX_SAMPLING_RATE)\
* CRIATOM_DEFAULT_DBAS_MAX_STREAMS)
CriSint32 criAtom_CalculateAdxBitrate(CriSint32 num_channels, CriSint32 sampling_rate)
Calculate bit rate of ADX data.

Default initialization maximum bit rate for creating D-BAS.

Description:
Default initialization maximum bit rate for creating D-BAS.
This value is calculated for the default maximum number of streams defined on each platform, assuming streaming playback of stereo ADX data.
See also
criAtomDbas_Create, criAtomDbas_CalculateWorkSize, criAtom_CalculateAdxBitrate

Typedef Documentation

◆ CriAtomAwbHn

typedef struct CriAtomAwbTag* CriAtomAwbHn

AWB handle.

Description:
Handle indicating the TOC information of the AWB file containing the playback data.
It is obtained with the criAtomAwb_LoadToc function.
See also
criAtomAwb_LoadToc

◆ CriAtomAwbStatus

AWB status.

Description:
Indicates the preparation status of an AWB.
It is obtained with the criAtomAwb_GetStatus function.
See also
criAtomAwb_GetStatus

◆ CriAtomAwbType

AWB type.

Description:
Indicates whether the AWB handle contains only the TOC information, or is an actual AWB handle loaded onto the memory. It is obtained with the criAtomAwb_GetType function.
See also
criAtomAwb_GetType

Enumeration Type Documentation

◆ CriAtomAwbStatusTag

AWB status.

Description:
Indicates the preparation status of an AWB.
It is obtained with the criAtomAwb_GetStatus function.
See also
criAtomAwb_GetStatus
Enumerator
CRIATOMAWB_STATUS_STOP 

Stopped

CRIATOMAWB_STATUS_LOADING 

Loading

CRIATOMAWB_STATUS_COMPLETE 

Load complete

CRIATOMAWB_STATUS_ERROR 

Load failed

◆ CriAtomAwbTypeTag

AWB type.

Description:
Indicates whether the AWB handle contains only the TOC information, or is an actual AWB handle loaded onto the memory. It is obtained with the criAtomAwb_GetType function.
See also
criAtomAwb_GetType
Enumerator
CRIATOMAWB_TYPE_TOC 

AWB handle with TOC information only

CRIATOMAWB_TYPE_ONMEMORY 

On-memory AWB handle

CRIATOMAWB_TYPE_ERROR 

Invalid AWB handle

Function Documentation

◆ criAtomAwb_CalculateWorkSizeForLoadToc()

CriSint32 criAtomAwb_CalculateWorkSizeForLoadToc ( CriSint32  num)

Calculate work area size required for loading AWB file's TOC information.

Parameters
[in]numnumber of contents in AWB file
Returns
CriSint32 work area size
Return values
>=0 successfully completed
-1error occurred
Description:
Retrieves the work area size required for loading the AWB file TOC information.

If work area size calculation fails, this function returns -1.
The reason for work area size calculation failure can be determined by viewing the error callback message.
Attention
You must initialize the library before executing this function.
See also
criAtomAwb_LoadToc, criAtomAwb_LoadTocAsync

◆ criAtomAwb_LoadToc()

CriAtomAwbHn criAtomAwb_LoadToc ( CriFsBinderHn  binder,
const CriChar8 *  path,
void *  work,
CriSint32  work_size 
)

Load AWB file's TOC information (synchronous version)

Parameters
[in]binderbinder handle
[in]pathAWB file name
[in]workAWB file TOC information load work area
[in]work_sizework area size
Returns
CriAtomAwbHn AWB handle
Description:
Loads the TOC information for an AWB file used as the sound source for sound playback.
Execute when scene switching or variation in load is permissible because this function does not return until loading completes.
When loading succeeds, a valid AWB handle is returned which should be specified in the criAtomPlayer_SetWaveId function.
Release the finished AWB handle with the criAtomAwb_Release function.
NULL is returned if loading of TOC information fails.
Remarks:
If this function is executed specifying NULL as the third argument and 0 as the fourth argument, the required work area is dynamically allocated within the function. The dynamically allocated area is released with the criAtomAwb_Release function.
Attention
An AWB handle internally allocates a binder ( CriFsBinderHn ) and loader ( CriFsLoaderHn ).
When loading AWB file TOC information, Atom library (or CRI File System library) must be initialized with setting that can allocate as many binders and loaders as the number of AWB handles.
See also
criAtomPlayer_SetWaveId, criAtomAwb_Release, criAtomAwb_LoadTocById

◆ criAtomAwb_LoadTocById()

CriAtomAwbHn criAtomAwb_LoadTocById ( CriFsBinderHn  binder,
CriUint16  id,
void *  work,
CriSint32  work_size 
)

Load AWB file's TOC information specifying ID (synchronous version)

Parameters
[in]binderbinder handle
[in]idID of CPK content containing AWB file
[in]workAWB file TOC information load work area
[in]work_sizework area size
Returns
CriAtomAwbHn AWB handle
Description:
This function is similar to the criAtomAwb_LoadToc function. However, unlike the criAtomAwb_LoadToc function, this function specifies content ID in the CPK rather than the path to load AWB file TOC information.
See also
criAtomPlayer_SetWaveId, criAtomAwb_Release, criAtomAwb_LoadToc

◆ criAtomAwb_LoadTocAsync()

CriAtomAwbHn criAtomAwb_LoadTocAsync ( CriFsBinderHn  binder,
const CriChar8 *  path,
void *  work,
CriSint32  work_size 
)

Load AWB file's TOC information (asynchronous version)

Parameters
[in]binderbinder handle
[in]pathAWB file name
[in]workAWB file TOC information load work area
[in]work_sizework area size
Returns
CriAtomAwbHn AWB handle
Description:
Loads the TOC information for an AWB file used as the sound source for sound playback.
Because this is an asyncrhonous function that issues load request, an application must wait until load completes.
Periodically retrieve the status of AWB handle with the criAtomAwb_GetStatus function and wait unitl load completes.
While waiting for load to complete, the criAtom_ExecuteMain function must be executed periodically to update the status of the AWB handle.
When issuing of load request succeeds, a valid AWB handle is returned.
After load completes successfully, specify this in the criAtomPlayer_SetWaveId function.
Release the finished AWB handle with the criAtomAwb_Release function.
NULL is returned if issuing of TOC information load request fails.
Remarks:
If this function is executed specifying NULL as the third argument and 0 as the fourth argument, the required work area is dynamically allocated within the function. The dynamically allocated area is released with the criAtomAwb_Release function.
When the status of AWB handle obtained with this function is error (CRIATOMAWB_STATUS_ERROR), also release with the criAtomAwb_Release function.
Attention
An AWB handle internally allocates a binder ( CriFsBinderHn ) as the number of Voices.
When loading AWB file TOC information, Atom library (or CRI File System library) must be initialized with setting that can allocate as many binders and this function.
See also
criAtomPlayer_SetWaveId, criAtomAwb_Release, criAtomAwb_GetStatus, criAtomAwb_LoadTocAsyncById

◆ criAtomAwb_LoadTocAsyncById()

CriAtomAwbHn criAtomAwb_LoadTocAsyncById ( CriFsBinderHn  binder,
CriUint16  id,
void *  work,
CriSint32  work_size 
)

Load AWB file's TOC information specifying ID (asynchronous version)

Parameters
[in]binderbinder handle
[in]idID of CPK content containing AWB file
[in]workAWB file TOC information load work area
[in]work_sizework area size
Returns
CriAtomAwbHn AWB handle
Description:
This function is similar to the criAtomAwb_LoadTocAsync function. However, unlike the criAtomAwb_LoadTocAsync function, this function specifies content ID in the CPK rather than the path to load AWB file TOC information.
See also
criAtomPlayer_SetWaveId, criAtomAwb_Release, criAtomAwb_GetStatus, criAtomAwb_LoadTocAsync

◆ criAtomAwb_LoadFromMemory()

CriAtomAwbHn criAtomAwb_LoadFromMemory ( void *  awb_mem,
CriSint32  awb_mem_size,
void *  work,
CriSint32  work_size 
)

Create on-memory AWB handle.

Parameters
[in]awb_mempointer to memory area in which AWB file is loaded
[in]awb_mem_sizeAWB file size
[in]workpointer to on-memory AWB work area
[in]work_sizeon-memory AWB work area size
Returns
CriAtomAwbHn on-memory AWB handle
Description:
Creates an on-memory AWB handle from an AWB file image loaded in memory.
Multiple on-memory AWB handles can be created from the same on-memory AWB file image.
There are two ways to allocate a work area.
(a) User Allocator method: A user provided function is used to allocate/release memory.
(b) Fixed Memory method: The required memory is passed directly to the library.

When using the User Allocator method, you do not need to provide a work area.
You can allocate the required memory with the registered memory allocation function simply by specifying NULL for work and 0 for work_size.
The memory dynamically allocated when creating on-memory AWB handle is
released when on-memory AWB is destroyed (when criAtomAwb_Release function is executed).
When using Fixed Memory method, obtain the required work area size with the CRIATOMAWB_WORKSIZE_FOR_LOADFROMMEMORY function.
Please note that unlike work areas, awb_mem must be managed by the user.

Attention
When this function succeeds, the memory area passed with awb_mem is overwritten for on-memory AWB data.
Therefore, if the CRIATOMAWB_WORKSIZE_FOR_LOADFROMMEMORY function is called from multiple threads,
the thread execution sequence may be changed due to exclusive control.
Please manually release the memory area pointed to by awb_mem after executing the criAtomAwb_Release function.
An AWB handle internally allocates a binder ( CriFsBinderHn ).
When AWB file TOC information is loaded, the Atom library (or CRI File System library) must be initialized with the setting that can allocate as many binders as the number of AWB handles.
See also
CRIATOMAWB_WORKSIZE_FOR_LOADFROMMEMORY,criAtomAwb_Release

◆ criAtomAwb_GetType()

CriAtomAwbType criAtomAwb_GetType ( CriAtomAwbHn  awb)

Get value indicating AWB handle type.

Parameters
[in]awbinformation source AWB handle
Returns
CriAtomAwbType value indicating AWB handle type
Description:
Obtains a value indicating whether the AWB handle contains only the TOC information, or is an actual AWB handle loaded onto the memory. If this function fails, CRIATOMAWB_TYPE_ERROR is returned.
See also
criAtomAwb_GetWaveDataInfo, criAtomPlayer_SetData,

◆ criAtomAwb_GetWaveFileInfo()

CriBool criAtomAwb_GetWaveFileInfo ( CriAtomAwbHn  awb,
CriSint32  id,
CriSint64 *  offset,
CriUint32 *  size 
)

Get wave data file information from AWB TOC information.

Parameters
[in]awbinformation source AWB handle
[in]idwave data ID
[out]offsetwave data offset (bytes)
[out]sizewave data size (bytes)
Returns
None
Description:
For an AWB handle, obtains the file offset and size of wave data specified with id.
The obtained offset and size are used when directly reading wave data from AWB file.
Attention
Check the type of AWB handle with the criAtomAwb_GetType function before executing this function.
If the AWB handle type is different or the AWB handle is invalid, this function fails and an error callback occurs.
If this function fails, the output offset and size are undefined.
See also
criAtomAwb_GetType, criAtomAwb_GetWaveDataInfo, criAtomPlayer_SetData,criAtomAwb_GetType

◆ criAtomAwb_GetWaveDataInfo()

void criAtomAwb_GetWaveDataInfo ( CriAtomAwbHn  awb,
CriSint32  id,
void **  wave_data_start,
CriUint32 *  size 
)

Get wave data information from on-memory AWB.

Parameters
[in]awbinformation source AWB handle
[in]idwave data ID
[out]wave_data_startwave data pointer (bytes)
[out]sizewave data size (bytes)
Returns
None
Description:
For an on-memory AWB, obtains the pointer and size of wave data specified with id.
When playing wave data from on-memory AWB, also refer to the criAtomPlayer_SetWaveId function because this is normally sufficient.
Attention
Check the type of AWB handle with the criAtomAwb_GetType function before executing this function.
If the AWB handle type is different or the AWB handle is invalid, this function fails and an error callback occurs.
If this function fails, the output wave_data_start and size are undefined.
See also
criAtomAwb_GetType, criAtomAwb_GetWaveFileInfo, criAtomPlayer_SetData,criAtomPlayer_SetWaveId

◆ criAtomAwb_GetNumContents()

CriUint16 criAtomAwb_GetNumContents ( CriAtomAwbHn  awb)

Get number of contents in AWB file through AWB handle.

Parameters
[in]awbinformation source AWB handle
Returns
number of content files (0 to 65535)
Description:
Gets the number of contents (wave data) in an AWB file through an AWB handle.
The valid range for the number of content files is from 1 to 65535.
Zero is returned when there is an error.
See also
criAtomAwb_LoadToc, criAtomAwb_LoadFromMemory

◆ criAtomAwb_Release()

void criAtomAwb_Release ( CriAtomAwbHn  awb)

Release AWB handle.

Parameters
[in]awbAWB handle
Returns
None
Description:
Releases an AWB handle.
Release the finished AWB handle with this function.
Do not use the released AWB handle because it will become an invalid handle.
Attention
When this function is executed, the Atom player referencing the specified AWB data does not exist or the library is searched.
Therefore, if an Atom Player is created/destroyed on another thread while this function is in process, a serious problem such as an access violation or deadlock may be induced.
If you need to create/destroy an Atom Player on another thread while this function is in process, Lock this function with the criAtom_Lock function before executing.

When playing an AWB file using an AtomEx player, do not destroy the AWB handle by this function during playback.
Please make sure to execute this function after stopping the AtomEx player.
See also
criAtomAwb_LoadToc, criAtomAwb_LoadTocAsync, criAtomAwb_GetStatus

◆ criAtomAwb_IsReadyToRelease()

CriBool criAtomAwb_IsReadyToRelease ( CriAtomAwbHn  awb)

Check whether AWB handle can be released immediately.

Parameters
[in]awbAWB handle
Returns
CriBool AWB status (CRI_TRUE = immediate release allowed, CRI_FALSE = active player present)
Description:
Checks whether an AWB handle can be released immediately.
When the criAtomAwb_Release function is executed when this function returns CRI_FALSE, the player accessing the AWB handle is stopped.
(In the case of AWB handle for stream playback, processing may be blocked for a long time within the criAtomAwb_Release function while waiting for file load to complete.)
Attention
When this function is executed, the Atom player referencing the specified AWB data does not exist or the library is searched.
Therefore, if an Atom Player is created/destroyed on another thread while this function is in process, a serious problem such as an access violation or deadlock may be induced.
If you need to create/destroy an Atom Player on another thread while this function is in process, Lock this function with the criAtom_Lock function before executing.
See also
criAtomAwb_Release

◆ criAtomAwb_GetStatus()

CriAtomAwbStatus criAtomAwb_GetStatus ( CriAtomAwbHn  awb)

Get AWB handle status.

Parameters
[in]awbAWB handle
Returns
CriAtomAwbStatus value indicating the AWB handle status
Description:
Obtains the AWB handle status.
The status of the AWB handle obtained with this function is updated by executing the criAtom_ExecuteMain function.
See also
criAtomAwb_LoadToc, criAtomAwb_LoadTocAsync

◆ criAtomAwb_GetIdByIndex()

CriSint32 criAtomAwb_GetIdByIndex ( CriAtomAwbHn  awb,
CriUint16  index 
)

Get waveform data ID.

Parameters
[in]awbAWB Handle
[in]indexWaveform Index
Return values
Waveformdata ID (0 or more) Processing completed successfully
CRIATOMAWB_ILLEGAL_ID(-1) An error has occured
Description:
Gets the waveform data ID specified by index from the AWB handle.
See also
criAtomAwb_LoadToc, criAtomAwb_LoadTocAsync

◆ criAtomDsp_ConvertParameterFromCent()

CriFloat32 criAtomDsp_ConvertParameterFromCent ( CriFloat32  cent)

Convert from cent to DSP parameter.

Parameters
[in]centCent value
Returns
CriFloat32 DSP parameter value
Description:
Normalizes a range of -1200 to 1200 to a range of 0.0f to 1.0f.