orx  stable
Portable Game Engine
OrxSoundSystem

Macros

#define orxSOUNDSYSTEM_KZ_CONFIG_RATIO   "DimensionRatio"
 
#define orxSOUNDSYSTEM_KZ_CONFIG_SECTION   "SoundSystem"
 
#define orxSOUNDSYSTEM_KZ_CONFIG_STREAM_BUFFER_NUMBER   "StreamBufferNumber"
 
#define orxSOUNDSYSTEM_KZ_CONFIG_STREAM_BUFFER_SIZE   "StreamBufferSize"
 

Typedefs

typedef struct __orxSOUNDSYSTEM_SAMPLE_t orxSOUNDSYSTEM_SAMPLE
 
typedef struct __orxSOUNDSYSTEM_SOUND_t orxSOUNDSYSTEM_SOUND
 

Enumerations

enum  orxSOUNDSYSTEM_STATUS {
  orxSOUNDSYSTEM_STATUS_PLAY = 0, orxSOUNDSYSTEM_STATUS_PAUSE, orxSOUNDSYSTEM_STATUS_STOP, orxSOUNDSYSTEM_STATUS_NUMBER,
  orxSOUNDSYSTEM_STATUS_NONE = orxENUM_NONE
}
 

Functions

orxDLLAPI orxSOUNDSYSTEM_SOUND *orxFASTCALL orxSoundSystem_CreateFromSample (const orxSOUNDSYSTEM_SAMPLE *_pstSample)
 
orxDLLAPI orxSOUNDSYSTEM_SAMPLE *orxFASTCALL orxSoundSystem_CreateSample (orxU32 _u32ChannelNumber, orxU32 _u32FrameNumber, orxU32 _u32SampleRate)
 
orxDLLAPI orxSOUNDSYSTEM_SOUND *orxFASTCALL orxSoundSystem_CreateStream (orxU32 _u32ChannelNumber, orxU32 _u32SampleRate, const orxSTRING _zReference)
 
orxDLLAPI orxSOUNDSYSTEM_SOUND *orxFASTCALL orxSoundSystem_CreateStreamFromFile (const orxSTRING _zFilename, const orxSTRING _zReference)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_Delete (orxSOUNDSYSTEM_SOUND *_pstSound)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_DeleteSample (orxSOUNDSYSTEM_SAMPLE *_pstSample)
 
orxDLLAPI void orxFASTCALL orxSoundSystem_Exit ()
 
orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetAttenuation (const orxSOUNDSYSTEM_SOUND *_pstSound)
 
orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetDuration (const orxSOUNDSYSTEM_SOUND *_pstSound)
 
orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetGlobalVolume ()
 
orxDLLAPI orxVECTOR *orxFASTCALL orxSoundSystem_GetListenerPosition (orxVECTOR *_pvPosition)
 
orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetPitch (const orxSOUNDSYSTEM_SOUND *_pstSound)
 
orxDLLAPI orxVECTOR *orxFASTCALL orxSoundSystem_GetPosition (const orxSOUNDSYSTEM_SOUND *_pstSound, orxVECTOR *_pvPosition)
 
orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetReferenceDistance (const orxSOUNDSYSTEM_SOUND *_pstSound)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_GetSampleInfo (const orxSOUNDSYSTEM_SAMPLE *_pstSample, orxU32 *_pu32ChannelNumber, orxU32 *_pu32FrameNumber, orxU32 *_pu32SampleRate)
 
orxDLLAPI orxSOUNDSYSTEM_STATUS orxFASTCALL orxSoundSystem_GetStatus (const orxSOUNDSYSTEM_SOUND *_pstSound)
 
orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetVolume (const orxSOUNDSYSTEM_SOUND *_pstSound)
 
orxDLLAPI orxBOOL orxFASTCALL orxSoundSystem_HasRecordingSupport ()
 
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_Init ()
 
orxDLLAPI orxBOOL orxFASTCALL orxSoundSystem_IsLooping (const orxSOUNDSYSTEM_SOUND *_pstSound)
 
