Nicht unterstützte sampling-flex/actionscript
In action script ich brauche
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")]
Den 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>
Du musst angemeldet sein, um einen Kommentar abzugeben.
Vom livedocs:
Flex Builder wird es nicht tun für Sie, so müssen Sie die Neuberechnung der "Musik.mp3" Datei in 22kHz manuell, bevor Sie Sie verwenden.
Bearbeiten:
Ich kann nicht finden, die richtige Dokumentation, sondern hier es sagt:
Können Sie den ID3v2-tag, und es sollte funktionieren. Ich denke, es ist der APIC.
Also wer ist mit Problemen konfrontiert, die Einbettung von MP3-Dateien, download ID3-Entferner: http://sourceforge.net/projects/id3remover/files/id3remover/v1.2/ID3Remover_1_2.zip/download .