Unsupported flex / actionscript fetch

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")] 

Code

  <?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> 
+4
source share
2 answers

From livedocs :

"Flash can import 8- or 16-bit sounds with a sampling frequency of 11, 22 or 44 kHz. Sounds recorded in formats that are not a multiple of 11 kHz (for example, 8, 32 or 96 kHz) are reprogrammed when imported into Flash. Flash can Convert sounds to reduce sample rates when exporting. "

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

Edit: I cannot find the correct documentation, but it says here :

"Sound sampling rate - measured in Hz, this is recorded when the sound file is recorded for the first time, and Flash.SWF files allow only four speeds.

Flash SWF format has a sampling rate:

5500 Hz

11025 Hz

22050 Hz

44100 Hz (preferred setting) "

+9
source

You can remove the ID3v2 tag and it should work. I think this is APIC. So anyone who encounters problems embedding MP3 files downloads ID3 Remover: http://sourceforge.net/projects/id3remover/files/id3remover/v1.2/ID3Remover_1_2.zip/download .

0
source

Source: https://habr.com/ru/post/1335531/


All Articles