Title:Class Sound
标题:Sound类
前半部分是我翻译AS内容起步,翻译的不好望各位海涵啊
今天把官方的语法帮助翻译一下,帮助自己学习
Class Sound
Sound类
封装包 flash.media
类 全局Sound类(不知道咋翻译了)
继承 Sound -> EventDispatcher ->Object
子类 SoundAsset
Sound类能使你在程序中使用声音,Sound类能让你创建一个新的声音对象,在这个对象中载入和播放外部的mp3文件(还是只有mp3啊),关闭声音流,并访问声音信息,如声音流的大小以及ID3信息.有关控制声音的更多细节请参考Soundchannel对象与Microphone对象,这些对象能通过SoundTransform对象的属性来控制输出到计算机扬声器的音频信号.
要控制swf文件中的声音,使用SoundMixer类中的属性.
提醒:AS3.0的API与2.0不同,在ActionScript3.0中,您无法通过将Sound对象置于层中来控制它们的属性.
当您使用这个类时,请注意Flash Player安全沙箱:
如果swf文件处在网络沙箱内,而欲加载的声音文件是本地的,那么加载与播放将不允许
默认条件下,本地的swf文件不允许加载或播放网络中的声音.用户必须通过授权来准许访问
上述对声音的操作将受到限制.当前域中swf文件将无权读取其他域中的声音数据,但您可以制定一个跨域规则在受限区域中无效的与sound相关的API有Sound.id3,SoundMixer.computeSpectrum(), SoundMixer.bufferTime和SoundTransform对象
公用属性:
bytesLoaded:uint(16位无符号整数)
[只读]返回当前声音对象的可用字节数
bytesTotal:int
[只读]返回声音对象的总字节数
id3:id3信息
[只读]为读取mp3文件中的metadata提供访问方法
isBuffering:布尔
[只读]返回外部mp3文件的缓冲状态
length:number(数值)
[只读]以微秒表示的当前声音长度
url:String(字符串)
[只读]读取的声音来源
公用方法:
Sound(stream:URLRequest = null, context:SoundLoaderContext = null)
创建一个新的Sound对象.
close():void
关闭音频流,会导致所有的下载数据的丢弃.
load(stream:URLRequest, context:SoundLoaderContext = null):void
初始化外部mp3文件的加载.
play(startTime:Number = 0, loops:int = 0, sndTransform:SoundTransform = null):SoundChannel
生成一个新的SoundChannel对象来进行回放.
Events事件:
complete 当数据成功加载时被发送.
id3 当MP3声音的ID3数据可用时被发送.
ioError 当输入输出错误导致加载失败时被发送.
open 当加载操作开始时被发送.
progress 当加载操作正在进行且受到数据时被发送.
属性细节:
bytesLoaded 属性
bytesLoaded:uint [只读]
返回当前声音对象的可用字节数.常常只用于外部加载.
Implementation (实现)
public function get bytesLoaded():uint
bytesTotal 属性
bytesTotal:int [只读]
返回当前声音对象的总字节数.
Implementation (实现)
public function get bytesTotal():int
id3 属性
id3:ID3Info [只读]
提供访问mp3文件元数据的方法.
Mp3声音文件可包含ID3标签,ID3标签提供文件的元数据.如果一个你使用Sound.load()方法加载的mp3文件包含了ID3标签,你可以查询这些属性.只有使用UTF-8编码的ID3标签能够被支持.
Flash Player 9以及后续版本支持ID3 2.0标签,特别是2.3和2.4.下面的表格列出了标准的ID3 2.0标签与表示标签内容的格式.Sound.id3属性提供了读取这些标签的格式,如my_sound.id3.COMM,my_sound.id3.TIME等等.第一个表中描述的标签能够通过ID3 2.0的属性名和动作脚本的属性名来访问.第二张表中描述的ID3标签虽然被支持但在动作脚本中没有预先定义
ID3 2.0标签 对应的ActionScript属性
COMM Sound.id3.comment
TALB Sound.id3.album
TCON Sound.id3.genre
TIT2 Sound.id3.songName
TPE1 Sound.id3.artist
TRCK Sound.id3.track
本文转自:http://www.5uflash.com/flashjiaocheng/Flash-as3-jiaocheng/1786.html
发表评论
-
AS3生成单独“双击事件”
2010-04-10 12:06 819AS3虽然提供了双击事件,但在触发双击事件之前会触发一个单击 ... -
AS3生成单独“双击事件”
2010-04-10 12:06 705AS3虽然提供了双击事件,但在触发双击事件之前会触发一个单击 ... -
FMS多人连机教程:[一] 初步认识SharedObject
2010-04-10 12:06 584最近事不多,比较轻快. ... -
FMS多人连机教程:[一] 初步认识SharedObject
2010-04-10 12:06 685最近事不多,比较轻快. ... -
FMS多人连机教程:[二] 做个简单的用户注册
2010-04-10 12:05 702因为这几天要出去办点事,不能上网了.所以今天就熬夜写了个教程 ... -
AS3与XML 的结合
2010-04-09 13:35 588[1b]ActionScript 3.0系列教程(4):爽快 ... -
AS3与XML 的结合
2010-04-09 13:35 638[1b]ActionScript 3.0系列教程(4):爽快 ... -
AS3.0教程-视觉元件精要
2010-04-09 13:35 547题外话: 不少兄弟问我 ... -
AS3.0教程-视觉元件精要
2010-04-09 13:34 571题外话: 不少兄弟问我 ... -
flash游戏基本操作:上下左右的移动
2010-04-09 10:40 1570发一个按键无按钮的,按下的时候不进行帧的检测,省资源,AS3 ... -
Flash Physics Engine Box2DFlashAS3
2010-04-09 10:40 785又一个AS3 2D Physics Engine,它基于C++ ... -
Flash Physics Engine Box2DFlashAS3
2010-04-09 10:40 661又一个AS3 2D Physics Engine,它基于C++ ... -
Flex: Animated Skins
2010-04-09 10:39 716Tink 写了一个动画皮肤的例子,很好玩。几个截图: 禁用的时 ... -
Flex: Animated Skins
2010-04-09 10:39 628Tink 写了一个动画皮肤的例子,很好玩。几个截图: 禁用的时 ... -
《漫步》flash动画制作全记录五
2010-04-08 10:58 679场景五的黄昏场景是一 ... -
《漫步》flash动画制作全记录五
2010-04-08 10:57 451场景五的黄昏场景是一 ... -
《漫步》flash动画制作全记录六
2010-04-08 10:57 746没想到写制作记录会这么复杂,制作那些图片真花时间,呵呵,不过终 ... -
《漫步》flash动画制作全记录六
2010-04-08 10:57 657没想到写制作记录会这么复杂,制作那些图片真花时间,呵呵,不过终 ... -
flash动画形变讨论二:低头
2010-04-08 09:10 514上次说了基本的形变,现在说下提示点,提示点是控制图形变化的基本 ... -
卡通娃娃360度转身动画
2010-04-08 09:10 485超人表情原创大赛正如火如荼的进行中,对于初哥可能就望钱兴叹了, ...
相关推荐
AS 3.0 Sound类应用实例详解....
XMLLoader.as ---------------------- 加载xml的类 xmlToArray.as ---------------------- xml转换Array util: ArrayUtil.as ---------------------- 数组辅助功能 setFrameout.as ---------------------- ...
利用windows的API to record sound in wav format.
//文本提示:动态文本框 ts_txt //"非你莫属.mp3 和fla在同一目录,如果不在同一目录要使用完整的绝对路径。 var s:Sound = new Sound() var req:URLRequest=new URLRequest("非你莫属.mp3")
在线演示地址:http://cls.xn--scsx2rbnc.com/demo/SoundSpectrum1.html 来自潮汕IT男网:http://chenlinsheng.com/?p=1047
Chapters 1 to 3 dealing with sound propagation in solids and fluid and Chapter 9 dealing with the modelling of perforated facings were slightly modified. Chapters 4 to 6 were greatly revisited. A more...
sound components are used in many ways such as home appliances, OA equipment, audio equipment telephones, etc. And they are applied widely, for example, in alarms, speakers, telephone ringers, ...
Flash as2.0代码大全与Flash制作技巧 2009-08-04 12:46 Flash as2.0代码大全与Flash制作技巧 外部调用swf on (release) { loadMovieNum("service.swf", 1); } 外部调用数据 loadVariablesNum("about.txt", 0); ...
The Fiber Vibration Sound Absorption Theory ,Zhang Xin’an,,Fibrous materials had been used as sound absorption materials for over one century .The current sound absorption theory is still the ...
William Turner and Steve Leonard showcase the basics of JavaScript language programing so that readers can learn how to build browser based audio applications, such as music synthesizers and drum ...
SoundTouch在AndroidStudio中的开发模版,可以省去将库引用到AS中的麻烦
AA Sound Meter is a revison of Sound Meter. It displays sound in various diffrent forms such as diffrent peak displays and a visual equalisers.
BlueSound Android application to redirect audio to Bluetooth headset....THIS APP IS FREE AS IN BEER!!!! No atribution, no nothing. Public Domain. Do what ever you want with it, I do not care.
This paper describes sound source localization (SSL) based on deep neural networks (DNNs) using discriminative training. A na¨ıve DNNs for SSL can be configured as follows. Input is the frequency-...
基于官方最新的2.1.2 的源码产生可运行的APP 基于官方最新的2.1.2 的源码产生可运行的APP 基于官方最新的2.1.2 的源码产生可运行的APP 基于官方最新的2.1.2 的源码产生可运行的APP
var tar:Sound = event.target as Sound; id3_txt.text = "歌名:" + tar.id3.songName + "\n" + "歌手:" + tar.id3.artist + "\n" + "专辑:" + tar.id3.album; } ///////////////////////////////////////...
程序中运用到了动态绘制波形图的类Graphics类,以及URLRequest类来播放声音,还有Sound、SoundChannel、SoundMixer等类,test.mp3文件自备,相信对大家有帮助
Dolby Atmos for Sound Bar Products System Development Kit and is intended to be used as guidance in designing the digital signal processing Dolby Atmos sound bar products that include home theater ...
开发商:3Planesoft 语言:英语 平台:Windows(完全兼容Vista) 最低系统要求:WinXP,Vista系统,800 MHz处理器,支持DirectX 8或更高 3Planesoft是享誉世界的屏保程序。 Contents of the collection: ...