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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.