Tramway SDK
|
Functions | |
void | Init () |
void | Update () |
void | Uninit () |
void | SetListenerPosition (vec3 position) |
Sets the listener position. More... | |
void | SetListenerOrientation (quat orientation) |
Sets the listener orientation. More... | |
void | SetListenerGain (float gain) |
audiobuffer_t | MakeAudioBuffer (const int16_t *audio_data, int32_t length, int32_t samples, int32_t channels) |
Creates audio buffers from raw audio data. More... | |
void | RemoveAudioBuffer (audiobuffer_t buffer) |
Deletes audio buffers. More... | |
audiosource_t | MakeAudioSource () |
Creates an audio source. More... | |
void | SetAudioSourcePitch (audiosource_t source, float pitch) |
Sets the pitch of an audio source. More... | |
void | SetAudioSourceGain (audiosource_t source, float gain) |
Sets the gain of an audio source. More... | |
void | SetAudioSourcePosition (audiosource_t source, vec3 position) |
Sets the position of an audio source. More... | |
void | SetAudioSourceVelocity (audiosource_t source, vec3 velocity) |
Sets the velocity of an audio source. More... | |
void | SetAudioSourceRepeating (audiosource_t source, bool repeating) |
Sets the repetition of an audio source. More... | |
void | SetAudioSourceBuffer (audiosource_t source, audiobuffer_t buffer) |
Sets the buffers that the audio source will play. More... | |
void | PlayAudioSource (audiosource_t source) |
Plays an audio source. More... | |
void | PauseAudioSource (audiosource_t source) |
Pauses the audio source. More... | |
void | StopAudioSource (audiosource_t source) |
Stops the audio source. More... | |
bool | IsAudioSourcePlaying (audiosource_t source) |
Checks if an audio source is playing. More... | |
void | RemoveAudioSource (audiosource_t source) |
Deletes an audio source. More... | |
void tram::Audio::API::Init | ( | ) |
bool tram::Audio::API::IsAudioSourcePlaying | ( | audiosource_t | source | ) |
Checks if an audio source is playing.
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.
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. |
audiosource_t tram::Audio::API::MakeAudioSource | ( | ) |
Creates an audio source.
void tram::Audio::API::PauseAudioSource | ( | audiosource_t | source | ) |
Pauses the audio source.
void tram::Audio::API::PlayAudioSource | ( | audiosource_t | source | ) |
Plays an audio source.
void tram::Audio::API::RemoveAudioBuffer | ( | audiobuffer_t | buffer | ) |
Deletes audio buffers.
void tram::Audio::API::RemoveAudioSource | ( | audiosource_t | source | ) |
Deletes an audio source.
If you do this, then the audio source handle will become invalid. Call MakeAudioSource() to get a new one.
void tram::Audio::API::SetAudioSourceBuffer | ( | audiosource_t | source, |
audiobuffer_t | buffer | ||
) |
Sets the buffers that the audio source will play.
void tram::Audio::API::SetAudioSourceGain | ( | audiosource_t | source, |
float | gain | ||
) |
Sets the gain of an audio source.
gain | 1.0f is the regular gain. Halving the value decreases the gain by 6dB. |
void tram::Audio::API::SetAudioSourcePitch | ( | audiosource_t | source, |
float | pitch | ||
) |
Sets the pitch of an audio source.
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. |
void tram::Audio::API::SetAudioSourcePosition | ( | audiosource_t | source, |
vec3 | position | ||
) |
Sets the position of an audio source.
void tram::Audio::API::SetAudioSourceRepeating | ( | audiosource_t | source, |
bool | repeating | ||
) |
Sets the repetition of an audio source.
repeating | True if the sound repeats after playing, false if it just stops. |
void tram::Audio::API::SetAudioSourceVelocity | ( | audiosource_t | source, |
vec3 | velocity | ||
) |
Sets the velocity of an audio source.
void tram::Audio::API::SetListenerGain | ( | float | gain | ) |
void tram::Audio::API::SetListenerOrientation | ( | quat | orientation | ) |
Sets the listener orientation.
orientation | Listener orientation. Under normal circumstances, it should be the same as render view rotation. |
void tram::Audio::API::SetListenerPosition | ( | vec3 | position | ) |
Sets the listener position.
position | Listener position. Under normal circumstances, it should be the same as render view position. |
void tram::Audio::API::StopAudioSource | ( | audiosource_t | source | ) |
Stops the audio source.
void tram::Audio::API::Uninit | ( | ) |
void tram::Audio::API::Update | ( | ) |