al_create_voice
ALLEGRO_VOICE *al_create_voice(unsigned int freq,
ALLEGRO_AUDIO_DEPTH depth, ALLEGRO_CHANNEL_CONF chan_conf)
Introduced in 5.0.0
Creates a voice structure and allocates a voice from the digital sound driver. The passed frequency, sample format and channel configuration are used as a hint to what kind of data will be sent to the voice. However, the underlying sound driver is free to use non-matching values. For example it may be the native format of the sound hardware. If you attach a mixer to the voice, the mixer will convert from the mixer's format to the voice format and you do not have to care about this. If you access the voice directly, make sure to not rely on the parameters passed to this function, but query the returned voice for the actual settings.
See also: al_destroy_voice
Examples: ex_acodec, ex_acodec_multi, ex_kcm_direct, ex_mixer_chain, ex_mixer_pp, ex_stream_file
Most helpful discussions:
- Creating Voice, Mixer and Sample Instance (1)
- Allegro 5.2.8
- al_attach_mixer_to_voice failure
- Audio Stream: Seeking doesn't work
- Audio waveform with unexpected frequency behavior
- Calling al_install_audio from a DLL?
- Audio seems overly complicated :(
- Cannot create an ALLEGRO_VOICE object in Allegro5
- Font loading crashing with Allegro 5.2
- Delay when playing a sound effect using "al_play_sample"
Other recent discussions:
- al_create_voice() fails
- Streaming Multiple Audio Files At Once
- [A5.0.10] - High CPU usage after al_attach_mixer_to_voice
- Possible inconsistency in the behavior of al_set_sample_instance_playing() ?
- Possible thread deadlock/hang in al_detach_voice() ?
- [A5] Repeating audio samples
- (A5) random crash on al_detach_voice()
- [Allegro 5] Multiple Audio Questions
- Looping MOD music
- [5.0.5] Crash when trying to play the second instance of sound.