Remixing/ Encoding Mp3 sounds for Flash

Monkey Targets Forums/Flash/Remixing/ Encoding Mp3 sounds for Flash

Xyle(Posted 2015) [#1]
Ugghhhh,

After reading through every thing and trying out everything, I finally found what worked for me.

My original files were .au sound files I used fine in my Java Applets.

Now that Oracle F**Ked up my Applets by requiring signed certs with Java8, I am rewritting my little buddies in MonkeyX for multiple portings.

In this process I converted the .au files to .wav and they work great in html5 and glfw. I then got the flash target setup and ported to that without a hitch, but I noticed that the sound wasn't working. I looked around and seen that you can only use mp3 with Flash, so I said no biggie, using Audacity, I exported the sounds to mp3.

When I get the Monkey error saying unsupported sampling rate (8000hz), I said to myself, WTF does that mean?

I read some more and someone on the MonkeyX forums stated something about rates in multiples of 11. I read further and found this on StackExchange...

"Flash can import either 8- or 16-bit sounds at sample rates of 11, 22, or 44 kHz. Sounds recorded in formats that are not multiples of 11 kHz (such as 8, 32, or 96 kHz) are resampled when imported into Flash. Flash can convert sounds to lower sample rates on export."

Flex Builder will not do it for you so you need to downsample the "music.mp3" file to 22kHz manually before using it.

Edit: I can't find proper documentation but here it says:

"Sound Sample Rate - measured in Hz, this is fixed when the sound file is first recorded, and Flash .SWF files only allow four rates.

The Flash SWF format has sampling rates of:

5500 Hz

11025 Hz

22050 Hz

44100 Hz (preferred setting)"

So after converting all my 8000hz .wav files to 44100hz .mp3 files, I still got the unsupported (8000hz) error in the flash build.

Looking at the files further, I noticed they were mono. I edited them as .wav and created a new stereo track, copied the mono track down then deleted it and exported the .wav file which now has the settings of 44100, 16bit PCM which I exported to mp3 as 128bit rate files.

Now the sound worked, but the files are so tweaked, they sound nothing like the originals, lol.

Just thought I would share that little experience in hoping it would save someone the few hours I spent downloading and trying different encoders and reading stuff!


Xyle(Posted 2015) [#2]
After tweaking the speed down of each sound file, I got them to play and sound as good as the originals!

It was a success!