Jim, I'm really not meaning to be cheeky but...play some music! Lol. I'll try the help example that comes with the command the the AppGameKit file, see if that does it, but it's odd both my android devices fail to loop the music as that kinds removes the implication that it's my codecs.
Anyway, I've done some testing, and even if I encode the music as .ac4 or .wav I still get the error, and still saying it can't load the MP3 filter. Oddly, it also seems to only happen when sounds are playing at the same time.
EDIT: Well, the built in example works fine, as does it with my own music track so it's neither my codecs nor the MP3....which leaves my code. I play the music before the main loop with
then once every loop I perform the check
if getmusicplaying()=0 then playmusic(1,0)
I've tried this at the end of the loop, at the start of the loop, directly before the sync, directly after the sync - always failing to load the mp3 filter on it's second play. I even tried altering the example file file to play the same sounds over the music in case it was that, it's still not having an issue. The sounds are handled by a separate function as follows:
function soundvolumes()
if bird1timer=0 then bird1timer=random(50,500)
if bird2timer=0 then bird2timer=random(50,500)
if bird3timer=0 then bird3timer=random(50,500)
if oceansounds>0
if getsoundsplaying(4)=0 then playsound(4,7,1)
else
stopsound(4)
endif
if windsounds>0
if getsoundsplaying(5)=0 then playsound(5,30,1)
else
stopsound(5)
endif
if birdsounds>0
bird1timer=bird1timer-1
bird2timer=bird2timer-1
bird3timer=bird3timer-1
if getsoundsplaying(1)=0 and bird1timer<2 then playsound(1,3,0,0)
if getsoundsplaying(2)=0 and bird2timer<2 then playsound(2,3,0,0)
if getsoundsplaying(3)=0 and bird3timer<2 then playsound(3,3,0,0)
if bird1timer=1 then bird1timer=random(50,500)
if bird2timer=1 then bird2timer=random(50,500)
if bird3timer=1 then bird3timer=random(50,500)
else
stopsound(1)
stopsound(2)
stopsound(3)
endif
endfunction
which is called again at the end of the loop, or at the beginning. Moving this function call to the start, end ,before the music check or after makes no difference. Taking it out altogether and only playing the music still produces the crash, so some other part of my code in the middle is causing a music error....but I've no idea what. There's literally no other references to sound or music as I tend to code functions for even the smallest of tasks.
Has anyone else any ideas? Tomorrow I will have to start slowly taking out the code piece by piece until I find the issue, but I can't see what it could be.
EDIT:
Ok, I've identified the problem, but not he actual problem. If I run the game then just leave it, the music works perfectly, exactly as it should. However if I so much as click in the screen, the error happens as soon as it tried to play it a second time. My game works on a map where you click to select units, or hold down the button and drag to scroll around. Either of these actions causes the error. The initial check for this is
within the loop, then within that I start a
while getpointerreleased()<>1
loop to control the scrolling. For some reason this seems to be causing the issue - even if all I do is rapidly click once and not select anything or scroll anything. This loop is just killing the music and I don't understand why - or even how to make an example to be honest!
I added, after the check for the pointer being pressed the code
repeat
sync()
until getpointerpressed()=0
However this never fixed it either. I'm not sure what I've done wrong here as everything else, sounds, functions etc all work as expected, but for some reason this input check is killing the musics ability to loop or play again - both PC and android. Any thoughts on why this loop is killing it? Even changing the while loop to a
repeat:until getpointerreleased()=1
doesn't make any difference. I'm now extremely tired and very frustrated as all I want it to do is loop one little music track for now!! Arrgghhhh!!!!!!!!!!!!!!