i have a problem wih playmusic instruction, in android is not possible to know if the song is finished, i have problems with IsMusicPlaying also, in android if you start the music the result ever is True, under windows work fine.
Under windows and android the song length is around 17 seconds more that the real length (17 seconds of blank space), and i need do this to
solve the problem:
dura = GetAttribute(#MUSIC, 100, #ATTRDURATION)
posi = GetAttribute(#MUSIC, 100, #ATTRPOSITION)
plyn = GetAttribute(#MUSIC, 100, #ATTRPLAYING)
dura2=dura-17000
If posi>dura2
StopMusic(100)
musica=0
EndIf
.....
That´s a bug? i´m doing something bad?
Playmusic and sound length problems
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Playmusic and sound length problems
What format is the music in? MP3? Protracker? WAV? etc.
-
- Posts: 267
- Joined: Fri Feb 24, 2012 9:34 am
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Playmusic and sound length problems
Please provide the MP3 so that I can check.
-
- Posts: 267
- Joined: Fri Feb 24, 2012 9:34 am
Re: Playmusic and sound length problems
i have the same problem with evey mp3 song here
- airsoftsoftwair
- Posts: 5446
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Playmusic and sound length problems
Sorry, can't reproduce the problem here. For a random test MP3 which is 3 minutes and 4 seconds, #ATTRDURATION returns 184345 when using avcodec.hwp on Windows and 184346 when using DirectShow for MP3 streaming. Both results are very precise and they definitely aren't off by 17 seconds. Also, IsMusicPlaying() on Android returns 0 as soon as the MP3 has finished playing.
If it doesn't work for you, please provide a full test script including data files.
If it doesn't work for you, please provide a full test script including data files.