Home | Features | Roadmap | Learn | Documentation | ||
Latest version: Tramway SDK 0.0.9 Github Quick links Home Get Started |
Audio ComponentThis EntityComponent is a wrapper for audio sources. Pass in the sound which it needs to play, the position of the audio source and it will play it. Very easy. Very simple. Programming in C++
Currently sounds won't get automatically streamed in via the Async system, so make sure that the sound is already loaded before passing it to the component:
Sound::Find("my-sound")->Load();
Remember to store the Component<> smart pointer in a class, static variable, or otherwise ensure that it doesn't immediately get destructed.
Component<AudioComponent> audio;
After initialization, you can begin playback of the sound, pause it or stop it completely.
audio->Play(); // Begins the playback of the sound
You can also check the status of the playback.
// Since we stopped the playback, this will
Scripting in LuaNot yet implemented. |
|
|