Get Adobe Flash player

Sing like HAL with the Flash Player 10.1

30. December 2009 – 00:49

Tags: , ,

Sing like HAL with the Flash Player 10.1

Of course everybody remembers the scene from 2001 when Dave Bowman removes HAL´s memory banks.

While being shut down HAL sings the song ‘daisy’ and his voice continuously pitches down while his ‘mind fades’.

With this little test app you can sing like HAL!


…provided you installed the Flash Player 10.1 beta and have a microphone handy.

Yes 10.1 – as the new year is coming, so is the next subversion step of the flash player, bringing among other features video playback and p2p/streaming enhancements.
The beta2 has been released at the 17th December and brought also the long-awaited debug version.

But aside from the global error handling, the new feature I was looking forward to the most is the access to binary data coming from the microphone.

This will allow to develop a bunch of pretty interesting applications that make use of voice input – like voice recognition for example.

This little demo records data from the mic and plays it with an adjustable speed offset, pitching the sound.




You can download the source here.

Note: to be able to compile the project you need to download the updated “playerglobal.swc“.

  1. 14 Responses to “Sing like HAL with the Flash Player 10.1”

  2. Nice Example.
    Do you know if it is possible to compute spectrum in real time from mic data? If so have you been able to do it successfully?
    thanks,
    Chris

    By Chris Florio on Feb 23, 2010

  3. Hi Chris,

    as computeSpectrum is a Method of the global SoundMixer, you would have to play the mic data as sound in order to use it so sadly this doesn´t work.

    But on every SampleDataEvent you receive the incoming sample as a RAW bytearray.
    So you just have to apply the fast fourier transformation with an own implementation of that method.

    That should do the trick – hope it helps you out.

    Cheers!

    By flashgordon on Feb 23, 2010

  4. Thanks I will try playing with that.

    By Chris Florio on Feb 23, 2010

  5. That’s great. It works and is way easier than everything I was trying. Thanks for pointing me in the right direction.

    By Chris Florio on Feb 23, 2010

  6. Anytime :)

    By flashgordon on Feb 23, 2010

  7. Thanks for this test Gordon, they said it will only be available in AIR but it works in the FP plugin as well :)

    By Og2t on Mar 2, 2010

  8. Hi Gordon, Id like to add the feature to my web of recording audio from microphone and apply some distortion or effect to it without any offset, to synchronize with recorded video as well. Do you think is possible to do that with fp 10.1? thanks a lot in advance nice applycation.

    By jesus on May 20, 2010

  9. Hi Jesus,

    yes – absolutely.

    I would recommend to look at PixelBender for live audio filtering, as it gives you another thread.

    Live distorsion and other effects have already been done nicely using PixelBender shaders.

    Cheers!

    By flashgordon on May 21, 2010

  10. Trying to use the code in my program but unable to get the buttons to work. Mic does not go on either.

    By Randy on May 30, 2010

  11. Hi Randy,

    to use the new API functions, you need to work with the updated Player Global SWC and the FP 10.1 debug player.

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

    By flashgordon on May 30, 2010

  12. Gordon:
    First of all thank you for your prompt response.

    Installed FP 10.1.
    ? If I am able to run your application from the web, is my 10.1 working.
    Used another computer w/o 10.1 and the application (record/play) did not show up (using the browser). Loaded up 10.1 and the application worked.

    I have created a script using my own buttons (tried using button components but had no luck).

    Can I send you my script?

    By Randy on May 30, 2010

  13. With what exactly are you developing?
    Flash/Flex Builder, the Flash IDE or something else?

    And what do you mean by “unable to get the buttons to work”?

    If you have trouble compiling, did you mind the Player Global SWC?

    If it builds fine but your app is unresponsive in the player – is it possible that you didn´t update your IDE´s debug player / have you tried testing within your browser?

    Cheers!

    By flashgordon on May 30, 2010

  14. I am developing a “karaoke” type program. However, there are 8 part harmonies and I am able to adjust the volume of each part so that the student can practice their part (just their part, with another section such as tenor 1 w/ tenor 2 or with the entire 8 parts). That part of the program is completed.

    Now I need to sample their voice and create another part (their own voice) so that they can mute their section, adjust their own volume, and listen to what they sound like (by themselves, with another section such as tenor 1 w/ tenor 2 or with the entire 8 parts).

    In addition, I would like to compare their sampled voice with the original part (say tenor 1) and tell them if they are on pitch (compare FFT of the two bytearrays).

    By giving them a score, I am hoping that the practice time will increase.

    I am currently using as3 and have downloaded FP10.1.

    I am trying to reuse your code but with my buttons.

    There is another source code for a guitar tuner. Did you come across that?

    By Randy on May 31, 2010

  15. Sounds like a nice project.

    I have the feeling that your problem might not be code related but could have something to do with the setup of your work environment – that´s often the case when working with a beta/rc version of a new flash version/API.

    If you want, you can send me your source and I will have a look -> info@smart-page.net.

    Cheers!

    By flashgordon on May 31, 2010

Post a Comment

Security Code: