Player freezes after playing multiple MP3 files
Posted: Sat Sep 27, 2025 10:00 am
Message:
Hi everyone,
I’m working on a project where I need to play a series of mp3 files, which I call "clips", every few seconds through a single player object (“c2”). This repeats more than 100 times in sessions of about 5–6 minutes.
At first everything works fine, but when the session ends, or if I interrupt it after one or two minutes, the app freezes when I try to play or activate the player again. If I stop earlier, sometimes it doesn’t freeze.
I suspect the problem is that the player gets saturated because of the number of times I assign and release files (set the filename) in such a short time. As an alternative, I tried combining all the clips into one long file, marking start and end positions for each fragment and jumping to them as needed. However, the same issue occurs after a while.
I also tried different ways to “refresh” the player, for example:
and some variations, but I haven’t found a stable solution.
I also tried a ping-pong approach with two players, alternating between them so that while one was playing the other could be prepared with the next clip. I haven’t tested it thoroughly, but the problem seemed to persist.
Has anyone experienced this situation or found a reliable way to avoid these freezes when working with a single player in these conditions?
Environment:
• LiveCode version 9
• iMac with macOS Ventura
• Using mp3 files (switching to WAV is not an option for me)
Thanks in advance for any suggestions or ideas!
Hi everyone,
I’m working on a project where I need to play a series of mp3 files, which I call "clips", every few seconds through a single player object (“c2”). This repeats more than 100 times in sessions of about 5–6 minutes.
At first everything works fine, but when the session ends, or if I interrupt it after one or two minutes, the app freezes when I try to play or activate the player again. If I stop earlier, sometimes it doesn’t freeze.
I suspect the problem is that the player gets saturated because of the number of times I assign and release files (set the filename) in such a short time. As an alternative, I tried combining all the clips into one long file, marking start and end positions for each fragment and jumping to them as needed. However, the same issue occurs after a while.
I also tried different ways to “refresh” the player, for example:
Code: Select all
stop player "c2"
set the currentTime of player "c2" to 0
set the filename of player "c2" to empty
wait 50 milliseconds with messages
I also tried a ping-pong approach with two players, alternating between them so that while one was playing the other could be prepared with the next clip. I haven’t tested it thoroughly, but the problem seemed to persist.
Has anyone experienced this situation or found a reliable way to avoid these freezes when working with a single player in these conditions?
Environment:
• LiveCode version 9
• iMac with macOS Ventura
• Using mp3 files (switching to WAV is not an option for me)
Thanks in advance for any suggestions or ideas!