My Project
ParaScriptingAudio1.h
1 //-----------------------------------------------------------------------------
2 // Copyright (C) 2004 - 2006 ParaEngine Dev Studio, All Rights Reserved.
3 // Date: 2006.8
4 // Description: API for Audio Engine.
5 //-----------------------------------------------------------------------------
6 #pragma once
7 #include <string>
8 
9 using namespace std;
10 
11 namespace ParaScripting
12 {
17  class PE_CORE_DECL ParaAudio
18  {
19  public:
20 
23  static bool IsAudioEngineEnabled();
25  static void EnableAudioEngine();
27  static void DisableAudioEngine();
28 
32  static void SetVolume(float fVolume);
33 
37  static float GetVolume();
38 
41  static void PauseCategory(const char * strCategoryName);
44  static void ResumeCategory(const char * strCategoryName);
47  static void StopCategory(const char * strCategoryName);
55  static void EnableAudioBank(const char * strBankName);
56 
60  static void DisableAudioBank(const char * strBankName);
61 
67  static int LoadSoundBank(const char* filename);
68 
70  static int UnLoadSoundBank(const char* filename);
71 
77  static int LoadInMemoryWaveBank(const char* filename);
78 
80  static int UnLoadInMemoryWaveBank(const char* filename);
81 
87  static int LoadStreamWaveBank(const char* filename);
88 
90  static int UnLoadStreamWaveBank(const char* filename);
91 
94  static string GetCurrentAudioBankName();
96  static void SetAudioStereo();
98  static void SetAudio5Point1();
101  static int GetAudioFormat();
102 
106  static void PlayBGMusic( const char * strBGMusicName );
109  static void PauseBGMusic( );
112  static void ResumeBGMusic( );
115  static void StopBGMusic( );
117  static bool IsBGMusicEnabled();
119  static void EnableBGMusic( );
121  static void DisableBGMusic( );
124  static float GetBGMusicVolume( );
127  static void SetBGMusicVolume( const float fVolume );
128 
132  static void PlayDialog( const char * strDialogName , const char * strScript );
134  static void SkipDialog( );
136  static void PauseDialog( );
138  static void ResumeDialog( );
140  static void StopDialog( );
142  static bool IsDialogEnabled();
144  static void EnableDialog( );
146  static void DisableDialog( );
149  static float GetDialogVolume( );
152  static void SetDialogVolume( const float fVolume );
153 
157  static void PlayAmbientSound( const char * strAmbientSoundName );
160  static void PauseAmbientSound( const char * strAmbientSoundName );
163  static void ResumeAmbientSound( const char * strAmbientSoundName );
166  static void StopAmbientSound( const char * strAmbientSoundName );
168  static bool IsAmbientSoundEnabled();
170  static void EnableAmbientSound( );
172  static void DisableAmbientSound( );
175  static float GetAmbientSoundVolume( );
178  static void SetAmbientSoundVolume( const float fVolume );
179 
183  static void PlayUISound( const char * strUISoundName );
186  static float GetUISoundVolume( );
189  static void SetUISoundVolume( const float fVolume );
190 
196  static void PlayStatic3DSound( const char * str3DSoundName, const char * assetName, float x, float y, float z);
199  static void PauseStatic3DSound( const char * assetName );
202  static void ResumeStatic3DSound( const char * assetName );
205  static void StopStatic3DSound( const char * assetName );
210  static void PlayDynamic3DSound( const char * str3DSoundName, const char * objectName );
213  static float Get3DSoundVolume( );
216  static void Set3DSoundVolume( const float fVolume );
217 
222  static void PlayInteractiveSound( const char * strInteractiveSoundName );
225  static float GetInteractiveSoundVolume( );
228  static void SetInteractiveSoundVolume( const float fVolume );
229 
232  //static void PlayUISound( const char * strSoundAssetName );
233 
235  //static void EnableAudioEngine(bool enable);
236 
238  //static bool IsAudioEngineEnabled();
239 
241  //
242  // code driven audio functions. for file based wave file only.
243  //
245 
251  static bool PlayWaveFile(const char* szWavePath,int nLoopCount);
252  static bool PlayWaveFile1(const char* szWavePath);
260  static bool StopWaveFile(const char* szWavePath, bool bImmediateStop);
261  static bool StopWaveFile1(const char* szWavePath);
262 
267  static bool ReleaseWaveFile(const char* szWavePath);
268 
270  //
271  // recording related
272  //
274 
278  static const char* GetRecordingDeviceEnum();
279 
284  static const char* GetRecordingFormatEnum();
285 
292  static bool SetRecordingOutput(const char* sOutputFile, int nDeviceIndex, int nWaveFormatIndex);
293 
295  static bool BeginRecording();
296 
297 
301  static bool PauseOrResumeRecording(int nState);
302 
303 
305  static bool StopRecording();
306 
308  static bool IsRecording();
309 
311  static bool IsRecordingPaused();
312 
316  static const char* GetLastRecordedData(int nTimeLength);
317  };
318 
319 }
Audio Engine functions.
Definition: ParaScriptingAudio1.h:17
for luabind, The main drawback of this approach is that the compilation time will increase for the fi...
Definition: luaSQLite.cpp:1971