orxDLLAPI orxSOUNDSYSTEM_SAMPLE *orxFASTCALL orxSoundSystem_LoadSample (const orxSTRING _zFilename)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_Loop (orxSOUNDSYSTEM_SOUND *_pstSound, orxBOOL _bLoop)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_Pause (orxSOUNDSYSTEM_SOUND *_pstSound)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_Play (orxSOUNDSYSTEM_SOUND *_pstSound)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetAttenuation (orxSOUNDSYSTEM_SOUND *_pstSound, orxFLOAT _fAttenuation)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetGlobalVolume (orxFLOAT _fGlobalVolume)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetListenerPosition (const orxVECTOR *_pvPosition)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetPitch (orxSOUNDSYSTEM_SOUND *_pstSound, orxFLOAT _fPitch)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetPosition (orxSOUNDSYSTEM_SOUND *_pstSound, const orxVECTOR *_pvPosition)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetReferenceDistance (orxSOUNDSYSTEM_SOUND *_pstSound, orxFLOAT _fDistance)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetSampleData (orxSOUNDSYSTEM_SAMPLE *_pstSample, const orxS16 *_as16Data, orxU32 _u32SampleNumber)
 
orxDLLAPI void orxFASTCALL orxSoundSystem_Setup ()
 
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetVolume (orxSOUNDSYSTEM_SOUND *_pstSound, orxFLOAT _fVolume)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_StartRecording (const orxCHAR *_zName, orxBOOL _bWriteToFile, orxU32 _u32SampleRate, orxU32 _u32ChannelNumber)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_Stop (orxSOUNDSYSTEM_SOUND *_pstSound)
 
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_StopRecording ()
 

Detailed Description

Sound system plugin module Plugin module that handles sound system

Macro Definition Documentation

#define orxSOUNDSYSTEM_KZ_CONFIG_RATIO   "DimensionRatio"

Definition at line 78 of file orxSoundSystem.h.

#define orxSOUNDSYSTEM_KZ_CONFIG_SECTION   "SoundSystem"

Config defines

Definition at line 77 of file orxSoundSystem.h.

#define orxSOUNDSYSTEM_KZ_CONFIG_STREAM_BUFFER_NUMBER   "StreamBufferNumber"

Definition at line 80 of file orxSoundSystem.h.

#define orxSOUNDSYSTEM_KZ_CONFIG_STREAM_BUFFER_SIZE   "StreamBufferSize"

Definition at line 79 of file orxSoundSystem.h.

Typedef Documentation

typedef struct __orxSOUNDSYSTEM_SAMPLE_t orxSOUNDSYSTEM_SAMPLE

Definition at line 58 of file orxSoundSystem.h.

typedef struct __orxSOUNDSYSTEM_SOUND_t orxSOUNDSYSTEM_SOUND

Abstract sound structures

Definition at line 57 of file orxSoundSystem.h.

Enumeration Type Documentation

Sound system status enum

Enumerator
orxSOUNDSYSTEM_STATUS_PLAY 
orxSOUNDSYSTEM_STATUS_PAUSE 
orxSOUNDSYSTEM_STATUS_STOP 
orxSOUNDSYSTEM_STATUS_NUMBER 
orxSOUNDSYSTEM_STATUS_NONE 

Definition at line 62 of file orxSoundSystem.h.

Function Documentation

orxDLLAPI orxSOUNDSYSTEM_SOUND* orxFASTCALL orxSoundSystem_CreateFromSample ( const orxSOUNDSYSTEM_SAMPLE _pstSample)

Creates a sound from preloaded sample (can be played directly)

Parameters
[in]_pstSampleConcerned sample
Returns
orxSOUNDSYSTEM_SOUND / orxNULL
orxDLLAPI orxSOUNDSYSTEM_SAMPLE* orxFASTCALL orxSoundSystem_CreateSample ( orxU32  _u32ChannelNumber,
orxU32  _u32FrameNumber,
orxU32  _u32SampleRate 
)

Creates an empty 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)
Returns
orxSOUNDSYSTEM_SAMPLE / orxNULL
orxDLLAPI orxSOUNDSYSTEM_SOUND* orxFASTCALL orxSoundSystem_CreateStream ( orxU32  _u32ChannelNumber,
orxU32  _u32SampleRate,
const orxSTRING  _zReference 
)

