CRM64Pro GDK v0.13.0
A free cross-platform game development kit built on top of SDL 3.0
Loading...
Searching...
No Matches
AudioTrack

Description

Audio Track Manager and AudioTrack objects for sound effects and music playback [v25.12.0].

Overview

The Audio Track module provides a unified audio system for loading and playing both short sound effects and long music tracks. Once the audio system is initialized using ConfigMgr::audioInit() or ConfigMgr::load(), you can load audio from external files, memory buffers, or CDC archives.
There are no longer fixed "channels". Tracks are allocated dynamically as needed, allowing for virtually unlimited polyphony (limited only by CPU/RAM).

Key features

  • Unified audio object: Handles both short SFX and long music streams transparently
  • Tag categorization: Tracks are assigned a category tag (Music, SFX, Voice, Custom) allowing group operations like "Stop all SFX" or "Fade out Music"
  • Hierarchical volume: Final Output Volume = Master Gain * Category Gain
  • Editor support: Optional raw data persistence for saving/exporting audio assets

AudioTrack actions

PlaybackPlay (supports multiple overlapping instances), stop, pause and resume
TransitionsFade out and fade in on a given time
Playback controlPitch/speed, looping, seeking (for streams)
EffectsVolume, panning, 3D distance and angular position

Loading strategies

Choose the appropriate loading strategy based on your audio content type and performance requirements:

Preload (RAM)Best for SFX. Decodes entire file to memory for zero-latency playback
Stream (Disk)Best for Music. Decodes chunks on-demand to save memory

Supported audio formats

Raw streamsAIFF, WAV and VOC
CompressedFLAC, OGG and MP3
Modules (52)669, abk, amf, arch, asylum, chip, coco, dbm, digi, dt, emod, far, flt, fnk, gal4, gal5, gdm, hmn, ice, imf, ims, it, liq, masi, masi16, mdl, med2, med3, med4, mfp, mgt, mmd1, mmd3, mod, mtm, muse, no, okt, pt3, ptm, rtm, s3m, sfx, st, stim, stm, stx, sym, ult, umx, xm, xmf

Manager type

This is a sharing manager: it has the ability of sharing an audio ID to a group of owners when they request to open an already opened object based on the name as the key.

Default behaviorReturns a shared ID. Control methods (stop/volume) affect all instances sharing this ID
Unique instanceRequest via load(..., iUnique=1). Creates a standalone object with independent control while efficiently sharing the underlying raw audio data in memory

Best practices

  • Always initialize the audio system via ConfigMgr::audioInit() or ConfigMgr::load() before using the Audio Track Manager
  • Leverage category tags (Music, SFX, Voice, Custom) for efficient group control operations
  • Consider the hierarchical volume model when setting levels: category and master gains are multipled
  • Request unique instances when you need independent playback control over the same audio asset
  • Access the manager exclusively through Main::IAudioTrackMgr()
Note
The Audio Track Manager is a singleton, automatically created once Main is instantiated. You can get a reference to this manager using Main::IAudioTrackMgr() method.
The Audio Track Manager is automatically released when Main::Terminate() is called. At this time, any resource still loaded will be released, avoiding resource leaks.

Classes

struct  CRM64Pro::AudioInfo
 Audio metadata information. More...
class  CRM64Pro::AudioTrack
 Audio Track object class. More...
class  CRM64Pro::AudioTrackMgr
 Audio Track Manager class. More...

Enumerations

enum  CRM64Pro::eAudioTrackTag { CRM64Pro::ATT_MUSIC = 0x01 , CRM64Pro::ATT_SFX = 0x02 , CRM64Pro::ATT_VOICE = 0x04 , CRM64Pro::ATT_CUSTOM = 0x08 }
 Audio track category tags for grouping and batch operations. More...
enum  CRM64Pro::eAudioType {
  CRM64Pro::AT_NONE = 0 , CRM64Pro::AT_WAV = 1 , CRM64Pro::AT_MOD = 2 , CRM64Pro::AT_OGG = 3 ,
  CRM64Pro::AT_MP3 = 4 , CRM64Pro::AT_FLAC = 5 , CRM64Pro::AT_UNKNOWN = 6
}
 Audio codec/format type. More...
enum  CRM64Pro::eAudioLoadMode { CRM64Pro::ALM_AUTO = 0 , CRM64Pro::ALM_PRELOAD = 1 , CRM64Pro::ALM_STREAM = 2 }
 Audio loading strategy. More...

Functions

Sint32 CRM64Pro::AudioTrack::info (Sint32 iMode=0)
 Request AudioTrack information.
Sint32 CRM64Pro::AudioTrack::getName (string &sName)
 Get the name.
Uint32 CRM64Pro::AudioTrack::getID ()
 Get the ID.
Sint32 CRM64Pro::AudioTrack::getInfo (string *sType, AudioInfo *pAI) const
 Get AudioTrack detailed information.
Sint32 CRM64Pro::AudioTrack::play (Sint32 iLoop=0)
 Play the track.
Sint32 CRM64Pro::AudioTrack::fadeIn (Sint32 iTimeMS=1000, Sint32 iLoop=0)
 Play the track with a fade-in effect.
Sint32 CRM64Pro::AudioTrack::fadeOut (Sint32 iTimeMS=1000)
 Fade out all instances of this track to silence, then stop.
Sint32 CRM64Pro::AudioTrack::stop ()
 Immediately stop all instances of this track.
Sint32 CRM64Pro::AudioTrack::pause ()
 Pause all instances of this track.
Sint32 CRM64Pro::AudioTrack::resume ()
 Resume all instances of this track.
Sint32 CRM64Pro::AudioTrack::getPosition ()
 Get the current playback position.
Sint32 CRM64Pro::AudioTrack::setPosition (Sint32 iTimeMS)
 Set the playback position (Seek).
Sint32 CRM64Pro::AudioTrack::setPitch (float fPitch)
 Set Pitch (Frequency Ratio).
float CRM64Pro::AudioTrack::getPitch () const
 Get current pitch property.
Sint32 CRM64Pro::AudioTrack::setPanning (Uint8 iLeft, Uint8 iRight)
 Set Stereo Panning.
Sint32 CRM64Pro::AudioTrack::setLoopPoints (double dStartSec, double dEndSec)
 Set Loop Points.
Sint32 CRM64Pro::AudioTrack::setDistance (Uint8 iDistance)
 Set 3D Distance Attenuation.
Sint32 CRM64Pro::AudioTrack::setPosition3D (Sint16 iAngle, Uint8 iDistance)
 Set 3D Angular Position.
Sint32 CRM64Pro::AudioTrack::setTag (eAudioTrackTag eTag)
 Set Track Tag category.
eAudioTrackTag CRM64Pro::AudioTrack::getTag () const
 Get Track Tag category.
Sint32 CRM64Pro::AudioTrack::saveToFile (const string &sFile)
 Export the AudioTrack to an external file.
Sint32 CRM64Pro::AudioTrack::save (const string &sFileCDC)
 Save the AudioTrack into a CDC file.
Sint32 CRM64Pro::AudioTrack::save (Sint32 idCDC)
 Save the AudioTrack into a CDC file.
Sint32 CRM64Pro::AudioTrackMgr::info (Sint32 iMode=0)
 Request AudioTrack Manager information.
Sint32 CRM64Pro::AudioTrackMgr::close (Sint32 idAudio=0)
 Close and destroy an AudioTrack.
Sint32 CRM64Pro::AudioTrackMgr::getNum () const
 Get number of loaded objects.
Sint32 CRM64Pro::AudioTrackMgr::setName (Sint32 idAudio, const string &sName)
 Change the object name.
AudioTrackCRM64Pro::AudioTrackMgr::get (Sint32 idAudio=0)
 Get a pointer to the AudioTrack using its handler.
Sint32 CRM64Pro::AudioTrackMgr::stopAll ()
 Immediately stop all active audio tracks.
Sint32 CRM64Pro::AudioTrackMgr::fadeOutAll (Sint32 iTimeMS=1000)
 Fade out all active audio tracks to silence, then stop.
Sint32 CRM64Pro::AudioTrackMgr::pauseAll ()
 Pause all active audio tracks.
Sint32 CRM64Pro::AudioTrackMgr::resumeAll ()
 Resume all paused audio tracks.
Sint32 CRM64Pro::AudioTrackMgr::stopTag (eAudioTrackTag eTag)
 Stop all tracks of a specific audio track tag category.
Sint32 CRM64Pro::AudioTrackMgr::fadeOutTag (eAudioTrackTag eTag, Sint32 iTimeMS=1000)
 Fade out all tracks of a specific audio track tag category.
Sint32 CRM64Pro::AudioTrackMgr::pauseTag (eAudioTrackTag eTag)
 Pause all tracks of a specific audio track tag category.
Sint32 CRM64Pro::AudioTrackMgr::resumeTag (eAudioTrackTag eTag)
 Resume all tracks of a specific audio track tag category.
void CRM64Pro::AudioTrackMgr::setKeepSourceData (Sint32 iKeep)
 Set the global policy for keeping raw source data in memory.
Sint32 CRM64Pro::AudioTrackMgr::getKeepSourceData () const
 Get the current policy for keeping raw source data.
Sint32 CRM64Pro::AudioTrackMgr::loadFromFile (const string &sFile, const string &sName="", eAudioTrackTag eTag=ATT_SFX, eAudioLoadMode eMode=ALM_AUTO, Sint32 iUnique=0)
 Load an AudioTrack from an external file.
Sint32 CRM64Pro::AudioTrackMgr::load (const string &sFileCDC, const string &sName, Sint32 iUnique=0)
 Load an AudioTrack from a CDC file (by file name).
Sint32 CRM64Pro::AudioTrackMgr::load (Sint32 idCDC, const string &sName, Sint32 iUnique=0)
 Load an AudioTrack from a CDC file (by ID).
Sint32 CRM64Pro::AudioTrackMgr::load (void *pBuffer, Sint32 iSize, const string &sName, const string &sFormat, eAudioTrackTag eTag=ATT_SFX)
 Load an AudioTrack from a raw memory buffer.
Sint32 CRM64Pro::AudioTrackMgr::remove (Sint32 idCDC, const string &sName)
 Remove an AudioTrack stored in a CDC file.
Sint32 CRM64Pro::AudioTrackMgr::exist (Sint32 idCDC, const string &sName)
 Check if an AudioTrack is stored in a CDC file.

Enumeration Type Documentation

◆ eAudioTrackTag

Audio track category tags for grouping and batch operations.

Enumerator
ATT_MUSIC 

Background music track.

ATT_SFX 

Sound effect track.

ATT_VOICE 

Voice/dialogue track.

ATT_CUSTOM 

Custom user-defined track type.

◆ eAudioType

Audio codec/format type.

Enumerator
AT_NONE 

No type or uninitialized.

AT_WAV 

WAV, RIFF, AIFF, or VOC audio type.

AT_MOD 

Module audio type (MOD, XM, IT, etc.).

AT_OGG 

OGG Vorbis audio type.

AT_MP3 

MP3 audio type.

AT_FLAC 

FLAC audio type.

AT_UNKNOWN 

Unknown or unsupported type.

◆ eAudioLoadMode

Audio loading strategy.

Enumerator
ALM_AUTO 

Automatically select based on file size/type.

ALM_PRELOAD 

Preload entire audio into memory (best for SFX).

ALM_STREAM 

Stream audio from file on-demand (best for music).

Function Documentation

◆ info() [1/2]

Sint32 CRM64Pro::AudioTrack::info ( Sint32 iMode = 0)

Request AudioTrack information.

Writes information to the default log.

Parameters
iModeunused for the time being.
Returns
0 on success, or a negative error code on failure.

◆ getName()

Sint32 CRM64Pro::AudioTrack::getName ( string & sName)

Get the name.

Parameters
sNamea string containing the Audio Track object name.
Returns
0 on success, or a negative error code on failure.

◆ getID()

Uint32 CRM64Pro::AudioTrack::getID ( )

Get the ID.

Returns
Object ID.

◆ getInfo()

Sint32 CRM64Pro::AudioTrack::getInfo ( string * sType,
AudioInfo * pAI ) const

Get AudioTrack detailed information.

Parameters
sTypea string pointer filled with the input file music extension. If nullptr, this value is not retrieved.
pAIa pointer to an AudioInfo struct. If nullptr, this struct is not retrieved.
Returns
0 on success, or a negative error code on failure.

◆ play()

Sint32 CRM64Pro::AudioTrack::play ( Sint32 iLoop = 0)

Play the track.

Parameters
iLoop0 = play once, -1 = infinite, >0 = specific number of loops.
Returns
0 on success, or a negative error code on failure.

◆ fadeIn()

Sint32 CRM64Pro::AudioTrack::fadeIn ( Sint32 iTimeMS = 1000,
Sint32 iLoop = 0 )

Play the track with a fade-in effect.

Creates a new hardware track, assigns the audio data, applies current properties (Gain, Pitch, Pan), and starts playback.

Parameters
iTimeMSTime in milliseconds for the fade-in effect. 0 for instant playback.
iLoopNumber of loops. 0 = play once, -1 = infinite, >0 = specific number of additional loops.
Returns
0 on success, or a negative error code on failure.

◆ fadeOut()

Sint32 CRM64Pro::AudioTrack::fadeOut ( Sint32 iTimeMS = 1000)

Fade out all instances of this track to silence, then stop.

Parameters
iTimeMSTime in milliseconds for the fade-out effect.
Returns
0 on success, or a negative error code on failure.

◆ stop()

Sint32 CRM64Pro::AudioTrack::stop ( )

Immediately stop all instances of this track.

Returns
0 on success, or a negative error code on failure.

◆ pause()

Sint32 CRM64Pro::AudioTrack::pause ( )

Pause all instances of this track.

Returns
0 on success, or a negative error code on failure.

◆ resume()

Sint32 CRM64Pro::AudioTrack::resume ( )

Resume all instances of this track.

Returns
0 on success, or a negative error code on failure.

◆ getPosition()

Sint32 CRM64Pro::AudioTrack::getPosition ( )

Get the current playback position.

Retrieves the current time position of the active track instance.

Returns
The position in milliseconds, or -1 if the track is not playing or invalid.

◆ setPosition()

Sint32 CRM64Pro::AudioTrack::setPosition ( Sint32 iTimeMS)

Set the playback position (Seek).

Jumps to a specific time in the audio track. If the track is currently playing, it seeks immediately.

Parameters
iTimeMSThe position in milliseconds to seek to.
Returns
0 on success or a negative error code on failure.

◆ setPitch()

Sint32 CRM64Pro::AudioTrack::setPitch ( float fPitch)

Set Pitch (Frequency Ratio).

Sets the pitch for future playbacks. If the track is currently playing, it updates the sound immediately.

Parameters
fPitch1.0f = Normal, 0.5f = Half speed, 2.0f = Double speed.
Returns
0 on success, or a negative error code on failure.

◆ getPitch()

float CRM64Pro::AudioTrack::getPitch ( ) const

Get current pitch property.

Returns
The current pitch value.

◆ setPanning()

Sint32 CRM64Pro::AudioTrack::setPanning ( Uint8 iLeft,
Uint8 iRight )

Set Stereo Panning.

Sets panning for future playbacks. If the track is currently playing, it updates the sound immediately.

Parameters
iLeft0-255.
iRight0-255.
Returns
0 on success, or a negative error code on failure.

◆ setLoopPoints()

Sint32 CRM64Pro::AudioTrack::setLoopPoints ( double dStartSec,
double dEndSec )

Set Loop Points.

Sets loop region for future playbacks.

Parameters
dStartSecStart of loop in seconds.
dEndSecEnd of loop in seconds (or -1 for end of file).
Returns
0 on success, or a negative error code on failure.

◆ setDistance()

Sint32 CRM64Pro::AudioTrack::setDistance ( Uint8 iDistance)

Set 3D Distance Attenuation.

Sets the distance simulation for future playbacks. If the track is currently playing, it updates the sound immediately. SDL_mixer's distance effect attenuates volume as distance increases.

Parameters
iDistance0 (closest/loudest) to 255 (farthest/quietest).
Returns
0 on success, or a negative error code on failure.

◆ setPosition3D()

Sint32 CRM64Pro::AudioTrack::setPosition3D ( Sint16 iAngle,
Uint8 iDistance )

Set 3D Angular Position.

Sets the 3D position for future playbacks. If the track is currently playing, it updates the sound immediately. Simulates sound source direction relative to listener (at center).

Parameters
iAngleAngle in degrees (0 = front, 90 = right, 180 = back, 270 = left).
iDistanceDistance attenuation (0-255).
Returns
0 on success, or a negative error code on failure.

◆ setTag()

Sint32 CRM64Pro::AudioTrack::setTag ( eAudioTrackTag eTag)

Set Track Tag category.

Updates the tag category (Music, SFX, Voice) and immediately re-calculates gain for active instance. This allows changing a track from "SFX" to "Music" and having it instantly adopt the Music volume level.

Parameters
eTagThe new track type.
Returns
0 on success, or a negative error code on failure.

◆ getTag()

eAudioTrackTag CRM64Pro::AudioTrack::getTag ( ) const

Get Track Tag category.

Returns
The current eAudioTrackTag.

◆ saveToFile()

Sint32 CRM64Pro::AudioTrack::saveToFile ( const string & sFile)

Export the AudioTrack to an external file.

