Mp3's wont play

Monkey Targets Forums/Flash/Mp3's wont play

slenkar(Posted 2011) [#1]
do mp3's have to be a certain sample rate to play?

could someone upload an mp3 that does play to mediafire or another file sharing website?


Foppy(Posted 2011) [#2]
I don't know about the sample rate but this sound works in my game:

http://www.foppygames.nl/Temp/bounce.mp3


slenkar(Posted 2011) [#3]
thanks , i cant seem to get that mp3 to play in winamp, but my mp3s work in winamp


Foppy(Posted 2011) [#4]
I am converting WAVs to MP3 now using Audacity. Upon compiling (Flash target) Monkey tells me the sample rate is not supported. I tried a few different sample rates but so far no luck. Did anyone else run into this?

(Or maybe someone has advice about a good way of converting WAV to MP3?)


dave.h(Posted 2011) [#5]
I did but when i changed the sample rate everthing was ok.also if i remember correctly i had to download another file to get mp3 working correctly cant remember what offhand sorry


Foppy(Posted 2011) [#6]
I will also try some more settings and sample rates! For my previous game I used a different wav to mp3 program, so I will try that too and post here if it works.


siread(Posted 2011) [#7]
One of my samples wasn't playing and it was driving me mad. Then I realised I had typed .MP3 not .mp3.


slenkar(Posted 2011) [#8]
only sample rates that are multiples of 11khz work,
you can convert with a program called razorlame

strangely though you have to convert from wav to mp3 with razorlame or the changes wont show up in the file
maybe razorlame doesnt change the tags


Paul - Taiphoz(Posted 2012) [#9]
I am having trouble with this as well, Flash will not play mp3's with my project.

Whats even more bizzare is that when I copy one of the example code mp3 files from the audio test example into my own project and try and play that, it does not play, but if I build the auto test it does play.

Something fishy going on here for sure, cant tell why typing play sound in my project is any different from that of the audio test example.


Paul - Taiphoz(Posted 2012) [#10]
If ChannelState(ClickChannel)=0 Then PlaySound(Self.Click,ClickChannel,0)


This is really odd now, all other sound formats in the other targets I have tried, html5, xna,glfw all work.

but flash is being a pain in the but.


Paul - Taiphoz(Posted 2012) [#11]
Never mind, read that it's the channel's flash does not like.

I actually came up with a solution to this a while ago after reading about the issue and then forgot all about it lol.

My solution in case anyone was interested was to create a timer , and as I play each sound, I start that sounds timer, if I try and play the sound again I first check to see if the timer is > sounds length, if so play the sound and reset the timer, if not do nothing.

probably not perfect just it works.


Psychosanity(Posted 2012) [#12]
My problem is that Flash is not playing my .ogg's

Edit----
ok read the documentation better. still can't get mp3's playing though