ALLEGRO_SAMPLE_INSTANCE
typedef struct ALLEGRO_SAMPLE_INSTANCE ALLEGRO_SAMPLE_INSTANCE;
Introduced in 5.0.0
An ALLEGRO_SAMPLE_INSTANCE object represents a playable instance of a predefined sound effect. It holds information pertaining to the looping mode, loop start/end points, playing position, etc. An instance uses the data from an ALLEGRO_SAMPLE object. Multiple instances may be created from the same ALLEGRO_SAMPLE. An ALLEGRO_SAMPLE must not be destroyed while there are instances which reference it.
To be played, an ALLEGRO_SAMPLE_INSTANCE object must be attached to an ALLEGRO_VOICE object, or to an ALLEGRO_MIXER object which is itself attached to an ALLEGRO_VOICE object (or to another ALLEGRO_MIXER object which is attached to an ALLEGRO_VOICE object, etc).
Examples: ex_acodec, ex_acodec_multi, ex_audio_props, ex_kcm_direct, ex_mixer_chain
Most helpful discussions:
- Successful but silent audio playback (1)
- Finding zero crossings in a sample (to eliminate clicking)
- al_attach_mixer_to_voice failure
- Sound
- Audio seems overly complicated :(
- Sample-precise audio control
- Sounds not playing repeating properly
- Bitmap behind mappy map
- Audio addon: pause sample
- How to get raw sample frequencies
Other recent discussions:
- [A5] troubles with Ogg
- Passing objects via functions
- Blank Screen
- [A5] Playing Samples on the Fly?
- Allegro needs your help!
- SAMPLE_INSTANCE vs a beginner (me)
- SpeedHack 2014 is this weekend!
- How to wait for a sample to stop playing in Allegro 5
- How to stop a sample in A5?
- Possible inconsistency in the behavior of al_set_sample_instance_playing() ?