开发者

How to enable Speex codec on microphone object in Flex 4?

From what I have read, using Speek over Nellymoser is advantageous, but I can't figure out how to use it with a Flex 4 Microphone object.

For instance, the last code line:

private var oMicrophone:Microphone;    
oMicrophone = Microphone.getMicrophone ();
oMicrophone.codec = "Speex"
oMicrophone.encodeQual开发者_JS百科ity (8)

Gives me this compile error:

Attempted access of inaccessible method encodeQuality through a reference with static type flash.media:Microphone

I am not impressed with Adobe's documentation on this.

Guess I either need to import something or include some extra module that doesn't come with the Flex SDK - or...?


The encodeQuality is a property, not a method. To use it, just assign a value to it:

private var oMicrophone:Microphone;    
oMicrophone = Microphone.getMicrophone ();
oMicrophone.codec = SoundCodec.SPEEX //Use an enumerator class
oMicrophone.encodeQuality = 8;

That seems to take care of it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