-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Popping with audio streams when doing stop, seek, play #1310
Comments
The pop does sound like part of the previously played segment (it changes sound after different segments are played). |
The stream is created like this:
|
I found some time to look into it. I couldn't reproduce the pops with my audio files, but I did notice something odd. Calling
These things I can probably fix, and maybe adding the |
Thanks for looking into this. I'll try and setup a minimal test for you to reproduce it. Because of this issue and other annoyances of Allegro audio, I have been writing my own high-level sound API. With that code this sort of segmented playback is working without any artifacts on Ogg streams. I'll leave a comment here when I publish my code. |
There's a stand alone test in an archive at http://xu4.sourceforge.net/download/segment_test.tar.gz The segment is stopped in |
Thanks, this was extremely useful. The issue turned out to be that we were calling I'll switch the code to use |
The problem on my side is that the segment duration values include the one second of padding. So having more silence wouldn't have eliminated the bad audio. With my audio API I just noticed this problem because the unwanted audio is heard at the end of a segment (as would be expected). Perhaps this is not happening with Allegro because of the incorrect (future) |
The initial version of my audio library, Faun, is now at https://github.com/WickedSmoke/faun and may be of interest to Allegro users looking for a simpler API for playing sounds. The faun_playStreamPart() function implements what I was trying accomplish when I ran across this Allegro issue. |
The old one did cross-fades, causing unexpected behavior in certain cases. Fixes liballeg#1310
That looks nice, I like the name. I made a pull request for Allegro to fix this and the other issue, and with them, the static void playSegment(ALLEGRO_AUDIO_STREAM* stream, const float* segment) {
float start = segment[1];
float end = start + segment[0];
al_set_audio_stream_loop_secs(stream, start, end);
if (al_seek_audio_stream_secs(stream, start)) {
al_set_audio_stream_playing(stream, 1);
}
} |
Something like:
but this does not pop:
The text was updated successfully, but these errors were encountered: