简体   繁体   English

Flex AIR从本地磁盘播放AAC音频文件

[英]Flex AIR play AAC audio file from local disk

I would like to play AAC audio format file from local disk. 我想从本地磁盘播放AAC音频格式文件。 I got example to play through netstreaming but I need to play it from local disk. 我有通过netstreaming播放的示例,但是我需要从本地磁盘播放它。 I got an example to play mp3 file from local disk using Sound class. 我有一个使用Sound类从本地磁盘播放mp3文件的示例。

For reference: http://www.adobe.com/devnet/flashmediaserver/articles/audio_playlist_app_05.html 供参考: http : //www.adobe.com/devnet/flashmediaserver/articles/audio_playlist_app_05.html

Here's an example: 这是一个例子:

<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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM