I’ve been lucky enough to get some Research & Development work in over the last few weeks. The latest batch of work has included some experimental stuff with the the new Microphone features introduced in Flash Player 10.1 which is currently in beta. You can download the required Flash Player here.

In the example below the app will automatically record your voice until you stop talking and will playback the sound bytes as Barry White or a Chipmunk (adjust using the slider).

Prior to Flash 10.1 you could manipulate the sound bytearray from an mp3 at runtime but you couldn’t access the native incoming microphone data. I can see this modification to the Flash Player leading to some really cool future games and apps.

In my example there’s currently no encoding to mp3. I just save the incoming sound byte arrays in memory. I think there may be as3 mp3 encoders already written if this was a project requirement.

Microphone Fun

Alternative content

Get Adobe Flash player

I’m also really intrigued by Didier Brun’s R&D work on voice recognition in Flash Player 10.1:

http://www.bytearray.org/?p=1151

http://vimeo.com/9780416

Looks like he’s really getting somewhere from those example videos. I guess one approach might be to render the sound data samples to bitmaps and run the sort of blend, colour threshold comparisons that you achieve with Flash WebCam motion detection.

Thanks to Andre Michelle’s shared work on pitching MP3s and Devon Wolfgang’s microphone code example I was able to get the above up and running.

Here’s the source :-)



5 Comments

  1. David Law

    Hi, Nick

    Thanks for sharing your codes! Somehow, neither the object embedded in this page or the object re-built by myself works on my PC. It looks like that it does not automatically detect voice. I have downloaded Flash Player 10.1 and tried on different browsers. By reading through your code, I thought there was an mistake. Do you not need to call “startRecording” in “micDidActivate”?

    protected function micDidActivate() :void {
    startRecording();
    }

    I made the above change, but it still does not work :-( Any idea?

  2. Nick Kuh

    Hi David

    If you’ve just followed the auto update of Flash Player then you won’t have 10.1 installed. You’ll have 10.0.something. You need to go here to download the beta Flash Player:

    http://labs.adobe.com/downloads/flashplayer10.html

    When you right click on the Flash Movie and choose ‘About Flash Player…’ Adobes site will tell you ‘Version Information: You have version 10,x,y,z installed’ If you’ve got 10.1 then x will be 1.

    I’m sure that’s the only reason it’s not working for you.

    Nick

  3. David Law

    Hey, Nick. I did install 10.1 from the link. In fact, I had to uninstall the previous version first. On my PC, it shows: “You have version 10,1,53,7 installed”. I have done lots of test on different machines, and found that it does work occasionally, and there seems to be a pattern: if I right click the video, select “Settings” and leave it on screen then it starts to work. If I close the “Settings” dialog, then it stops working. Its’s really kinda odd. Technically, it seems that the ActivityEvent.ACTIVITY event is not fired up when it should be.

  4. Jesús

    Hi Nick, awsome application!! In order to play with source code…Im trying to compile it but it only shows the slider on screen…Should I get flash cs5 ??? I dont know what is happening… One more question, is there a chance to apply this ‘barry white’ effect without slow the audio?? I mean…Id like to sincronize the audio with a video. Thanks a lot in advance,
    Jesús


Leave a reply