0

I'm trying to put a sound file into a flash program with the following code.

[Embed(source="../lib/DST-Aircord.mp3")]
static var sndtrck:Class; //used to represent the background music file
static var soundtrack:Sound; //used to handle the soundtrack file

soundtrack = new Sound();
soundtrack.load(sndtrck);
soundtrack.play();

I'm not sure that this is correct but it is throwing the following errors.

Error: Unsupported sampling rate (32000Hz)
Error: Unable to transcode ../lib/DST-Aircode.mp3.

Regarding the first error I checked in iTunes and the sampling rate is 44100Hz which I believe is what Flash needs to run. However FlashDevelop is incorrectly determining the sampling rate? I'm guessing that the second error is caused by the first although I'm not entirely sure what it means. Does anyone know what I might be missing in my attempt to embed sound into this SWF?

EDIT: changing the load function to use the path specified in the embed code yields the same error.

avorum
  • 2,243
  • 10
  • 39
  • 49

2 Answers2

0

the load function of the Sound class only takes a URL of an external sound file. Im not sure what the class your putting into it is, but it probably throws the errors because a Class itself is not a sound file. This is a link to the load() function of the Sound class, everything about it is there.

Xiler
  • 426
  • 4
  • 13
0

While writing this answer I realized that the question is pretty old. ;) Anyhow, I ran into the same problem a while back and it could be solved by this: Unsupported sampling flex/actionscript

Community
  • 1
  • 1
obscure
  • 11,916
  • 2
  • 17
  • 36