orx  stable
Portable Game Engine
OrxSound

Data Structures

struct  orxSOUND_EVENT_PAYLOAD
 
struct  orxSOUND_STREAM_INFO
 
struct  orxSOUND_STREAM_PACKET
 

Macros

#define orxSOUND_KZ_MASTER_BUS   "master"
 
#define orxSOUND_KZ_RESOURCE_GROUP   "Sound"
 

Typedefs

typedef struct __orxSOUND_t orxSOUND
 

Enumerations

enum  orxSOUND_EVENT {
  orxSOUND_EVENT_START = 0, orxSOUND_EVENT_STOP, orxSOUND_EVENT_ADD, orxSOUND_EVENT_REMOVE,
  orxSOUND_EVENT_PACKET, orxSOUND_EVENT_RECORDING_START, orxSOUND_EVENT_RECORDING_STOP, orxSOUND_EVENT_RECORDING_PACKET,
  orxSOUND_EVENT_NUMBER, orxSOUND_EVENT_NONE = orxENUM_NONE
}
 
enum  orxSOUND_STATUS {
  orxSOUND_STATUS_PLAY = 0, orxSOUND_STATUS_PAUSE, orxSOUND_STATUS_STOP, orxSOUND_STATUS_NUMBER,
  orxSOUND_STATUS_NONE = orxENUM_NONE
}
 

Functions

orxDLLAPI orxSTATUS orxFASTCALL orxSound_ClearCache ()
 
orxDLLAPI orxSOUND *orxFASTCALL orxSound_Create ()
 
orxDLLAPI orxSOUND *orxFASTCALL orxSound_CreateFromConfig (const orxSTRING _zConfigID)
 
orxDLLAPI orxSOUNDSYSTEM_SAMPLE *orxFASTCALL orxSound_CreateSample (orxU32 _u32ChannelNumber, orxU32 _u32FrameNumber, orxU32 _u32SampleRate, const orxSTRING _zName)
 
orxDLLAPI orxSOUND *orxFASTCALL orxSound_CreateWithEmptyStream (orxU32 _u32ChannelNumber, orxU32 _u32SampleRate, const orxSTRING _zName)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSound_Delete (orxSOUND *_pstSound)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSound_DeleteSample (const orxSTRING _zName)
 
orxDLLAPI void orxFASTCALL orxSound_Exit ()
 
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetAttenuation (const orxSOUND *_pstSound)
 
orxDLLAPI orxU32 orxFASTCALL orxSound_GetBusChild (orxU32 _u32BusID)
 
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusGlobalPitch (orxU32 _u32BusID)
 
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusGlobalVolume (orxU32 _u32BusID)
 
orxDLLAPI orxU32 orxFASTCALL orxSound_GetBusID (const orxSOUND *_pstSound)
 
orxDLLAPI orxU32 orxFASTCALL orxSound_GetBusParent (orxU32 _u32BusID)
 
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusPitch (orxU32 _u32BusID)
 
orxDLLAPI orxU32 orxFASTCALL orxSound_GetBusSibling (orxU32 _u32BusID)
 
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusVolume (orxU32 _u32BusID)
 
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetDuration (const orxSOUND *_pstSound)
 
orxDLLAPI orxU32 orxFASTCALL orxSound_GetMasterBusID ()
 
orxDLLAPI const orxSTRING orxFASTCALL orxSound_GetName (const orxSOUND *_pstSound)
 
orxDLLAPI orxSOUND *orxFASTCALL orxSound_GetNext (const orxSOUND *_pstSound, orxU32 _u32BusID)
 
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetPitch (const orxSOUND *_pstSound)
 
orxDLLAPI orxVECTOR *orxFASTCALL orxSound_GetPosition (const orxSOUND *_pstSound, orxVECTOR *_pvPosition)
 
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetReferenceDistance (const orxSOUND *_pstSound)
 
orxDLLAPI orxSOUNDSYSTEM_SAMPLE *orxFASTCALL orxSound_GetSample (const orxSTRING _zName)
 
orxDLLAPI orxSOUND_STATUS orxFASTCALL orxSound_GetStatus (const orxSOUND *_pstSound)
 
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetVolume (const orxSOUND *_pstSound)
 
orxDLLAPI orxBOOL orxFASTCALL orxSound_HasRecordingSupport ()
 
orxDLLAPI orxSTATUS orxFASTCALL orxSound_Init ()
 
orxDLLAPI orxBOOL orxFASTCALL orxSound_IsLooping (const orxSOUND *_pstSound)
 
