orx  1.14
Portable Game Engine
orxSound.h
Go to the documentation of this file.
1 /* Orx - Portable Game Engine
2  *
3  * Copyright (c) 2008-2022 Orx-Project
4  *
5  * This software is provided 'as-is', without any express or implied
6  * warranty. In no event will the authors be held liable for any damages
7  * arising from the use of this software.
8  *
9  * Permission is granted to anyone to use this software for any purpose,
10  * including commercial applications, and to alter it and redistribute it
11  * freely, subject to the following restrictions:
12  *
13  * 1. The origin of this software must not be misrepresented; you must not
14  * claim that you wrote the original software. If you use this software
15  * in a product, an acknowledgment in the product documentation would be
16  * appreciated but is not required.
17  *
18  * 2. Altered source versions must be plainly marked as such, and must not be
19  * misrepresented as being the original software.
20  *
21  * 3. This notice may not be removed or altered from any source
22  * distribution.
23  */
24 
43 #ifndef _orxSOUND_H_
44 #define _orxSOUND_H_
45 
46 
47 #include "orxInclude.h"
48 #include "math/orxVector.h"
49 #include "sound/orxSoundSystem.h"
50 
51 
54 #define orxSOUND_KZ_RESOURCE_GROUP "Sound"
55 #define orxSOUND_KZ_LOCALE_GROUP "Sound"
56 
57 #define orxSOUND_KZ_MASTER_BUS "master"
58 
59 
62 typedef enum __orxSOUND_STATUS_t
63 {
67 
69 
70  orxSOUND_STATUS_NONE = orxENUM_NONE
71 
73 
74 
77 typedef struct __orxSOUND_t orxSOUND;
78 typedef struct __orxSOUND_SAMPLE_t orxSOUND_SAMPLE;
79 
80 
83 typedef enum __orxSOUND_EVENT_t
84 {
96 
97  orxSOUND_EVENT_NONE = orxENUM_NONE
98 
100 
103 typedef struct __orxSOUND_STREAM_INFO_t
104 {
105  const orxSTRING zName;
106  orxU32 u32SampleRate;
110 
113 typedef struct __orxSOUND_STREAM_PACKET_t
114 {
115  orxFLOAT *afSampleList;
117  orxFLOAT fTimeStamp;
118  orxFLOAT fTime;
119  orxS32 s32ID;
120  orxBOOL bDiscard;
121  orxBOOL bLast;
124 
127 typedef struct __orxSOUND_EVENT_PAYLOAD_t
128 {
131  struct
132  {
136  } stStream;
137 
138  struct
139  {
141  orxSTRINGID stBusID;
143  } stFilter;
144 
146 
147 
150 extern orxDLLAPI void orxFASTCALL orxSound_Setup();
151 
155 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_Init();
156 
159 extern orxDLLAPI void orxFASTCALL orxSound_Exit();
160 
161 
165 extern orxDLLAPI orxSOUND *orxFASTCALL orxSound_Create();
166 
171 extern orxDLLAPI orxSOUND *orxFASTCALL orxSound_CreateFromConfig(const orxSTRING _zConfigID);
172 
179 extern orxDLLAPI orxSOUND *orxFASTCALL orxSound_CreateWithEmptyStream(orxU32 _u32ChannelNumber, orxU32 _u32SampleRate, const orxSTRING _zName);
180 
185 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_Delete(orxSOUND *_pstSound);
186 
190 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_ClearCache();
191 
192 
200 extern orxDLLAPI orxSOUND_SAMPLE *orxFASTCALL orxSound_CreateSample(orxU32 _u32ChannelNumber, orxU32 _u32FrameNumber, orxU32 _u32SampleRate, const orxSTRING _zName);
201 
206 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_DeleteSample(orxSOUND_SAMPLE *_pstSample);
207 
215 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_GetSampleInfo(const orxSOUND_SAMPLE *_pstSample, orxU32 *_pu32ChannelNumber, orxU32 *_pu32FrameNumber, orxU32 *_pu32SampleRate);
216 
223 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetSampleData(orxSOUND_SAMPLE *_pstSample, const orxFLOAT *_afData, orxU32 _u32SampleNumber);
224 
230 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_LinkSample(orxSOUND *_pstSound, const orxSTRING _zSampleName);
231 
236 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_UnlinkSample(orxSOUND *_pstSound);
237 
238 
243 extern orxDLLAPI orxBOOL orxFASTCALL orxSound_IsStream(orxSOUND *_pstSound);
244 
245 
250 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_Play(orxSOUND *_pstSound);
251 
256 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_Pause(orxSOUND *_pstSound);
257 
262 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_Stop(orxSOUND *_pstSound);
263 
270 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_AddFilter(orxSOUND *_pstSound, const orxSOUND_FILTER_DATA *_pstFilterData, orxBOOL _bUseCustomParam);
271 
276 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_RemoveLastFilter(orxSOUND *_pstSound);
277 
282 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_RemoveAllFilters(orxSOUND *_pstSound);
283 
289 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_AddFilterFromConfig(orxSOUND *_pstSound, const orxSTRING _zFilterConfigID);
290 
291 
299 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_StartRecording(const orxCHAR *_zName, orxBOOL _bWriteToFile, orxU32 _u32SampleRate, orxU32 _u32ChannelNumber);
300 
304 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_StopRecording();
305 
309 extern orxDLLAPI orxBOOL orxFASTCALL orxSound_HasRecordingSupport();
310 
311 
317 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetVolume(orxSOUND *_pstSound, orxFLOAT _fVolume);
318 
324 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetPitch(orxSOUND *_pstSound, orxFLOAT _fPitch);
325 
331 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetTime(orxSOUND *_pstSound, orxFLOAT _fTime);
332 
338 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetPosition(orxSOUND *_pstSound, const orxVECTOR *_pvPosition);
339 
349 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetSpatialization(orxSOUND *_pstSound, orxFLOAT _fMinDistance, orxFLOAT _fMaxDistance, orxFLOAT _fMinGain, orxFLOAT _fMaxGain, orxFLOAT _fRollOff);
350 
357 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetPanning(orxSOUND *_pstSound, orxFLOAT _fPanning, orxBOOL _bMix);
358 
364 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_Loop(orxSOUND *_pstSound, orxBOOL _bLoop);
365 
366 
371 extern orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetVolume(const orxSOUND *_pstSound);
372 
377 extern orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetPitch(const orxSOUND *_pstSound);
378 
383 extern orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetTime(const orxSOUND *_pstSound);
384 
390 extern orxDLLAPI orxVECTOR *orxFASTCALL orxSound_GetPosition(const orxSOUND *_pstSound, orxVECTOR *_pvPosition);
391 
401 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_GetSpatialization(const orxSOUND *_pstSound, orxFLOAT *_pfMinDistance, orxFLOAT *_pfMaxDistance, orxFLOAT *_pfMinGain, orxFLOAT *_pfMaxGain, orxFLOAT *_pfRollOff);
402 
409 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_GetPanning(const orxSOUND *_pstSound, orxFLOAT *_pfPanning, orxBOOL *_pbMix);
410 
415 extern orxDLLAPI orxBOOL orxFASTCALL orxSound_IsLooping(const orxSOUND *_pstSound);
416 
417 
422 extern orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetDuration(const orxSOUND *_pstSound);
423 
428 extern orxDLLAPI orxSOUND_STATUS orxFASTCALL orxSound_GetStatus(const orxSOUND *_pstSound);
429 
434 extern orxDLLAPI const orxSTRING orxFASTCALL orxSound_GetName(const orxSOUND *_pstSound);
435 
439 extern orxDLLAPI orxSTRINGID orxFASTCALL orxSound_GetMasterBusID();
440 
445 extern orxDLLAPI orxSTRINGID orxFASTCALL orxSound_GetBusID(const orxSOUND *_pstSound);
446 
452 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusID(orxSOUND *_pstSound, orxSTRINGID _stBusID);
453 
459 extern orxDLLAPI orxSOUND *orxFASTCALL orxSound_GetNext(const orxSOUND *_pstSound, orxSTRINGID _stBusID);
460 
465 extern orxDLLAPI orxSTRINGID orxFASTCALL orxSound_GetBusParent(orxSTRINGID _stBusID);
466 
471 extern orxDLLAPI orxSTRINGID orxFASTCALL orxSound_GetBusChild(orxSTRINGID _stBusID);
472 
477 extern orxDLLAPI orxSTRINGID orxFASTCALL orxSound_GetBusSibling(orxSTRINGID _stBusID);
478 
484 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusParent(orxSTRINGID _stBusID, orxSTRINGID _stParentBusID);
485 
490 extern orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusVolume(orxSTRINGID _stBusID);
491 
496 extern orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusPitch(orxSTRINGID _stBusID);
497 
503 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusVolume(orxSTRINGID _stBusID, orxFLOAT _fVolume);
504 
510 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusPitch(orxSTRINGID _stBusID, orxFLOAT _fPitch);
511 
516 extern orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusGlobalVolume(orxSTRINGID _stBusID);
517 
522 extern orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusGlobalPitch(orxSTRINGID _stBusID);
523 
530 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_AddBusFilter(orxSTRINGID _stBusID, const orxSOUND_FILTER_DATA *_pstFilterData, orxBOOL _bUseCustomParam);
531 
536 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_RemoveLastBusFilter(orxSTRINGID _stBusID);
537 
542 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_RemoveAllBusFilters(orxSTRINGID _stBusID);
543 
549 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_AddBusFilterFromConfig(orxSTRINGID _stBusID, const orxSTRING _zFilterConfigID);
550 
551 #endif /*_orxSOUND_H_*/
552 
orxDLLAPI orxSTRINGID orxFASTCALL orxSound_GetBusParent(orxSTRINGID _stBusID)
orxDLLAPI void orxFASTCALL orxSound_Exit()
orxSOUND_STATUS
Definition: orxSound.h:62
orxDLLAPI orxSOUND *orxFASTCALL orxSound_CreateFromConfig(const orxSTRING _zConfigID)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_Play(orxSOUND *_pstSound)
orxDLLAPI orxSTRINGID orxFASTCALL orxSound_GetBusSibling(orxSTRINGID _stBusID)
const orxSTRING zName
Definition: orxSound.h:105
orxDLLAPI orxSOUND *orxFASTCALL orxSound_CreateWithEmptyStream(orxU32 _u32ChannelNumber, orxU32 _u32SampleRate, const orxSTRING _zName)
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusGlobalVolume(orxSTRINGID _stBusID)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetVolume(orxSOUND *_pstSound, orxFLOAT _fVolume)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_AddBusFilterFromConfig(orxSTRINGID _stBusID, const orxSTRING _zFilterConfigID)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_StartRecording(const orxCHAR *_zName, orxBOOL _bWriteToFile, orxU32 _u32SampleRate, orxU32 _u32ChannelNumber)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_Init()
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetDuration(const orxSOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_RemoveLastBusFilter(orxSTRINGID _stBusID)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_Delete(orxSOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetTime(orxSOUND *_pstSound, orxFLOAT _fTime)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_LinkSample(orxSOUND *_pstSound, const orxSTRING _zSampleName)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusPitch(orxSTRINGID _stBusID, orxFLOAT _fPitch)
orxSOUND * pstSound
Definition: orxSound.h:129
orxDLLAPI orxSTRINGID orxFASTCALL orxSound_GetBusChild(orxSTRINGID _stBusID)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetPitch(orxSOUND *_pstSound, orxFLOAT _fPitch)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_RemoveAllBusFilters(orxSTRINGID _stBusID)
orxDLLAPI orxSOUND_STATUS orxFASTCALL orxSound_GetStatus(const orxSOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_ClearCache()
orxDLLAPI orxSOUND_SAMPLE *orxFASTCALL orxSound_CreateSample(orxU32 _u32ChannelNumber, orxU32 _u32FrameNumber, orxU32 _u32SampleRate, const orxSTRING _zName)
orxDLLAPI orxBOOL orxFASTCALL orxSound_IsStream(orxSOUND *_pstSound)
orxSOUND_EVENT
Definition: orxSound.h:83
orxDLLAPI orxBOOL orxFASTCALL orxSound_IsLooping(const orxSOUND *_pstSound)
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetTime(const orxSOUND *_pstSound)
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetPitch(const orxSOUND *_pstSound)
orxDLLAPI void orxFASTCALL orxSound_Setup()
orxDLLAPI orxSTATUS orxFASTCALL orxSound_GetSpatialization(const orxSOUND *_pstSound, orxFLOAT *_pfMinDistance, orxFLOAT *_pfMaxDistance, orxFLOAT *_pfMinGain, orxFLOAT *_pfMaxGain, orxFLOAT *_pfRollOff)
orxSOUND_STREAM_INFO stInfo
Definition: orxSound.h:133
orxU32 u32ChannelNumber
Definition: orxSound.h:107
orxDLLAPI orxSTATUS orxFASTCALL orxSound_RemoveAllFilters(orxSOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_AddFilter(orxSOUND *_pstSound, const orxSOUND_FILTER_DATA *_pstFilterData, orxBOOL _bUseCustomParam)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_GetPanning(const orxSOUND *_pstSound, orxFLOAT *_pfPanning, orxBOOL *_pbMix)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusParent(orxSTRINGID _stBusID, orxSTRINGID _stParentBusID)
orxSTATUS
Definition: orxType.h:256
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetSampleData(orxSOUND_SAMPLE *_pstSample, const orxFLOAT *_afData, orxU32 _u32SampleNumber)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetSpatialization(orxSOUND *_pstSound, orxFLOAT _fMinDistance, orxFLOAT _fMaxDistance, orxFLOAT _fMinGain, orxFLOAT _fMaxGain, orxFLOAT _fRollOff)
orxSOUND_FILTER_DATA stData
Definition: orxSound.h:140
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusID(orxSOUND *_pstSound, orxSTRINGID _stBusID)
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusPitch(orxSTRINGID _stBusID)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetPosition(orxSOUND *_pstSound, const orxVECTOR *_pvPosition)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_DeleteSample(orxSOUND_SAMPLE *_pstSample)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_GetSampleInfo(const orxSOUND_SAMPLE *_pstSample, orxU32 *_pu32ChannelNumber, orxU32 *_pu32FrameNumber, orxU32 *_pu32SampleRate)
#define orxDLLAPI
Definition: orxDecl.h:370
orxDLLAPI orxSTRINGID orxFASTCALL orxSound_GetBusID(const orxSOUND *_pstSound)
orxSOUND_STREAM_PACKET stPacket
Definition: orxSound.h:134
orxDLLAPI orxSTATUS orxFASTCALL orxSound_Stop(orxSOUND *_pstSound)
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusGlobalPitch(orxSTRINGID _stBusID)
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetVolume(const orxSOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_Loop(orxSOUND *_pstSound, orxBOOL _bLoop)
struct __orxSOUND_SAMPLE_t orxSOUND_SAMPLE
Definition: orxSound.h:78
orxDLLAPI orxBOOL orxFASTCALL orxSound_HasRecordingSupport()
orxDLLAPI orxVECTOR *orxFASTCALL orxSound_GetPosition(const orxSOUND *_pstSound, orxVECTOR *_pvPosition)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_Pause(orxSOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_UnlinkSample(orxSOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusVolume(orxSTRINGID _stBusID, orxFLOAT _fVolume)
orxSTRINGID stBusID
Definition: orxSound.h:141
orxDLLAPI const orxSTRING orxFASTCALL orxSound_GetName(const orxSOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_StopRecording()
orxDLLAPI orxSTATUS orxFASTCALL orxSound_AddBusFilter(orxSTRINGID _stBusID, const orxSOUND_FILTER_DATA *_pstFilterData, orxBOOL _bUseCustomParam)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_AddFilterFromConfig(orxSOUND *_pstSound, const orxSTRING _zFilterConfigID)
orxDLLAPI orxSOUND *orxFASTCALL orxSound_GetNext(const orxSOUND *_pstSound, orxSTRINGID _stBusID)
orxDLLAPI orxSOUND *orxFASTCALL orxSound_Create()
orxFLOAT * afSampleList
Definition: orxSound.h:115
orxDLLAPI orxSTATUS orxFASTCALL orxSound_RemoveLastFilter(orxSOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetPanning(orxSOUND *_pstSound, orxFLOAT _fPanning, orxBOOL _bMix)
orxDLLAPI orxSTRINGID orxFASTCALL orxSound_GetMasterBusID()
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusVolume(orxSTRINGID _stBusID)
struct __orxSOUND_t orxSOUND
Definition: orxSound.h:77

Generated for orx by doxygen 1.8.11