Hi,
I'm building a simple audio/video component using the WebCamera pod and the Audio subscriber/publisher components. What I want is to publish the audio and video streams at the same time, with one action. I've try to override the startWebcam function of the WebCamera pod to publish my audio, but sometimes it works, sometimes I don't hear anything, and sometimes the sound is simply not audible (lots of noise, can't hear a word). I've also tried to publish my audio first on the creationComplete of the ConnectSessionContainer, with the same results. It seems like to many things are happening at the same time, confusion between streams, ...
What would be the best way to start audio/video stream simultaneously?
Thanks!
Matetnic
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
I am not sure why you are calling it in onStreamReceive. What you should do ideally is having components such as WebcamPublisher and WebcamSubscriber and also AudioPublisher and AudioSubscriber, something like
<rtc:WebcamPublisher id="webcamPub" />
<rtc:WebcamSubscriber webcamPublisher="" width="400" height="400" />
<rtc:AudioSubscriber id="audioSub" />
<rtc:AudioPublisher id="audioPub" />
<rtc:Button click="onClick(event)" />
Private function onClick(p_evt:MouseEvent):void
{
audioPub.publish();
webcamPub.publish();
}
And in case you are using WebCamera Class , you would have to subclass startWebcam() function of WebCamera and put the audioPub.publish() function inside it. Since you are doing these customizations, its always recommended to use WebcamPublisher and WebcamSubscriber classes instead of using the WebCamera pod class.
Lastly when you say you can't hear audio, what are you getting inside AudioPublisher's onStreamReceive on win 7 64 bit, also are you creating the stream in that function and so on. Have you tried debugging by linking to the source ?
Hope these gives you pointers to get into more details and provide to us for further investigation.
Thanks
Regards
Hironmay Basu
Views
Replies
Total Likes
Hi,
Our audio and video streams are handled separately through Audio Pub/Sub and Webcam Pub/Sub components and if you call the functions for starting audio and video at same time, there shouldn't be issues unless you have very low bandwidth and people have been using it.
If you want to start them together, in one click of a button you can call the start() function both in AudioPublisher and WebcamPublisher in the button's click handler.
Internally, both the Audio and Webcam calls the streamManager's functions such as createStream, publishStream and so on, however, you don't need to go down to that level and you should deal only at the Audio Pub/sub and Webcam Pub/Sub component level.
Hope this helps
Thanks
Hironmay Basu
Views
Replies
Total Likes
Hi,
Thanks for quick response. Unfortunately, I still have the same issue, but here are some more details :
- Here is my code: <rtc:WebCamera id="webCamera" streamReceive="audioPub.publish();" />
- First, I click "Start my Camera"
- When the publish() executes, I have no error but I can't hear anything and my microphone doesn't work either
- Closing the Flex application and trying the microphone with another program like Sound Recorder gives me an error (it was working before)
- Trying the speakers with YouTube doesn't work either (no sound)
- I also check if the user is still hook in the room, delete him if so, but with no effect
- I can't get no more audio from my PC, have to reboot to make it works again
- IMPORTANT: My problem occurs on Windows 7 64 bits, I've tried with Windows XP and I don't have the problem
- If I use a separate button to publish the audio, then it works fine
Using this pattern, I can reproduce it everytime.
Is there a security check that disallow a Flash program to start the use of the microphone/webcam without an explicit action from the user (e.g. click of a button) ? I remember having hear something like that...
Any idea?
Thanks!
Matetnic
Views
Replies
Total Likes
Hi,
After several tests, we finally found the problem. It was coming from the USB Bandwidth usage, that was going too high on the Win7 PC. That was causing my USB headset to crash. Reducing the bandwidth usage of my webcam (which was 62% initially) solves the problem.
Thanks for you help!
matetnic
Views
Replies
Total Likes
Hi,
I am not sure why you are calling it in onStreamReceive. What you should do ideally is having components such as WebcamPublisher and WebcamSubscriber and also AudioPublisher and AudioSubscriber, something like
<rtc:WebcamPublisher id="webcamPub" />
<rtc:WebcamSubscriber webcamPublisher="" width="400" height="400" />
<rtc:AudioSubscriber id="audioSub" />
<rtc:AudioPublisher id="audioPub" />
<rtc:Button click="onClick(event)" />
Private function onClick(p_evt:MouseEvent):void
{
audioPub.publish();
webcamPub.publish();
}
And in case you are using WebCamera Class , you would have to subclass startWebcam() function of WebCamera and put the audioPub.publish() function inside it. Since you are doing these customizations, its always recommended to use WebcamPublisher and WebcamSubscriber classes instead of using the WebCamera pod class.
Lastly when you say you can't hear audio, what are you getting inside AudioPublisher's onStreamReceive on win 7 64 bit, also are you creating the stream in that function and so on. Have you tried debugging by linking to the source ?
Hope these gives you pointers to get into more details and provide to us for further investigation.
Thanks
Regards
Hironmay Basu
Views
Replies
Total Likes
Views
Likes
Replies