A Flash Developer Resource Site

Results 1 to 1 of 1

Thread: Noiseless microphone input?

  1. #1
    Happy FK'er TheWaste's Avatar
    Join Date
    Dec 2003

    Question Noiseless microphone input?

    Hey guys!

    Well, since my last thread on reading iPhone UI inputs via Flash (exported for iPhone OS, of course...) I was trying to determine a way that I could get an external device to 'talk' to an iWhatever (iPhone/iPod Touch/iPad) without using the touch input.

    Let's say I've got a number from 0 to 1024 (or upwards perhaps, depending on freedom to do so) that I want to send from an external device to an iPhone/iPod Touch/etc without using the touch input.

    Well, as TheAS3Guru kindly reminded me: One method I could use is the Microphone input. Perfect, I thought. I could simply send the number as an audio frequency.

    However, I came across two problems:
    1. The microphone seems to pick up quite a lot of noise, even when the audio input is set to 'stereo mix' (a way to set the sound recording device in windows to a loopback of its own audio) or 'line-in' (with nothing plugged in). With some rounding this might not have been a problem, except the noise range is quite significant...
    2. After making a system to play 'flat sound' at different frequencies (inaudable except for when the frequency changes, except for a 'popping' noise, which is very much expected), the Flash microphone can only hear the 'popping' noise, and not the 'flat sound'.

    Which takes me to my questions:
    1. Should I *always* expect a significant amount of noise from a recording input, even if it is a connected device, or even when no device is connected at all? Perhaps I am using too much gain on my recording input, or not enabling a feature which I have missed.
    2. Is the Microphone support in Flash unable to hear a 'flat noise' frequency?
    3. Is there another way to send input data (a single number) to an iPhone/iPod Touch without using the touch interface? (I wouldn't want to build a 'typewriter' like hardware rig to press the buttons for me here...)

    As a reference, I am aware the iPhone supports the following inputs:
    Touch (which isn't ideal, since I would need to build a rig to press buttons on the screen, and defeats the purpose)
    Microphone Audio (which I'm starting to think isn't possible)
    Bluetooth (which I believe isn't supported by Flash)
    Wifi (which is too slow to be considered an 'instant' input method)

    I have attached an example of the build I have so far.

    Note the blue columns in the middle of the screen. They represent 'keys'. When you press the "zxcvbnm,./" keys on your keyboard (bottom row) it will illuminate the corresponding column.

    The keys act as binary input, and using that input, the application will also generate a decimal (up to 1024). The decimal generated is the the sound frequency which is fed into a Sound object (via SampleDataEvent). Even though you can't hear the sound (because it is a flat sound, as opposed to a waving sound, which you could hear) I am confident it is playing correctly.

    What can be heard however, is the 'popping' noise which occurs when changing frequency (which I believe is normal within the laws of sound)

    The goal of the application lies in the position of the blue diamond movieclip which shows SampleDataEvent of a microphone input. It should not vibrate (which is being caused by noise being collected in the microphone input), and it should hear the frequency being produced by the Sound Object. At the moment the microphone only seems to detect the popping that occurs when the frequency changes.

    [NOTE: You will NEED to set your computers sound input device to 'Stereo Mix' to simulate the input of the microphone]

    I would be happy to explain the code, and the concept further if necessary.

    Kind regards,

    [Admin note: I did not put this thread in the AS3 section; even though the source is written in AS3, the question does not specifically involve source code, as well as the question being broad and involving aspects from AS2 (such as the Microphone class)
    Attached Files Attached Files

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width

HTML5 Development Center