Hey everyone
I got this little problem. When running my application, i see hickups when sounds stop playing.
When sound-sources have stopped playing, i delete them, when the "UpdateSound" routine is executed. I narrowed the whole problem down to the alDeleteSources routine.
I got this code:
[pascal]
procedure TN2D_SoundSource.Delete;
begin
if alIsSource(fSource) then
begin
BeepEx(1000,5);
alDeleteSources(1,@fSource);
BeepEx(800,5);
end;
inherited;
end;
[/pascal]
When a sound stopped playing, this delete routine is called, and the soundsource will be destroyed. As you can see, i added 2 beeps in this routine. This way, i could easily check how long it takes to execute alDeleteSources.
Sometimes it just takes some miliseconds, and the two beeps are both played in a short period of time. But sometimes, it takes up to a second, before the game continues to execute.
Is this normal, or is there a sollution available?? Should i save up those stopped sounds, and delete 10 of them with a single call? Should i reuse the soundsources by changing their soundbuffers?
I know some of you guys have experience with OpenAL. Can someone give me a good hint on this?
Thanx a bunch
Bookmarks