finite_audio_device_init
The finite_audio_device_initattempts to create a new FinitePlaybackDevice
bool finite_audio_device_init()Parameters
Section titled “Parameters”| Type | Description |
|---|---|
FinitePlaybackDevice *dev | The FinitePlaybackDevice to attach the audio to. |
char* audio | The path to the audio file |
| `bool autocreate | Determines if this function should attempt to grab the hardware params for the audio before attaching it. |
Code Example
Section titled “Code Example” #include <finite/audio.h> #include <finite/log.h>
FinitePlaybackDevice *dev = finite_audio_device_init(); char *jingle = "jingle2.mp3";
finite_audio_get_audio_params(jingle, dev); // print out the audio duration finite_audio_get_audio_duration(dev);
// use params to init audio finite_audio_init_audio(dev, jingle, false);
// audio is made so now play
finite_audio_play(dev); FINITE_LOG("Done\n"); // clean up when finished finite_audio_cleanup(dev);As of v0..0 FinitePlaybackDevice is not attached to a window. That is subject to change.
Standard Usage
Section titled “Standard Usage”This function should be created once for a single audio. Do not reuse FinitePlaybackDevices .