To avoid a slight pause before playing an mp3 file I'm doing this:
1. Create sound channel
2. Pause sound channel
3. Unpause sound channel when the mp3 needs playing
Even though the channel is in memory, there is still a pause before the sound starts playing (the game freezes for a short while).
Is there a way of playing an mp3 file without freezing the game?
Comments
This has removed the issue, but the mp3 now fails to play seemingly randomly:
1. Create sound channel
2. Keep playing sound channel, set volume to 0
3. Set volume to 1 when the mp3 needs playing
I'm using less than 32 channels, so any ideas why this method wouldn't work would be warmly received.
There is a strange bug (I have to call it a bug because it needs to be fixed) where after playing the mp3 once, it just stops and does not loop. The only solution is to have an event listener that waits for the end of the song, and then restarts it. This is what (for me) causes the horrible gaps in playing.
So I'm wondering if your issue might be caused by the mp3 reaching the end and then not looping, so when you set the volume to 1, it seems as if it has not played at all. I hope that makes sense
Likes: totebo, antix
https://deluxepixel.com
@sinistersoft, if opensl would solve this, or reduce the time it takes to play an mp3, I am very much for it.
@totebo, interesting. If there was some way to tell how long the delay would be.. then you could time the creation of the new sound channel, hmm.
So does creating a new sound channel perform better than just restarting it and creating a new event listener?
This is fast on Android, still laggy on iOS. May need to have a special case for iOS.
Likes: antix
I think sound in Gideros really needs a bit of attention.
Likes: SinisterSoft, totebo
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!