Advertisement

OGG Problem

Started by December 11, 2004 06:00 PM
1 comment, last by Kibble 20 years, 2 months ago
I have worked out an OGG Player. I am having one problem that can cause a bit of pain in the end. I am looping the OGG file. if I dont loop it ... it stops a second early ... moreover ... there is a slight lag when it starts looping. Any advice / help / hint will be really appreciated. Thanks
blender's game engine has this problem as well. too bad not many coders for the engine :/
Advertisement
Its because you are probably reading the ogg 1 second ahead (as you should be reading ahead to prevent skipping), when you hit the end of the stream decoding, you stop playing the sound, thus the last 1 second of the song doesn't get played. To fix this try to set whatever library you are using so the sound doesn't loop, and just don't stop it. Let it play to the end.

To fix the looping, make it so the sound library you are using doesn't even know your decoder looped. When you reach the end, just seek to the beginning and continue decoding, don't do anything to the sound library you are using.

This topic is closed to new replies.

Advertisement