Parameters
sFilestring containing the [directory]+filename. Extension is automatically corrected.
Returns
0 or greater on success or a negative error code on failure.
Note
Only works if 'Keep Source Data' was enabled during load.

◆ save() [1/2]

Sint32 CRM64Pro::AudioTrack::save ( const string & sFileCDC)

Save the AudioTrack into a CDC file.

Parameters
sFileCDCPath to the CDC archive.
Returns
greater than 0 on success, or a negative error code on failure.

◆ save() [2/2]

Sint32 CRM64Pro::AudioTrack::save ( Sint32 idCDC)

Save the AudioTrack into a CDC file.

Parameters
idCDCCDC id.
Returns
greater than 0 on success, or a negative error code on failure.
Note
Only works if 'Keep Source Data' was enabled during load.

◆ info() [2/2]

Sint32 CRM64Pro::AudioTrackMgr::info ( Sint32 iMode = 0)

Request AudioTrack Manager information.

Writes information to the default log.

Parameters
iMode-1 for displaying only Manager information. 0 (default) for displaying Manager and all Objects information.
Returns
0 on success, or a negative error code on failure.

◆ close()

Sint32 CRM64Pro::AudioTrackMgr::close ( Sint32 idAudio = 0)

Close and destroy an AudioTrack.

Parameters
idAudio0 (default) for closing all tracks, or a specific AudioTrack id. If playing, it will be stopped immediately.
Returns
0 on success, or a negative error code on failure.

◆ getNum()

Sint32 CRM64Pro::AudioTrackMgr::getNum ( ) const

Get number of loaded objects.

Returns
the number of AudioTrack objects.

◆ setName()

Sint32 CRM64Pro::AudioTrackMgr::setName ( Sint32 idAudio,
const string & sName )

Change the object name.

Parameters
idAudioAudioTrack id.
sNameThe new name. Must be unique.
Returns
0 on success, or a negative error code on failure.

◆ get()

AudioTrack * CRM64Pro::AudioTrackMgr::get ( Sint32 idAudio = 0)

Get a pointer to the AudioTrack using its handler.

Parameters
idAudioAudioTrack id.
Returns
nullptr if not found.
A pointer to the AudioTrack object.

◆ stopAll()

Sint32 CRM64Pro::AudioTrackMgr::stopAll ( )

Immediately stop all active audio tracks.

Stops all playback on the mixer device.

Returns
0 on success, or a negative error code on failure.

◆ fadeOutAll()

Sint32 CRM64Pro::AudioTrackMgr::fadeOutAll ( Sint32 iTimeMS = 1000)

Fade out all active audio tracks to silence, then stop.

Parameters
iTimeMSTime in milliseconds for the fade-out effect. Default 1000ms.
Returns
0 on success, or a negative error code on failure.

◆ pauseAll()

Sint32 CRM64Pro::AudioTrackMgr::pauseAll ( )

Pause all active audio tracks.

Returns
0 on success, or a negative error code on failure.

◆ resumeAll()

Sint32 CRM64Pro::AudioTrackMgr::resumeAll ( )

Resume all paused audio tracks.

Returns
0 on success, or a negative error code on failure.

◆ stopTag()

Sint32 CRM64Pro::AudioTrackMgr::stopTag ( eAudioTrackTag eTag)

Stop all tracks of a specific audio track tag category.

Iterates through all managed AudioTrack objects of the given tag category and stops them.

Parameters
eTagThe tag category to stop (Music, SFX, etc).
Returns
0 on success, or a negative error code on failure.

◆ fadeOutTag()

Sint32 CRM64Pro::AudioTrackMgr::fadeOutTag ( eAudioTrackTag eTag,
Sint32 iTimeMS = 1000 )

Fade out all tracks of a specific audio track tag category.

Iterates through all managed AudioTrack objects of the given tag category and fades them out.

Parameters
eTagThe tag category to fade out (Music, SFX, etc).
iTimeMSTime in milliseconds for the fade-out effect. Default 1000ms.
Returns
0 on success, or a negative error code on failure.

◆ pauseTag()

Sint32 CRM64Pro::AudioTrackMgr::pauseTag ( eAudioTrackTag eTag)

Pause all tracks of a specific audio track tag category.

Iterates through all managed AudioTrack objects of the given tag category and pauses them.

Parameters
eTagThe tag category to pause.
Returns
0 on success, or a negative error code on failure.

◆ resumeTag()

Sint32 CRM64Pro::AudioTrackMgr::resumeTag ( eAudioTrackTag eTag)

