Playing recorded audio

After capturing the microphone's raw audio data, you will need a means of playing it back. This recipe will show you how to send the data to your device's speaker.

Getting ready

If you have completed the Recording microphone audio recipe, then you can work from the code you wrote for it. Alternatively, from the book's accompanying code bundle, open chapter10\recipe6\recipe.fla and use it as a starting point.

Currently the FLA will record audio from the microphone and store it within a member variable of type ByteArray named soundData. We will add code that plays back the audio once the user has finished recording it.

How to do it...

The following changes are required to read and playback the recorded audio:

  1. Open Main.as.
  2. Import ...

Get Flash iOS Apps Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.