Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 06-24-2008, 10:57 PM   #1
Registered User
Join Date: Apr 2008
Posts: 11
Default Audio recording in Flex

I'm having trouble recording streaming audio from a Flex 3 app to Flash Media Server. Via other programs, I'm able to record audio successfully, so I ruled out the microphone itself as a culprit.

In my code, once the user clicks on the 'record' button, the following code gets executed (it's in a method in an AudioManager object).

The _audioStream is a custom AudioStream that extends the NetStream class.

public function recordAudio(filename:String):void {
	this._audioStream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, onAsyncError);
	this._audioStream.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
	this._audioStream.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);
	this._audioStream.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
	this._isPublishing = true;
	this._isPlaying = true;
	var mic:Microphone = Microphone.getMicrophone();
	trace("Microphone: " + mic);
	mic.rate = 22;
	mic.gain = 100;
	this._audioStream.publish(filename, "record");
I'm also setting appropriate event handlers (onNetStatus, etc). According to the NetStatusEvents, I'm successfully getting a stream, but when I speak into the microphone, the stream doesn't get any data.

Console output:

Start recording
Stop recording

I'm really stuck - I can't think of any logical reason why the NetStream would silently fail to get data from the microphone Can anyone see something I missed?
Elephantium is offline   Reply With Quote
Old 07-20-2009, 12:20 PM   #2
Registered User
Join Date: Jan 2009
Posts: 7

serrega is offline   Reply With Quote
Old 07-20-2009, 03:31 PM   #3
Holosuit User
wvxvw's Avatar
Join Date: Oct 2006
Location: Tel Aviv
Posts: 4,669
Send a message via ICQ to wvxvw

1. How do you knoe stream doesn't get any data?
2. I'm really not sure about silence level and gain - why won't you leave them with default values, maybe the mic never publishes anything because of that. (I really don't know what exactly each one of them is supposed to do tho).
3. Are you sure, the microphone was found? (you don't show this in the output). Macs in particular tend to mess with the devices installed, they can sometimes show you a bunch of "virtual" web-cams and microphones as if they ware installed there...
The .NET open source editor for Flash and web developers
*This would be my contribution to the project*
couchsurfing if you need it
wvxvw is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Audio Recording Feature in Flash salim_designer ActionScript 2.0 4 05-21-2007 06:12 AM
Recording audio from Flash using external app anderson Other Flash General Questions 1 03-03-2006 03:21 AM
audio recording problems... Ozero Other Flash General Questions 0 10-25-2004 01:44 AM
Questions about audio recording and QT video Sarah012 Flash Media Server 0 07-19-2004 01:04 PM
audio stuttering erank Other Flash General Questions 0 03-29-2002 08:28 PM

All times are GMT. The time now is 08:01 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.