Polyphase Game Engine
Loading...
Searching...
No Matches
Audio_Lua.h
Go to the documentation of this file.
1#pragma once
2
3#include "AudioManager.h"
4#include "EngineTypes.h"
5
6#if LUA_ENABLED
7
8#define AUDIO_LUA_NAME "Audio"
9
10struct Audio_Lua
11{
12
13 // Uses 2D for playback.
14 static int Play(lua_State* L);
15 static int Pause(lua_State* L);
16 static int Stop(lua_State* L);
17
18
19 static int PlaySound2D(lua_State* L);
20 static int PlaySound3D(lua_State* L);
21 static int PlaySoundAtPosition(lua_State* L);
22 static int StopSounds(lua_State* L);
23 static int UpdateSound(lua_State* L);
24 static int StopAllSounds(lua_State* L);
25 static int IsSoundPlaying(lua_State* L);
26
27 static int SetAudioClassVolume(lua_State* L);
28 static int GetAudioClassVolume(lua_State* L);
29 static int SetAudioClassPitch(lua_State* L);
30 static int GetAudioClassPitch(lua_State* L);
31
32 static int SetMasterVolume(lua_State* L);
33 static int GetMasterVolume(lua_State* L);
34 static int SetMasterPitch(lua_State* L);
35 static int GetMasterPitch(lua_State* L);
36
37 // Voice transport (voice index from AudioManager's pool).
38 static int GetDuration(lua_State* L);
39 static int GetPlayTimeNormalized(lua_State* L);
40
41 // Audio analysis (voice index from AudioManager's pool — see Audio.GetMaxVoices()).
42 static int GetRMS(lua_State* L);
43 static int GetLoudness(lua_State* L);
44 static int GetLoudnessDb(lua_State* L);
45 static int GetFrequencies(lua_State* L);
46 static int GetSpectrum(lua_State* L);
47
48 // Audio analysis on push-PCM streaming voices (streamId from AUD_OpenStream).
49 static int GetStreamRMS(lua_State* L);
50 static int GetStreamLoudness(lua_State* L);
51 static int GetStreamLoudnessDb(lua_State* L);
52 static int GetStreamFrequencies(lua_State* L);
53 static int GetStreamSpectrum(lua_State* L);
54
55 static void Bind();
56};
57
58#endif