orxDLLAPI orxBOOL orxFASTCALL orxSound_IsStream (orxSOUND *_pstSound)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSound_LinkSample (orxSOUND *_pstSound, const orxSTRING _zSampleName)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSound_Loop (orxSOUND *_pstSound, orxBOOL _bLoop)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSound_Pause (orxSOUND *_pstSound)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSound_Play (orxSOUND *_pstSound)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetAttenuation (orxSOUND *_pstSound, orxFLOAT _fAttenuation)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusID (orxSOUND *_pstSound, orxU32 _u32BusID)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusParent (orxU32 _u32BusID, orxU32 _u32ParentBusID)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusPitch (orxU32 _u32BusID, orxFLOAT _fPitch)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusVolume (orxU32 _u32BusID, orxFLOAT _fVolume)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetPitch (orxSOUND *_pstSound, orxFLOAT _fPitch)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetPosition (orxSOUND *_pstSound, const orxVECTOR *_pvPosition)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetReferenceDistance (orxSOUND *_pstSound, orxFLOAT _fDistance)
 
orxDLLAPI void orxFASTCALL orxSound_Setup ()
 
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetVolume (orxSOUND *_pstSound, orxFLOAT _fVolume)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSound_StartRecording (const orxCHAR *_zName, orxBOOL _bWriteToFile, orxU32 _u32SampleRate, orxU32 _u32ChannelNumber)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSound_Stop (orxSOUND *_pstSound)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSound_StopRecording ()
 
orxDLLAPI orxSTATUS orxFASTCALL orxSound_UnlinkSample (orxSOUND *_pstSound)
 

Detailed Description

Sound module Module that handles sound

Macro Definition Documentation

#define orxSOUND_KZ_MASTER_BUS   "master"

Definition at line 56 of file orxSound.h.

#define orxSOUND_KZ_RESOURCE_GROUP   "Sound"

Misc defines

Definition at line 54 of file orxSound.h.

Typedef Documentation

typedef struct __orxSOUND_t orxSOUND

Internal Sound structure

Definition at line 76 of file orxSound.h.

Enumeration Type Documentation

Event enum

Enumerator
orxSOUND_EVENT_START 

Event sent when a sound starts

orxSOUND_EVENT_STOP 

Event sent when a sound stops

orxSOUND_EVENT_ADD 

Event sent when a sound is added

orxSOUND_EVENT_REMOVE 

Event sent when a sound is removed

orxSOUND_EVENT_PACKET 

Event sent when a sound packet is streamed. IMPORTANT: this event can be sent from a worker thread, do not call any orx API when handling it

orxSOUND_EVENT_RECORDING_START 

Event sent when recording starts

orxSOUND_EVENT_RECORDING_STOP 

Event sent when recording stops

orxSOUND_EVENT_RECORDING_PACKET 

Event sent when a packet has been recorded

orxSOUND_EVENT_NUMBER 
orxSOUND_EVENT_NONE 

Definition at line 81 of file orxSound.h.

Sound status enum

Enumerator
orxSOUND_STATUS_PLAY 
orxSOUND_STATUS_PAUSE 
orxSOUND_STATUS_STOP 
orxSOUND_STATUS_NUMBER 
orxSOUND_STATUS_NONE 

Definition at line 61 of file orxSound.h.

Function Documentation

orxDLLAPI orxSTATUS orxFASTCALL orxSound_ClearCache ( )

