AIR provides an API that enables an application to connect to the built-in microphone. The microphone's raw data can be obtained, recorded for later use, processed as it is received, or routed to the device's speakers.
This recipe will show you how to use the Microphone
and ByteArray
classes to capture and record audio. You will need Flash Professional CS5.5 as microphone access for iOS is not supported by CS5 and AIR 2.0.
While all recent models from the iOS family contain a built-in microphone, previous generations of the iPod touch don't. The second and third-generation devices do, however, provide support for an external microphone, which can be used for this recipe.
From the book's accompanying code bundle, open chapter10\recipe5\recipe.fla
into Flash Professional CS5.5.
Sitting on the stage you will find a dynamic text field with an instance name of output
and three movie clips. Two of the movie clips represent buttons and are named recordBtn
and...