Flash recording through mic

Hi,
I've been trying to figure out how to record using mic feature. I had modified the example in the AS3 guide to something like this:
import flash.events.MouseEvent;
import flash.net.URLRequest;
import flash.utils.ByteArray;
import flash.net.SharedObject;
stop();
stopRecord.visible =false;
mybutton.addEventListener(MouseEvent.CLICK, recordmic);
trace("here!");
function recordmic(event:MouseEvent):void {
const DELAY_LENGTH:int = 20000;
var mic:Microphone = Microphone.getMicrophone();
mic.setSilenceLevel(0, DELAY_LENGTH);
mic.gain = 50;
mic.rate = 44;
mybutton.visible = false;
stopRecord.visible = true;
mic.addEventListener(SampleDataEvent.SAMPLE_DATA, micSampleDataHandler);
stopRecord.addEventListener(MouseEvent.CLICK, stoprecordmic);
var soundBytes:ByteArray = new ByteArray();
/*var timer:Timer = new Timer(DELAY_LENGTH);
timer.addEventListener(TimerEvent.TIMER, timerHandler);
timer.start(); */
function micSampleDataHandler(event:SampleDataEvent):void
    while(event.data.bytesAvailable)
       var sample:Number = event.data.readFloat();
        soundBytes.writeFloat(sample);
          soundBytes.position = 0;
function stoprecordmic(event:MouseEvent):void
    mic.removeEventListener(SampleDataEvent.SAMPLE_DATA, micSampleDataHandler);
    var header:URLRequestHeader = new URLRequestHeader ("Content-type","application/octed-stream");
     var mp3URLRequest : URLRequest = new URLRequest("uploadsound.php");
     mp3URLRequest.requestHeaders.push(header);
     mp3URLRequest.method = URLRequestMethod.POST;
     mp3URLRequest.data= soundBytes;
     stopRecord.visible=false;
     mybutton.visible = true;
Here, there are two buttons, one starts recording and the other stops recording. The resulting .swf file is only 2kb in size and it doesn't do what it is supposed to do.
What am I doing wrong here? Other players similar to this have sizes in the range of 80-100 kb.
Help will be very much appreciated!
Thankyou!

you made soundBytes local to recordmic().  and it looks like you might be nesting named functions.  fix that:
var soundBytes:ByteArray = new ByteArray();
stop();
stopRecord.visible =false;
mybutton.addEventListener(MouseEvent.CLICK, recordmic);
trace("here!");
function recordmic(event:MouseEvent):void {
const DELAY_LENGTH:int = 20000;
var mic:Microphone = Microphone.getMicrophone();
mic.setSilenceLevel(0, DELAY_LENGTH);
mic.gain = 50;
mic.rate = 44;
mybutton.visible = false;
stopRecord.visible = true;
mic.addEventListener(SampleDataEvent.SAMPLE_DATA, micSampleDataHandler);
stopRecord.addEventListener(MouseEvent.CLICK, stoprecordmic);
function micSampleDataHandler(event:SampleDataEvent):void
    while(event.data.bytesAvailable)
       var sample:Number = event.data.readFloat();
        soundBytes.writeFloat(sample);
          soundBytes.position = 0;

Similar Messages

  • I have an Irig but sound still records through mic on my ipod. How do I know if my iRig works??

    I have an Irig but sound still records through mic on my ipod. How do I know if my iRig works??

    Does Settings > GarageBand > Crosstalk Protection > On help?
    tt2

  • Can't get audio to record through mic jack

    I have a 1/8" (3.5mm) stereo jack cable connected between the headphones jack of one computer and the mic jack of my MacBook Pro. I'm trying to import sound into Garage Band and I simply CANNOT figure out how to make this work. GarageBand only wants to import from the mic in the front of the my laptop.
    I've tried all 3 input settings (mono-1 built in, mono-2 built in, stereo 1/2 built in) and none of them seem to work.
    Any ideas would be appreciated.

    rsquared76 wrote:
    GarageBand only wants to import from the mic in the front of the my laptop.
    http://www.bulletsandbones.com/GB/GBFAQ.html#recordlinein
    (Let the page FULLY load. The link to your answer is at the top of your screen)

  • Record audio through Mic on web site and send it to other place

    Hi There,
    I 'd like to record audio through mic using Flash on a web
    site and send the audio clip to other people or to the server. Is
    it possible without FMS?
    Thanks!
    Nick

    No, without FMS you can't save the audio from a mic.

  • Results Recording through QE 11  - Determine one MIC w.r.t another MIC

    Hi All,
    While doing Results Recording through QE11, one MIC (Say 'T') )needs to be automatically calculated ,whereas it was manually entered until now.
    The value for 'T' should be picked from some Z table depending on some key fields , of whiich another manual MIC (say 'A' )value is a key field.
    I can create the Function module and assign it to the MIC in formula. But I am not sure how to pick up the value for MIC 'A' at run-time.
    Before saving itself, when 'calculate' button near 'T' is pressed, the FM should be triggered and it should use the value for MIC 'A' for picking value for 'T' from Z table.
    Please advise if any FMs/BAPIS are there or any other method.
    An F1 at 'A' yielded field QAQEE-SUMPLUS in 'Result' field and QAMKR-ORIGINAL_INPUT from 'Orig. Val' filed of which both are structure fields.
    Thanks,
    Neethu

    I'm a maybe little late, but i will try to explain my own problem.
    I'm also working for QM.
    I want read data from QAQEE-ORIGINAL_INPUT and i cant and i did succed when i going to see inspection report.
    I just have to make some marks in field Accessories for report and u will get data from this field.
    But, if i want to read the same data in another place in sapscript i have problem.
    It simple i cant get data from structure, is this because the program for form is writen for specific point when it must be write out?
    Sorry for my english.
    Tnx.

  • I can record and hear me recording through the computer's built in mic, but can't get the external mic and headphones to work., The preferences are set for the external mic and headphones...

    I can record and hear me recording through the computer's built in mic, but can't get the external mic and headphones to work., The preferences are set for the external mic and headphones...

    What operating system are you using? Is it on a Mac or a PC? Which preferences are set for external mic/headphones, Audition's or the computers?

  • Recording through the Mac Audio Tracks rather than through the Mic.

    I figured this would be very handy since I'm just recording the sound from a YouTube video, I don't want to have to use the mic to record the sound, If it's possible to save the Mac Audio Tracks, which is basically anything that comes out of the speaker, to a file to be used by Garageband later? Or is there a way to record, not through the mic, but using the Mac Audio Track through Garageband? It would help because I realized when I recorded through the mic that I had to worry about everyone around me being quite for a few seconds only to realize that the fan was running full boar which made the quality terrible. Just looking for an alternative. Maybe a program that records the Mac Audio Tracks? Sorry for the long-winded post.

    I know a way around this as I had the same problem once. I bought a small lead with stereo mini jack to stereo mini jack which enabled me to connect the headphones socket to the line/mic in socket. This means that any sound your computer makes can be recorded directly using any recording application, including Garageband. No fear of extraneous noise as it is a direct connection not microphone. There may well be a purely 'software' method also but I can confirm that this does work anyway.

  • Cannot record a mic with Audigy 2 ZS through Logic Platinum 5.1

    Hi, ive got the SB Audigy 2 ZS sound card and am having some problems with ASIO... i can record a mic through the mic input when using PC AV with my card, but when i try to use ASIO i cant record with a mic. I would use PC AV but the latency is way too high on it, ive looked around loads of forums including Logic forums but no one seems to have an answer to this problem, and most of the time it goes unreplied.. does anyone know of anything i can do to get my card to record in ASIO??
    thanks,
    ...Mike...

    Thanks man. I'm off to learn about kx.
    I guess I should not be surprised by lack of mod response. Apparently creative drivers are still going wanting. I wonder what kind of response a query to creative support would yield. I think I will shoot them a copy of my post just for giggles. I will also tell them what I think about SNEAKING that aol crap onto my rig.

  • Trying to record through soundboard in Sound Studio?

    Hi all-
    I have been trying to record an audio clip into Sound Studio 2.2.4. The default is for the MacBook Pro to play the clip through the speakers and for Sound Studio to record through the microphone, in which case I can get good levels but the recording is echo-ey and bad. When I switch to the only other source option, Built-in Input, I get no signal or levels in Sound Studio at all.
    Am I doing something foolish? Does SS not have this capacity? Or do Macs not use the soundboard the way a PC does? Any help would be appreciated!
    Thanks,
    Matthew

    I have a very similar problem on my iMac. I've tried 3 sound programs and none of them can record internally, without having to resort to speakers out mic in. Each program has an option for internally recording but the problem appears to be my own sound preferences as they just list the mic, the line in and a blue tooth device called LAVINIA that I know nothing about!

  • The video that is recorder through my mobile camera can't be seen in mobile screen

    I need to record through by mobile camera and play it in browser of my website. In my mobile phone the frame that should show the video is created by flash player but it is just white and no video (preview) is seem inside the frame.
    The video that is recorded through my mobile camera should be seen in the frame but it is not there.
    I used HUAWEI and sumsong mobiles and both use Android.
    I later made an Air for Android application and used CameraUI class. It works in desktop and shows the video captured by webcam but still it dose not work on the mobile.
    Thank you very much for your prompt answer

    same thing is happening with mine, every solutions proposed require a fully charged battery, but there's just no way to charge it, computer is not recognizing it anymore, and pluging it into the wall doesn't work either, so is there left to do? thow the $500 object in the freakin garbage? I hate this thing

  • Logic X won't record through my interface, in-built microphone constantly on

    Installed Logic X on my Macbook Pro, everything seems to work ok but when I try and record Logic is picking up sound through the in-built microphone even though my external interface is selected in the audio preferences box as the input. I tried to see if Logic 9 was working ok and now the same thing is happening in Logic 9, and I've never ever had this problem before. I've tried re-installing the interface's drivers and making sure they're up to date and I've also tried making sure that the input and output for the laptop sound in general is set to the external device (which is an Edirol UA-25) but still every time I hit record it records through the in-built mic but the sound comes out of the Edirol. I really cannot figure out what the issue is, somebody please help, the worst part is that installing Logic X seems to have caused this issue with Logic 9 and now I can't use either.

    maskeda wrote:
    I got it, some how it was a MIDI track and not an audio track.
    "Some How"?     as in:  user error? 

  • MP3 Player will not play through Mic Jack - NB 550D

    Hi
    MP3 Player will not play through Mic Jack. Is this because I have not setup Realtek Audio Manager correctly?.
    Also is there any way to play the MP3 through a USB Port
    Thx

    Hi
    What notebook do you have?
    The mic jack records the audio signal. But I assume you want to use the mic jack an line-in. Right?
    Usually you have to set the default device in recording tab.
    In control panel -> sound -> recording tab.
    If you will not see any further devices but only mic jack then you should click right and should enable the options; show hidden devices and show disabled devices.
    Possibly then you could enable line in.
    Otherwise such option is not available and not possible

  • Equium M70-339 - not possible to record through internal microphone

    I have an Equium M70-339 (running XP home) not recording through internal microphone
    The internal michrophone is not detecting voice - no wavy line on sound recorder and Skype not picking up my voice, yet the device manager tells me it's working properly and the microphone is selected in sound and audio settings.

    Are you really sure that your notebook model has an internal mic? I have Satellite M70-159 and there is no internal mic.

  • Cannot record multiple mic's with mixer board

    I have a Satellite P205D-S7802 - I recently bought a Behringer Xenyx mixer so I can podcast with mutiple mic's. I cannot get anything to record through the mixer. I have everything connected correct and even contacted the Behringer tech support  just to be sure.  Is there a way to get this to work? It is driving me crazy......Thanx

    You may need to go to Control Panel under Sounds and change the default input from the internal to external mic.
    ******Clicking the Thumbs-Up button is a way to say -Thanks!.******
    **Click Accept as Solution on a Reply that solves your issue to help others**

  • I tried using the Voice Memos iPhone app and ended up with a red banner on top of the screen that flashes "recording 00.00" but I can't locate what I thought I was recording.  can you help me?

    I tried using the Voice Memos iPhone app and ended up with a red banner on top of the screen that flashes "recording 00.00" but I can't locate what I thought I was recording.  can you help me?
    jacknil

    I found an answer to this on another page (I was having the same problem) This worked for me:
    Double-click the Home button.
    Swipe left or right until you have located the app you wish to close.
    Swipe the app up to close it.
    more here: https://discussions.apple.com/thread/5596831

Maybe you are looking for

  • Can't reach the Central Adapter Engine (HTTP 403)

    Hello, in a simple scenario (AdapterEngine -> IntegrationEngine -> AdapterEngine) we get a HTTP 403 failure in the 'Call Adapter' - Service. When we try to connect the URI "http://:50000/MessagingSystem/receive/AFW/XI" and logon with user XIISUSER we

  • Unsynchronized Producer Consumer Problem

    Hi I would like some help implementing an unsynchronized producer consumer with an unbounded queue (implemented using an ArrayList) I have both the producer and consumer sleeping for random amount of time (producer wakes up faster). The problem is th

  • How to force a responsive Edge animation to re-evaluate its container size?

    I have an Edge animation stage embedded in a relatively complex page, inside a container div whose width is set by media queries and which may or may not be faded out by $.fadeOut. I've figured out how to trigger playback, but the stage doesn't seem

  • Com.sap.pct.erp.mss.requisitionrequest_statusoverview _Target URL of Broken

    hi Friends in sap portal>portal content->content admin>end user content->employee self service--->line_manager under iview--->com.sap.pct.erp.mss.requisitionrequest_statusoverview WHENEVER I AM CLICK INTO THAT IVIEW SHOWING ERROR Target URL of Broken

  • Adding parameters

    Hello, We are developing a POS system and we use Crystal Reports to build the reports for our application. We use the .NET designer embedded in the Visual Studio to load some *.rpt's We recently developed a system that changes the content on some of