Tramway SDK
api.h
Go to the documentation of this file.
1// TRAMWAY DRIFT AND DUNGEON EXPLORATION SIMULATOR 2022
2// All rights reserved.
3
4#ifndef TRAM_SDK_AUDIO_API_H
5#define TRAM_SDK_AUDIO_API_H
6
7#include <audio/audio.h>
8
9namespace tram::Audio::API {
10
11void Init();
12void Update();
13void Uninit();
14
15void SetListenerPosition(vec3 position);
17void SetListenerGain(float gain);
18
19audiobuffer_t MakeAudioBuffer(const int16_t* audio_data, int32_t length, int32_t samples, int32_t channels);
21
23
24void SetAudioSourcePitch(audiosource_t source, float pitch);
25void SetAudioSourceGain(audiosource_t source, float gain);
26void SetAudioSourcePosition(audiosource_t source, vec3 position);
27void SetAudioSourceVelocity(audiosource_t source, vec3 velocity);
28void SetAudioSourceRepeating(audiosource_t source, bool repeating);
29
31
35
37
39
40}
41
42#endif // TRAM_SDK_AUDIO_API_H
Definition: api.h:9
audiosource_t MakeAudioSource()
Creates an audio source.
Definition: openal.cpp:107
void SetListenerGain(float gain)
Definition: openal.cpp:61
void RemoveAudioBuffer(audiobuffer_t buffer)
Deletes audio buffers.
Definition: openal.cpp:100
void SetListenerOrientation(quat orientation)
Sets the listener orientation.
Definition: openal.cpp:52
void SetAudioSourcePosition(audiosource_t source, vec3 position)
Sets the position of an audio source.
Definition: openal.cpp:129
void Update()
Definition: openal.cpp:32
void SetAudioSourceBuffer(audiosource_t source, audiobuffer_t buffer)
Sets the buffers that the audio source will play.
Definition: openal.cpp:146
void SetAudioSourceRepeating(audiosource_t source, bool repeating)
Sets the repetition of an audio source.
Definition: openal.cpp:141
void StopAudioSource(audiosource_t source)
Stops the audio source.
Definition: openal.cpp:165
void SetAudioSourceVelocity(audiosource_t source, vec3 velocity)
Sets the velocity of an audio source.
Definition: openal.cpp:134
void SetListenerPosition(vec3 position)
Sets the listener position.
Definition: openal.cpp:45
void Init()
Definition: openal.cpp:20
bool IsAudioSourcePlaying(audiosource_t source)
Checks if an audio source is playing.
Definition: openal.cpp:171
void PlayAudioSource(audiosource_t source)
Plays an audio source.
Definition: openal.cpp:155
void SetAudioSourceGain(audiosource_t source, float gain)
Sets the gain of an audio source.
Definition: openal.cpp:124
void SetAudioSourcePitch(audiosource_t source, float pitch)
Sets the pitch of an audio source.
Definition: openal.cpp:117
audiobuffer_t MakeAudioBuffer(const int16_t *audio_data, int32_t length, int32_t samples, int32_t channels)
Creates audio buffers from raw audio data.
Definition: openal.cpp:69
void PauseAudioSource(audiosource_t source)
Pauses the audio source.
Definition: openal.cpp:160
void Uninit()
Definition: openal.cpp:36
void RemoveAudioSource(audiosource_t source)
Deletes an audio source.
Definition: openal.cpp:180
orientation
Definition: gui.h:18
char buffer[500]
Definition: logging.cpp:35
glm::vec3 vec3
Definition: math.h:12
glm::quat quat
Definition: math.h:13
Definition: audio.h:19
Definition: audio.h:12