|
Playing audio stream in loop without playmode |
archlinka
Member #17,215
December 2019
|
Hi, I would like to play audio stream in loop but without using loop playmode. What I do know is (pseudocode): I correctly got the event but the stream won't play again. Is it right approach or I do something wrong? I could destroy stream and load it again but I would like avoid unnecessary disk operations. Thanks for answers. |
Niunio
Member #1,975
March 2002
|
archlinka said: I could destroy stream and load it again but I would like avoid unnecessary disk operations. Do you know that streams don't load all the sound in to memory but loads chunks as it need it, don't you? So it is doing disk operations most of the time. Anyway, why don't you want to use loop playmode? It was created just to do what you want to do. ----------------- |
archlinka
Member #17,215
December 2019
|
Yes I know that, but still moving "pointer" to zero will be cheaper that reading file descriptor. The reason I do not want to use play mode is because I need event when the stream finish (or finish loop) but in loop playmode this event never come. |
Niunio
Member #1,975
March 2002
|
Then play in normal mode, then use al_get_audio_stream_playing to know if it finished and restart it. The other way is to write your own stream loader. ----------------- |
Edgar Reynaldo
Major Reynaldo
May 2007
|
Allegro 5 needs proper audio events. If it's not super hard, I might investigate a little. 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 |
|