Audio backend API.
More...
◆ Init()
void tram::Audio::API::Init |
( |
| ) |
|
◆ IsAudioSourcePlaying()
bool tram::Audio::API::IsAudioSourcePlaying |
( |
audiosource_t |
source | ) |
|
Checks if an audio source is playing.
- Returns
- True if the audio source is playing a sound, false otherwise.
◆ MakeAudioBuffer()
audiobuffer_t tram::Audio::API::MakeAudioBuffer |
( |
const int16_t * |
audio_data, |
|
|
int32_t |
length, |
|
|
int32_t |
samples, |
|
|
int32_t |
channels |
|
) |
| |
Creates audio buffers from raw audio data.
- Parameters
-
audio_data | Pointer to the raw audio data, stored as 16 bit PCM. |
length | Length of the raw audio data, in samples. |
buffer_count | Created buffer count will be stored in this variable. |
◆ MakeAudioSource()
Creates an audio source.
- Returns
- A new audio source handle.
◆ PauseAudioSource()
◆ PlayAudioSource()
◆ RemoveAudioBuffer()
◆ RemoveAudioSource()
Deletes an audio source.
If you do this, then the audio source handle will become invalid. Call MakeAudioSource() to get a new one.
◆ SetAudioSourceBuffer()
Sets the buffers that the audio source will play.
◆ SetAudioSourceGain()
void tram::Audio::API::SetAudioSourceGain |
( |
audiosource_t |
source, |
|
|
float |
gain |
|
) |
| |
Sets the gain of an audio source.
- Parameters
-
gain | 1.0f is the regular gain. Halving the value decreases the gain by 6dB. |
◆ SetAudioSourcePitch()
void tram::Audio::API::SetAudioSourcePitch |
( |
audiosource_t |
source, |
|
|
float |
pitch |
|
) |
| |
Sets the pitch of an audio source.
- Parameters
-
pitch | 1.0f is the regular pitch. Halving the value decreases the pitch by an octave. Doubling the value increases the pitch by an octave. |
◆ SetAudioSourcePosition()
void tram::Audio::API::SetAudioSourcePosition |
( |
audiosource_t |
source, |
|
|
vec3 |
position |
|
) |
| |
Sets the position of an audio source.
◆ SetAudioSourceRepeating()
void tram::Audio::API::SetAudioSourceRepeating |
( |
audiosource_t |
source, |
|
|
bool |
repeating |
|
) |
| |
Sets the repetition of an audio source.
- Parameters
-
repeating | True if the sound repeats after playing, false if it just stops. |
◆ SetAudioSourceVelocity()
void tram::Audio::API::SetAudioSourceVelocity |
( |
audiosource_t |
source, |
|
|
vec3 |
velocity |
|
) |
| |
Sets the velocity of an audio source.
◆ SetListenerGain()
void tram::Audio::API::SetListenerGain |
( |
float |
gain | ) |
|
◆ SetListenerOrientation()
void tram::Audio::API::SetListenerOrientation |
( |
quat |
orientation | ) |
|
Sets the listener orientation.
- Parameters
-
orientation | Listener orientation. Under normal circumstances, it should be the same as render view rotation. |
◆ SetListenerPosition()
void tram::Audio::API::SetListenerPosition |
( |
vec3 |
position | ) |
|
Sets the listener position.
- Parameters
-
position | Listener position. Under normal circumstances, it should be the same as render view position. |
◆ StopAudioSource()
◆ Uninit()
void tram::Audio::API::Uninit |
( |
| ) |
|
◆ Update()
void tram::Audio::API::Update |
( |
| ) |
|