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)
- Bitmap behind mappy map
- Audio addon: pause sample
- How to get raw sample frequencies
- [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)
Other recent discussions:
- 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() ?
- [A5] Repeating audio samples
- Sample Instances and Mixers
- My game bugs out when in release mode?
- Help shooting left and right.
- Enemies disappear with out any collision
- This f***ing enemy won't move!