我想从本地磁盘播放AAC音频格式文件。我得到了通过网络流播放的例子,但我需要从本地磁盘播放它。我有一个例子,使用Sound类从本地磁盘播放mp3文件。
供参考: http://www.adobe.com/devnet/flashmediaserver/articles/audio_playlist_app_05.html
答案 0 :(得分:0)
以下是一个例子:
<fx:Script>
[Bindable]
public var aacUrl:String = "http://amp-mp3.s3.amazonaws.com/48c30f3b-e1ed-4f04-a58b-4806fcc27416?Expires=1602460800&AWSAccessKeyId=AKIAJU2DNJUS3E3D36BA&Signature=h6HUy35V1QOi56fm9kakaCRjma4%3D";
protected function playButton_clickHandler(event:MouseEvent):void
{
videoPlayer.play();
}
</fx:Script>
<s:VGroup>
<s:VideoPlayer id="videoPlayer" height="200" width="300" source="{aacUrl}" autoPlay="false"/>
<s:HGroup width="100%">
<s:Label text="URL:" />
<s:TextInput id="mediaUrlTextInput" width="100%" text="@{aacUrl}" />
<s:Button id="playButton" label="Play" click="playButton_clickHandler(event)" />
</s:HGroup>
</s:VGroup>