Want full microphone access in Flash?

Of course you do. This is a request that I hear quite often when I’m out traveling around. Let me first clarify what I mean by full microphone access. This would be the ability to get at the raw bytes coming over the microphone in a similar way that we can now get the raw bytes of a sound file. This would enable all kind of cool applications using voice control, sound manipulation, etc. There is of course the gratuitous spectrum display for microphone input.

The reason I bring this is up is that the guys over at Ribbit have started a new site at getmicrophone.com which serves a dual purpose. First of all, it is a place to share ideas and examples relating to the microphone in Flash. Secondly, it is similar to the Make Some Noise campaign in that it is trying to get us (Adobe) to add in the full microphone support. They want you to record a video telling us that you want it. So if you’ve ever wanted this type of low-level access to the microphone, then go over and record a response. My response is below.

Lee


Commentary

  1. noj says:

    Thanks a lot, made my day. I have been ranting for full microphone access forever. Always wanted to create an app that would change a male voice to female voice by varying pitch, reversing the bytes, i.e changing the base to treble e.t.c, and the most favourite of all. using microphone to get user input i.e

    in a class of 20 students, you ask a question. if the students think the answer is true they shout “yeeeeeaahhhh”, if false they shout “ahhhhhhhhhh”, microphone records the input, and determines whether the overall answer is true or false. A fun way to increase class participation.

    another one is using your voice to control the mouse. i.e treble controls the y-axis, and base controls the x-axis. draw all kinds of various shapes and interactivity with just your voice.

    lol!!! got no camera to record it, so i am writing on your blog.

  2. noj says:

    mmm on another thought. i think i need to make another website. flashgetgpu.com

  3. John says:

    Change your voice to make bomb threat calls? Hmmm, never thought of that one!

  4. genaro says:

    I think we should be able to get full stereo input from the audio device. Right know, even if you select a stereo line as input, you still get a dumb mono output in flash through the microphone object.

  5. Jankees says:

    Hi Lee,

    It would be great if you would have direct access to the microphone.. a year ago when I needed this I started to think about how to do it.

    After a few experiments I found the power of MaxMSP and I used this to get full access to the microphone. The data I needed (pitch/amplitude) got transferred with Flosc to Flash. This is a pretty good stable way to do it. The disadvantage is that you need a separate application to do it.

    Check out our examples at:

    http://code.google.com/p/flashliveaudiocontroller/

    And some video demos:

    http://www.youtube.com/watch?v=uo2FXTvMvRE
    http://www.youtube.com/watch?v=7zlyO0adKMU
    http://www.youtube.com/watch?v=cz0G3bozGNw

  6. Jono says:

    The possibilities are endless with full microphone support, You could create an advanced spectrum analyser to detect people telling porkies (lying) or make a guitar tuner…sweet!

  7. vitaLee says:

    Lee be careful!
    Big Brother is watching and listening.
    :D

  8. Tim says:

    Heey lee!

    Reel nice! It has endless opportunities!!

    Grtzz

  9. Tomek says:

    Well, it looks like Microsoft is pushing hard with their Silverlight features (http://tr.im/silverlight3b via *drawlogic), I think the serious war between FP and SL might start soon.

  10. Like the beard, now start smoking, get your voice a little scratchier.

    As a language teacher/edutainment developer I’m wondering if this could ever lead to some kind of voice recognition applications?I know thats wishful thinking but does anyone have any opinions?

  11. Josh says:

    great ideas to increase the uses of Flash. I was thinking that it would be a cool feature to offer for a long time but always figured it was outside of the scope for the Flash Application.

    when can we expect the next episode of Flasher Magazine?

  12. fred says:

    This is kind of bizarre. Just 2 days ago i thought of using the microphone for controlling flash, and found that besides from the ‘level’ none of the sound attributes are accesable for mic input. And now you guys would put it in. I am ready !
    It would be great. Since i have no webcam (?) I post my support here, allthough it is not the right place for it I’m sure it’ll count.

    thanx

  13. Jorn says:

    Jorn really wants access to the raw microphone input data.

    But what i want to know is:
    Why is this feature not already inside the flash player (or AIR only)?

  14. hseldon says:

    I got the impression Adobe was trying to make streaming (audio and video) proprietary to their coldfusion server (and make their money from license fees). If this is the case, I would encourage Adobe to shift gears quickly and open all of their streaming protocols. I want Adobe to win with Flash, but Silverlight could become very popular if you can do more with it for less money.

  15. Gilbert says:

    I think this is a great idea.

    Besides full microphone access in Flash I would like to see full camera access. What I mean is to be able to record videos directly on the client machine (and then save it to a server) without the need of a media server like FMS or RED 5.

  16. leef says:

    What did you find about this Lee?

  17. Hannes says:

    Gilbert, that probably wont happen, cause Adobe wants to sell their media servers .. same thing with the mic unfortunately ..

  18. ButtonBeats says:

    here is the code to access and record the mic.

    const DELAY_LENGTH:int = 4000;

    var mic:Microphone = Microphone.getMicrophone();
    mic.setSilenceLevel(0, DELAY_LENGTH);
    mic.gain = 100;
    mic.rate = 44;
    mic.addEventListener(SampleDataEvent.SAMPLE_DATA, micSampleDataHandler);

    var timer:Timer = new Timer(DELAY_LENGTH);
    timer.addEventListener(TimerEvent.TIMER, timerHandler);
    timer.start();

    var soundBytes:ByteArray = new ByteArray();

    function micSampleDataHandler(event:SampleDataEvent):void
    {
    while(event.data.bytesAvailable)
    {
    var sample:Number = event.data.readFloat();
    soundBytes.writeFloat(sample);
    }
    }

    function timerHandler(event:TimerEvent):void
    {
    mic.removeEventListener(SampleDataEvent.SAMPLE_DATA, micSampleDataHandler);
    timer.stop();
    soundBytes.position = 0;
    var sound:Sound = new Sound();
    sound.addEventListener(SampleDataEvent.SAMPLE_DATA, playbackSampleHandler);
    sound.play();
    }

    function playbackSampleHandler(event:SampleDataEvent):void
    {
    for (var i:int = 0; i 0; i++)
    {
    var sample:Number = soundBytes.readFloat();
    event.data.writeFloat(sample);
    event.data.writeFloat(sample);
    }
    }

  1. [... Of course you do. This is a request that I hear quite often when I'm out traveling around. Let me first clarify what I mean by full microphone access. This ...]

  2. [... Of course you do. This is a request that I hear quite often when I'm out traveling around. Let me first clarify what I mean by full microphone access. This ...]

  3. [... Of course you do. This is a request that I hear quite often when I'm out traveling around. Let me first clarify what I mean by full microphone access. This ...]

Leave a Comment