Clears cache (if any sound sample is still in active use, it'll remain in memory until not referenced anymore)

Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSOUND* orxFASTCALL orxSound_Create ( )

Creates an empty sound

Returns
Created orxSOUND / orxNULL
orxDLLAPI orxSOUND* orxFASTCALL orxSound_CreateFromConfig ( const orxSTRING  _zConfigID)

Creates sound from config

Parameters
[in]_zConfigIDConfig ID @ return orxSOUND / orxNULL
orxDLLAPI orxSOUNDSYSTEM_SAMPLE* orxFASTCALL orxSound_CreateSample ( orxU32  _u32ChannelNumber,
orxU32  _u32FrameNumber,
orxU32  _u32SampleRate,
const orxSTRING  _zName 
)

Creates a sample

Parameters
[in]_u32ChannelNumberNumber of channels of the sample
[in]_u32FrameNumberNumber of frame of the sample (number of "samples" = number of frames * number of channels)
[in]_u32SampleRateSampling rate of the sample (ie. number of frames per second)
[in]_zNameName to associate with the sample
Returns
orxSOUNDSYSTEM_SAMPLE / orxNULL
orxDLLAPI orxSOUND* orxFASTCALL orxSound_CreateWithEmptyStream ( orxU32  _u32ChannelNumber,
orxU32  _u32SampleRate,
const orxSTRING  _zName 
)

Creates a sound with an empty stream (ie. you'll need to provide actual sound data for each packet sent to the sound card using the event system)

Parameters
[in]_u32ChannelNumberNumber of channels of the stream
[in]_u32SampleRateSampling rate of the stream (ie. number of frames per second)
[in]_zNameName to associate with this sound
Returns
orxSOUND / orxNULL
orxDLLAPI orxSTATUS orxFASTCALL orxSound_Delete ( orxSOUND _pstSound)

Deletes sound

Parameters
[in]_pstSoundConcerned Sound
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxSound_DeleteSample ( const orxSTRING  _zName)

Deletes a sample

Parameters
[in]_zNameSample's name
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI void orxFASTCALL orxSound_Exit ( )

Exits from the sound module

orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetAttenuation ( const orxSOUND _pstSound)

Gets sound attenuation

Parameters
[in]_pstSoundConcerned Sound
Returns
orxFLOAT
orxDLLAPI orxU32 orxFASTCALL orxSound_GetBusChild ( orxU32  _u32BusID)

Gets bus child

Parameters
[in]_u32BusIDConcerned bus ID
Returns
Child bus ID / orxU32_UNDEFINED
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusGlobalPitch ( orxU32  _u32BusID)

Gets bus global pitch, ie. taking into account the whole bus hierarchy

Parameters
[in]_u32BusIDConcerned bus ID
Returns
orxFLOAT
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusGlobalVolume ( orxU32  _u32BusID)

Gets bus global volume, ie. taking into account the whole bus hierarchy

Parameters
[in]_u32BusIDConcerned bus ID
Returns
orxFLOAT
orxDLLAPI orxU32 orxFASTCALL orxSound_GetBusID ( const orxSOUND _pstSound)

Gets sound's bus ID

Parameters
[in]_pstSoundConcerned sound
Returns
Sound's bus ID
orxDLLAPI orxU32 orxFASTCALL orxSound_GetBusParent ( orxU32  _u32BusID)

Gets bus parent

Parameters
[in]_u32BusIDConcerned bus ID
Returns
Parent bus ID / orxU32_UNDEFINED
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusPitch ( orxU32  _u32BusID)

Gets bus pitch (local, ie. unaffected by the whole bus hierarchy)

Parameters
[in]_u32BusIDConcerned bus ID
Returns
orxFLOAT
orxDLLAPI orxU32 orxFASTCALL orxSound_GetBusSibling ( orxU32  _u32BusID)

Gets bus sibling

Parameters
[in]_u32BusIDConcerned bus ID
Returns
Sibling bus ID / orxU32_UNDEFINED
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusVolume ( orxU32  _u32BusID)

Gets bus volume (local, ie. unaffected by the whole bus hierarchy)

Parameters
[in]_u32BusIDConcerned bus ID
Returns
orxFLOAT
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetDuration ( const orxSOUND _pstSound)

Gets sound duration

Parameters
[in]_pstSoundConcerned Sound
Returns
orxFLOAT
orxDLLAPI orxU32 orxFASTCALL orxSound_GetMasterBusID ( )

Gets master bus ID

Returns
Master bus ID
orxDLLAPI const orxSTRING orxFASTCALL orxSound_GetName ( const orxSOUND _pstSound)

Gets sound config name

Parameters
[in]_pstSoundConcerned sound
Returns
orxSTRING / orxSTRING_EMPTY
orxDLLAPI orxSOUND* orxFASTCALL orxSound_GetNext ( const orxSOUND _pstSound,
orxU32  _u32BusID 
)

Gets next sound in bus

Parameters
[in]_pstSoundConcerned sound, orxNULL to get the first one
[in]_u32BusIDBus ID to consider, orxU32_UNDEFINED for all
Returns
orxSOUND / orxNULL
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetPitch ( const orxSOUND _pstSound)

Gets sound pitch

Parameters
[in]_pstSoundConcerned Sound
Returns
orxFLOAT
orxDLLAPI orxVECTOR* orxFASTCALL orxSound_GetPosition ( const orxSOUND _pstSound,
orxVECTOR _pvPosition 
)

Gets sound position

Parameters
[in]_pstSoundConcerned Sound
[out]_pvPositionSound's position
Returns
orxVECTOR / orxNULL
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetReferenceDistance ( const orxSOUND _pstSound)

Gets sound reference distance

Parameters
[in]_pstSoundConcerned Sound
Returns
orxFLOAT
orxDLLAPI orxSOUNDSYSTEM_SAMPLE* orxFASTCALL orxSound_GetSample ( const orxSTRING  _zName)

Gets a sample

Parameters
[in]_zNameSample's name
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSOUND_STATUS orxFASTCALL orxSound_GetStatus ( const orxSOUND _pstSound)

Gets sound status

Parameters
[in]_pstSoundConcerned Sound
Returns
orxSOUND_STATUS
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetVolume ( const orxSOUND _pstSound)

Gets sound volume

Parameters
[in]_pstSoundConcerned Sound
Returns
orxFLOAT
orxDLLAPI orxBOOL orxFASTCALL orxSound_HasRecordingSupport ( )

Is recording possible on the current system?

Returns
orxTRUE / orxFALSE
orxDLLAPI orxSTATUS orxFASTCALL orxSound_Init ( )

Initializes the sound module

Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxBOOL orxFASTCALL orxSound_IsLooping ( const orxSOUND _pstSound)

Is sound looping?

Parameters
[in]_pstSoundConcerned Sound
Returns
orxTRUE / orxFALSE
orxDLLAPI orxBOOL orxFASTCALL orxSound_IsStream ( orxSOUND _pstSound)

Is a stream (ie. music)?

Parameters
[in]_pstSoundConcerned Sound
Returns
orxTRUE / orxFALSE
orxDLLAPI orxSTATUS orxFASTCALL orxSound_LinkSample ( orxSOUND _pstSound,
const orxSTRING  _zSampleName 
)

Links a sample

Parameters
[in]_pstSoundConcerned sound
[in]_zSampleNameName of the sample to link (must already be loaded/created)
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxSound_Loop ( orxSOUND _pstSound,
orxBOOL  _bLoop 
)

Loops sound

Parameters
[in]_pstSoundConcerned Sound
[in]_bLooporxTRUE / orxFALSE
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxSound_Pause ( orxSOUND _pstSound)

Pauses sound

Parameters
[in]_pstSoundConcerned Sound
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxSound_Play ( orxSOUND _pstSound)

Plays sound

Parameters
[in]_pstSoundConcerned Sound
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetAttenuation ( orxSOUND _pstSound,
orxFLOAT  _fAttenuation 
)

Sets sound attenuation

Parameters
[in]_pstSoundConcerned Sound
[in]_fAttenuationDesired attenuation
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusID ( orxSOUND _pstSound,
orxU32  _u32BusID 
)

Sets sound's bus ID

Parameters
[in]_pstSoundConcerned sound
[in]_u32BusIDBus ID to set
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusParent ( orxU32  _u32BusID,
orxU32  _u32ParentBusID 
)

Sets a bus parent

Parameters
[in]_u32BusIDConcerned bus ID, will create it if not already existing
[in]_u32ParentBusIDID of the bus to use as parent, will create it if not already existing
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusPitch ( orxU32  _u32BusID,
orxFLOAT  _fPitch 
)

Sets bus pitch

Parameters
[in]_u32BusIDConcerned bus ID, will create it if not already existing
[in]_fPitchDesired pitch
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusVolume ( orxU32  _u32BusID,
orxFLOAT  _fVolume 
)

Sets bus volume

Parameters
[in]_u32BusIDConcerned bus ID, will create it if not already existing
[in]_fVolumeDesired volume (0.0 - 1.0)
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetPitch ( orxSOUND _pstSound,
orxFLOAT  _fPitch 
)

Sets sound pitch

Parameters
[in]_pstSoundConcerned Sound
[in]_fPitchDesired pitch
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetPosition ( orxSOUND _pstSound,
const orxVECTOR _pvPosition 
)

Sets sound position

Parameters
[in]_pstSoundConcerned Sound
[in]_pvPositionDesired position
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetReferenceDistance ( orxSOUND _pstSound,
orxFLOAT  _fDistance 
)

Sets sound reference distance

Parameters
[in]_pstSoundConcerned Sound
[in]_fDistanceWithin this distance, sound is perceived at its maximum volume
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI void orxFASTCALL orxSound_Setup ( )

Sound module setup

orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetVolume ( orxSOUND _pstSound,
orxFLOAT  _fVolume 
)

Sets sound volume

Parameters
[in]_pstSoundConcerned Sound
[in]_fVolumeDesired volume (0.0 - 1.0)
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxSound_StartRecording ( const orxCHAR *  _zName,
orxBOOL  _bWriteToFile,
orxU32  _u32SampleRate,
orxU32  _u32ChannelNumber 
)

Starts recording

Parameters
[in]_zNameName for the recorded sound/file
[in]_bWriteToFileShould write to file?
[in]_u32SampleRateSample rate, 0 for default rate (44100Hz)
[in]_u32ChannelNumberChannel number, 0 for default mono channel
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxSound_Stop ( orxSOUND _pstSound)

Stops sound

Parameters
[in]_pstSoundConcerned Sound
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxSound_StopRecording ( )

Stops recording

Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxSound_UnlinkSample ( orxSOUND _pstSound)

Unlinks (and deletes if not used anymore) a sample

Parameters
[in]_pstSoundConcerned sound
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

Generated for orx by doxygen 1.5.6