![]() |
|
ALLEGRO SAMPLE INSTANCE set loop start and end points |
geecab
Member #23,749
April 2023
|
Hi there! I'd like to load a 10 second audio sample and have many instances reference that same sample. I'd then like for each instance to loop a different section of the original sample when I play it back. I can't seem to find a way to set the loop start and end points of an instance. Is this possible? I read the following in the docs and felt hopeful it might be:- An ALLEGRO_SAMPLE_INSTANCE object represents a playable instance of a predefined sound effect. It holds information about how the effect should be played: These playback parameters consist of the looping mode, loop start/end points, playing position, speed, gain, pan and the playmode. Whether a sample instance is currently playing or paused is also one of its properties. Many thanks! Ben |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
Yeah, I see that's what the docs say too, but I don't see where to set the loop points or loop mode. I see a function to set sample instance length. That might control the end point, but not the beginning. You can set the sample position, but I don't think that affects the loop points. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
geecab
Member #23,749
April 2023
|
Hi and thanks for the response! I've just tried al_set_instance_position & al_set_sample_instance_length and am hearing some unexpected things. When in LOOP playback mode: When in ONCE playback mode: I'm a bit confused :p |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
It turns out this hasn't been implemented for sample instances yet. Make a feature request on github for Allegro 5 and maybe someone can add it in quick. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
|