我不知道actionscript如何获得所有演讲者的名字,actionscript如何做到这一点?
我知道actionscript可以通过使用Microsoft.names获取麦克风名称列表
但是对于演讲者该怎么办呢?
像skype一样,它可以指定呼叫哪个扬声器,但如何actionscript实现相同的功能
我想你是指左右扬声器?如果是这种情况,请使用SoundTransform
类和pan
属性:
使用-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 );
});