我不知道动作脚本如何获得所有发言者的名字,动作脚本如何做到这一点?
我知道actionscript可以使用Microsoft.names
获取麦克风名称列表但如何为发言人做什么?
像skype一样,它可以指定响铃的音箱,但是动作脚本如何实现相同的功能答案 0 :(得分:0)
我假设你的意思是左右扬声器?如果是这种情况,请使用SoundTransform
类和pan
属性:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/SoundTransform.html
使用值-1.0
表示您的声音将播放左扬声器,而值1.0
表示您的声音将从右扬声器播放。这就是Skype从我所知道的事情。
// create our sound and play it, storing the SoundChannel created
var sound:Sound = new Sound( new URLRequest( "../assets/myMusic.mp3" ) );
var channel:SoundChannel = sound.play( 0, 10 ); // loops 10 times
// create our SoundTransform object
var st:SoundTransform = new SoundTransform( 1.0, 0.0 );
// add a stage listener for mouse click - we'll take the x position of the click
// and use it to set the pan
this.stage.addEventListener( MouseEvent.CLICK, function( e:MouseEvent ):void
{
// sets the pan between -1.0 and 1.0 depending on where on the stage
// important - we need to set the soundTransform property on the
// SoundChannel for our change to take effect
st.pan = -1.0 + ( e.stageX / stage.stageWidth ) * 2.0;
channel.soundTransform = st;
trace( "Set the pan to " + st.pan );
});