Unsupported smapling rate in flex/actionscript

Posted by Rajeev on Stack Overflow See other posts from Stack Overflow or by Rajeev
Published on 2011-01-14T10:56:53Z Indexed on 2011/01/14 11:53 UTC
Read the original article Hit count: 265

Filed under:
|
|
|

In action script i need

  Loading configuration file /opt/flex/frameworks/flex-config.xml
  t3.mxml(10): Error: unsupported sampling rate (24000Hz)

        [Embed(source="music.mp3")]

     t3.mxml(10): Error: Unable to transcode music.mp3.

        [Embed(source="music.mp3")]

The code is

         <?xml version="1.0"?>
   <!-- embed/EmbedSound.mxml -->
  <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

  <mx:Script>
    <![CDATA[

        import flash.media.*; 

        [Embed(source="sample.mp3")]
        [Bindable]
        public var sndCls:Class;

        public var snd:Sound = new sndCls() as Sound; 
        public var sndChannel:SoundChannel;

        public function playSound():void {
            sndChannel=snd.play();
        }   

        public function stopSound():void {
            sndChannel.stop();
        }   
    ]]>
</mx:Script>

<mx:HBox>
    <mx:Button label="play" click="playSound();"/>
    <mx:Button label="stop" click="stopSound();"/>
</mx:HBox>
</mx:Application>

© Stack Overflow or respective owner

Related posts about flex

Related posts about actionscript-3