1al_set_sample(3) Library Functions Manual al_set_sample(3)
2
3
4
6 al_set_sample
7
9 #include <allegro5/allegro_audio.h>
10
11 bool al_set_sample(ALLEGRO_SAMPLE_INSTANCE *spl, ALLEGRO_SAMPLE *data)
12
14 Change the sample data that a sample instance plays. This can be quite
15 an involved process.
16
17 First, the sample is stopped if it is not already.
18
19 Next, if data is NULL, the sample is detached from its parent (if any).
20
21 If data is not NULL, the sample may be detached and reattached to its
22 parent (if any). This is not necessary if the old sample data and new
23 sample data have the same frequency, depth and channel configuration.
24 Reattaching may not always succeed.
25
26 On success, the sample remains stopped. The playback position and loop
27 end points are reset to their default values. The loop mode remains
28 unchanged.
29
30 Returns true on success, false on failure. On failure, the sample will
31 be stopped and detached from its parent.
32
33
34
35Allegro reference manual al_set_sample(3)