Expand my Community achievements bar.

SOLVED

AudioPublisher not working properly (Mac)

Avatar

Level 2

Hello,

I have spent extensive time searching through the forum to find a fix to my problem.

Quite simply I am trying to add audio to my currently stable video chat client, but rather than posting my complete code I will start with something simple.

When I use AudioPublisher and AudioSubscriber in my application I can not get my 3rd party mic to be used properly. I am running 2 instances of the application, so I know that isn't the problem.

I have placed a "connect" button on stage so that I can control when the AudioPublisher is active. Prior to clicking this connect button, if I right click the stage and choose settings, then click the microphone tab, I can see my USB mic in the list and the volume meter shows activity when I speak into the mic.

If I then click the connect button so the AudioPublisher begins publishing my mic and follow the same procedure (right click stage, click the microphone tab, speak into mic) I get no audio registering on the meter. Of course this also means I'm not getting any audio throughput within my application either, which is what led me to this post.

I stripped all of my code back to the bare essentials to see if there was anything I was introducing to the equation that was causing this problem, but alas I have it as simple as I can and it is still not working for me. Interestingly enough I tried to implement this same activity with AS3 (without using AFCS SWC) using media.Microphone and I am getting audio throughput without any issues. Granted this isn't leveraging the LCCS, but it seemed a valid test none the less.

I have attached my code below, and any help would be appreciated.

Thank you,

Sample Code Used in Test
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="absolute" xmlns:rtc="AfcsNameSpace">
    <mx:Script>
        <![CDATA[
           
            // Used to handle Button state change
            private function onBtnClick(event:MouseEvent):void
            {
                trace(cSession.userManager.userCollection.length);
                if ( event.currentTarget.label == "Connect" ) {
                    audioPub.publish();
                    event.currentTarget.label = "Disconnect" ;
                }else if (event.currentTarget.label == "Disconnect" ){
                    audioPub.stop();
                    event.currentTarget.label = "Connect" ;
                }
            }
        ]]>
       
    </mx:Script>
    <rtc:AdobeHSAuthenticator id="auth"    userName="my-user-name" password="my-password"/>
    <rtc:ConnectSessionContainer id="cSession" authenticator="{auth}" roomURL="MY ROOM URL" width="100%" height="100%" >
    <mx:VBox width="100%" height="100%" horizontalAlign="center">
        <rtc:AudioPublisher id="audioPub" height="0" />
        <rtc:AudioSubscriber id="audioSub" height="0" />
        <mx:Button label="Connect" toggle="true" id="camButt"
            click="onBtnClick(event)"
            fontFamily="Verdana" color="#FFFFFF" fontSize="25" textAlign="center"
            width="200" height="75" cornerRadius="20"/>
    </mx:VBox>
    </rtc:ConnectSessionContainer>
</mx:Application>
1 Accepted Solution

Avatar

Correct answer by
Level 4

What about getting an instance of MicrophoneManager and setting it's

micindex to the index of your 3rd party Mic first. Then create the

audiopublisher and start publishing. In the audiopublisher code it looks

like they get the mic using a MicrophoneManager.getInstance call so it's

probably the same object you'd be working with. Just a thought if you're

out of things to try. I could be way off base.

-Eric

View solution in original post

6 Replies

Avatar

Employee

Hi,

I verified your code, on my mac machine. There seems to be a problem with Player 9 swc, as your code worked fine with player 10 swc. So for a short-term fix I would recommend you to use player 10 swc.

As mentioned above this problem seems to be isolated just to the mac - flash player 9. Our team is investigating into this issue and would inform you once we have a update.

Thanks

Arun

Avatar

Former Community Member

I would like to add, we did lot of mac-windows testing and for win , it always works fine.

Also, the problem only seems to happen for MAC external mics as you said.

Firstly, verify your app with player 10 swc and tell us whether you can reproduce the problem. Also verify if you have any win machine if you this problem on win.

For better audio quality in general, I would recommend you to use player 10 swc.

Regarding this issue, we will do some further investigation based on your feedback.

Thanks

Regards

Hironmay Basu

Avatar

Level 2

Interestingly enough I had been using the Player 10 SWC from the beginning because I had the intention of using the RTMFP protocol to enable P2P chat when available, so for some reason even using Player 10 I am having no success with this external mic. It is possible I am doing something incorrect in my project configuration, but I don't think that is the case.

When I deploy my app to our target device which runs an embedded Windows OS the audio is properly transmitted when using a 3rd party mic, leading me to believe this is a Flash - Mac issue as stated. I believe I will be able to work around this in the interim, but a long term solution would be extremely helpful as our host platform will likely be variable.

I am a new Flex user, and straight away I've jumped into using the AFCS package. I must say it is incredibly comprehensive and very well implemented. I hope the performance improvements for embedded devices in Player 10.1 will quickly make their way into this library as they are released, or better yet the Player 10 source so we can poke at prod at what's under the hood.

Thank you for the quick response.

Avatar

Correct answer by
Level 4

What about getting an instance of MicrophoneManager and setting it's

micindex to the index of your 3rd party Mic first. Then create the

audiopublisher and start publishing. In the audiopublisher code it looks

like they get the mic using a MicrophoneManager.getInstance call so it's

probably the same object you'd be working with. Just a thought if you're

out of things to try. I could be way off base.

-Eric

Avatar

Level 2

Amazing suggestion. This appears to have resolved the issue on my Mac and not introduced any further issues on the PC. I'm running with this solution for now!

Thanks very much!