Creates an empty stream

Parameters
[in]_u32ChannelNumberNumber of channels for the stream
[in]_u32SampleRateSampling rate of the stream (ie. number of frames per second)
[in]_zReferenceReference name used for streaming events (usually the corresponding config ID)
Returns
orxSOUNDSYSTEM_SOUND / orxNULL
orxDLLAPI orxSOUNDSYSTEM_SOUND* orxFASTCALL orxSoundSystem_CreateStreamFromFile ( const orxSTRING  _zFilename,
const orxSTRING  _zReference 
)

Creates a streamed sound from file (can be played directly)

Parameters
[in]_zFilenameName of the file to load as a stream (won't be completely loaded in memory, useful for musics)
[in]_zReferenceReference name used for streaming events (usually the corresponding config ID)
Returns
orxSOUNDSYSTEM_SOUND / orxNULL
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_Delete ( orxSOUNDSYSTEM_SOUND _pstSound)

Deletes a sound

Parameters
[in]_pstSoundConcerned sound
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_DeleteSample ( orxSOUNDSYSTEM_SAMPLE _pstSample)

Deletes a sound sample

Parameters
[in]_pstSampleConcerned sample
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI void orxFASTCALL orxSoundSystem_Exit ( )

Exits from the sound system module

orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetAttenuation ( const orxSOUNDSYSTEM_SOUND _pstSound)

Gets a sound attenuation

Parameters
[in]_pstSoundConcerned Sound
Returns
Sound's attenuation
orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetDuration ( const orxSOUNDSYSTEM_SOUND _pstSound)

Gets a sound duration

Parameters
[in]_pstSoundConcerned sound
Returns
Sound's duration (seconds)
orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetGlobalVolume ( )

Gets global volume

Returns
Gobal volume
orxDLLAPI orxVECTOR* orxFASTCALL orxSoundSystem_GetListenerPosition ( orxVECTOR _pvPosition)

Gets listener position

Parameters
[out]_pvPositionListener's position
Returns
orxVECTOR / orxNULL
orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetPitch ( const orxSOUNDSYSTEM_SOUND _pstSound)

Gets a sound pitch

Parameters
[in]_pstSoundConcerned sound
Returns
Sound's pitch
orxDLLAPI orxVECTOR* orxFASTCALL orxSoundSystem_GetPosition ( const orxSOUNDSYSTEM_SOUND _pstSound,
orxVECTOR _pvPosition 
)

Gets a sound position

Parameters
[in]_pstSoundConcerned sound
[out]_pvPositionPosition to get
Returns
Sound's position
orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetReferenceDistance ( const orxSOUNDSYSTEM_SOUND _pstSound)

Gets a sound reference distance

Parameters
[in]_pstSoundConcerned Sound
Returns
Sound's reference distance
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_GetSampleInfo ( const orxSOUNDSYSTEM_SAMPLE _pstSample,
orxU32 *  _pu32ChannelNumber,
orxU32 *  _pu32FrameNumber,
orxU32 *  _pu32SampleRate 
)

Gets sample info

Parameters
[in]_pstSampleConcerned sample
[in]_pu32ChannelNumberNumber of channels of the sample
[in]_pu32FrameNumberNumber of frame of the sample (number of "samples" = number of frames * number of channels)
[in]_pu32SampleRateSampling rate of the sample (ie. number of frames per second)
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSOUNDSYSTEM_STATUS orxFASTCALL orxSoundSystem_GetStatus ( const orxSOUNDSYSTEM_SOUND _pstSound)

Gets a sound status (play/pause/stop)

Parameters
[in]_pstSoundConcerned sound
Returns
orxSOUNDSYSTEM_STATUS
orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetVolume ( const orxSOUNDSYSTEM_SOUND _pstSound)

Gets a sound volume

Parameters
[in]_pstSoundConcerned sound
Returns
Sound's volume
orxDLLAPI orxBOOL orxFASTCALL orxSoundSystem_HasRecordingSupport ( )

Is recording possible on the current system?

Returns
orxTRUE / orxFALSE
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_Init ( )

Inits the sound system module

Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxBOOL orxFASTCALL orxSoundSystem_IsLooping ( const orxSOUNDSYSTEM_SOUND _pstSound)

Is sound looping?

Parameters
[in]_pstSoundConcerned sound
Returns
orxTRUE if looping, orxFALSE otherwise
orxDLLAPI orxSOUNDSYSTEM_SAMPLE* orxFASTCALL orxSoundSystem_LoadSample ( const orxSTRING  _zFilename)

Loads a sound sample from file (cannot be played directly)

Parameters
[in]_zFilenameName of the file to load as a sample (completely loaded in memory, useful for sound effects)
Returns
orxSOUNDSYSTEM_SAMPLE / orxNULL
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_Loop ( orxSOUNDSYSTEM_SOUND _pstSound,
orxBOOL  _bLoop 
)

Loops a sound

Parameters
[in]_pstSoundConcerned sound
[in]_bLoopLoop / no loop
Returns
orxSTATUS_SUCCESS / orxSTATSUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_Pause ( orxSOUNDSYSTEM_SOUND _pstSound)

Pauses a sound

Parameters
[in]_pstSoundConcerned sound
Returns
orxSTATUS_SUCCESS / orxSTATSUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_Play ( orxSOUNDSYSTEM_SOUND _pstSound)

Plays a sound

Parameters
[in]_pstSoundConcerned sound
Returns
orxSTATUS_SUCCESS / orxSTATSUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetAttenuation ( orxSOUNDSYSTEM_SOUND _pstSound,
orxFLOAT  _fAttenuation 
)

Sets a sound attenuation

Parameters
[in]_pstSoundConcerned Sound
[in]_fAttenuationDesired attenuation
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetGlobalVolume ( orxFLOAT  _fGlobalVolume)

Sets global volume

Parameters
[in]_fGlobalVolumeGlobal volume to set
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetListenerPosition ( const orxVECTOR _pvPosition)

Sets listener position

Parameters
[in]_pvPositionDesired position
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetPitch ( orxSOUNDSYSTEM_SOUND _pstSound,
orxFLOAT  _fPitch 
)

Sets a sound pitch

Parameters
[in]_pstSoundConcerned sound
[in]_fPitchPitch to set
Returns
orxSTATUS_SUCCESS / orxSTATSUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetPosition ( orxSOUNDSYSTEM_SOUND _pstSound,
const orxVECTOR _pvPosition 
)

Sets a sound position

Parameters
[in]_pstSoundConcerned sound
[in]_pvPositionPosition to set
Returns
orxSTATUS_SUCCESS / orxSTATSUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetReferenceDistance ( orxSOUNDSYSTEM_SOUND _pstSound,
orxFLOAT  _fDistance 
)

Sets a sound reference distance

Parameters
[in]_pstSoundConcerned Sound
[in]_fDistanceWithin this distance, sound is perceived at its maximum volume
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetSampleData ( orxSOUNDSYSTEM_SAMPLE _pstSample,
const orxS16 *  _as16Data,
orxU32  _u32SampleNumber 
)

Sets sample data

Parameters
[in]_pstSampleConcerned sample
[in]_as16DataData to set
[in]_u32SampleNumberNumber of samples in the data array
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI void orxFASTCALL orxSoundSystem_Setup ( )

Sound system module setup

orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetVolume ( orxSOUNDSYSTEM_SOUND _pstSound,
orxFLOAT  _fVolume 
)

Sets a sound volume

Parameters
[in]_pstSoundConcerned sound
[in]_fVolumeVolume to set [0, 1]
Returns
orxSTATUS_SUCCESS / orxSTATSUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_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 orxSoundSystem_Stop ( orxSOUNDSYSTEM_SOUND _pstSound)

Stops a sound

Parameters
[in]_pstSoundConcerned sound
Returns
orxSTATUS_SUCCESS / orxSTATSUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_StopRecording ( )

Stops recording

Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

Generated for orx by doxygen 1.5.6