Resume all tracks of a specific audio track tag category.

Iterates through all managed AudioTrack objects of the given tag category and resumes them.

Parameters
eTagThe tag category to resume.
Returns
0 on success, or a negative error code on failure.

◆ setKeepSourceData()

void CRM64Pro::AudioTrackMgr::setKeepSourceData ( Sint32 iKeep)

Set the global policy for keeping raw source data in memory.

If enabled, subsequent load operations will cache the original raw bytes in RAM. This allows the use of AudioTrack::save() and AudioTrack::saveToFile().

Warning
Enabling this increases memory usage significantly (Raw Data + Decoded Audio). It is recommended to enable this only for Editors/Tools, and keep it disabled (default) for Games.
Parameters
iKeep1 to cache raw data, 0 to discard it. Values <= 0 force disabled, values >= 1 force enabled.

◆ getKeepSourceData()

Sint32 CRM64Pro::AudioTrackMgr::getKeepSourceData ( ) const

Get the current policy for keeping raw source data.

Returns
1 if raw data is being cached, 0 otherwise.

◆ loadFromFile()

Sint32 CRM64Pro::AudioTrackMgr::loadFromFile ( const string & sFile,
const string & sName = "",
eAudioTrackTag eTag = ATT_SFX,
eAudioLoadMode eMode = ALM_AUTO,
Sint32 iUnique = 0 )

Load an AudioTrack from an external file.

Parameters
sFilestring containing [directory]+filename+[extension]. Directory separators '\' and '/' are supported.
sNameObject name. If empty, filename is used (without extension). Max 64 characters.
eTagThe tag category (SFX, Music, etc).
eModeLoading strategy (Preload to RAM or Stream from disk).
iUnique1 forces a new object creation even if an object with this name exists.
Note
If iUnique is 0 and an object with the same name already exists, the existing object's ID is returned.
Returns
AudioTrack ID on success, negative on error.

◆ load() [1/3]

Sint32 CRM64Pro::AudioTrackMgr::load ( const string & sFileCDC,
const string & sName,
Sint32 iUnique = 0 )

Load an AudioTrack from a CDC file (by file name).

Parameters
sFileCDCPath to the CDC archive file.
sNameObject name.
iUnique1 forces a new object creation even if an object with this name exists.
Returns
AudioTrack ID on success, negative on error.
Note
Always forces ALM_PRELOAD (RAM) logic as streaming from a CDC archive is not supported.

◆ load() [2/3]

Sint32 CRM64Pro::AudioTrackMgr::load ( Sint32 idCDC,
const string & sName,
Sint32 iUnique = 0 )

Load an AudioTrack from a CDC file (by ID).

Parameters
idCDCCDC archive ID.
sNameObject name stored in the archive.
iUnique1 forces a new object creation.
Returns
AudioTrack ID on success, negative on error.
Note
Always forces ALM_PRELOAD (RAM) logic as streaming from a CDC archive is not supported.

◆ load() [3/3]

Sint32 CRM64Pro::AudioTrackMgr::load ( void * pBuffer,
Sint32 iSize,
const string & sName,
const string & sFormat,
eAudioTrackTag eTag = ATT_SFX )

Load an AudioTrack from a raw memory buffer.

Parameters
pBufferPointer to the raw audio data (WAV, OGG, etc).
iSizeSize of the buffer in bytes.
sNameObject name. It will be used as source file name together with format.
sFormatAudio format of the buffer (AIFF, WAV, VOC, OGG, FLAC, MP3, MOD, XM, S3M, etc).
eTagThe category tag (SFX, Music, etc).
Returns
AudioTrack ID on success, negative on error.
Note
The buffer is copied internally. The user is responsible for the original buffer.

◆ remove()

Sint32 CRM64Pro::AudioTrackMgr::remove ( Sint32 idCDC,
const string & sName )

Remove an AudioTrack stored in a CDC file.

Parameters
idCDCCDC id.
sNamestring with the AudioTrack name (maximum size of 64 characters).
Returns
greater than 0 on success, or a negative error code on failure.

◆ exist()

Sint32 CRM64Pro::AudioTrackMgr::exist ( Sint32 idCDC,
const string & sName )

Check if an AudioTrack is stored in a CDC file.

Parameters
idCDCCDC id.
sNamestring with the AudioTrack name (maximum size of 64 characters).
Returns
0 on success(it exists) or a negative error code on failure (it does not exist).
Note
It is normally used for checking if an audio track is present without throwing any error.