Programming Previous page   Next Page

Importing Audio/Video Data

MATLAB includes several functions that you can use to bring audio or video data into the MATLAB workspace. Some of these functions read audio or video data from files. Another way to import audio data into the MATLAB workspace is to record it using an audio input device, such as a microphone. The following sections describe

Reading Audio and Video Data from a File

MATLAB includes several functions for reading audio or video data from a file. These files are format-specific.

Recording Audio Data

To bring sound data into the MATLAB workspace by recording it from an audio input device, use the audio recorder object. This object represents the connection between MATLAB and an audio input device, such as a microphone, that is connected to your system. You use the audiorecorder function to create this object and then use methods and properties of the object to record the audio data.

On PCs running Windows, you can also use the wavrecord function to bring live audio data in WAV format into the MATLAB workspace.

Once you import audio data, MATLAB supports several ways to listen to the data. You can use an audio player object to play the audio data. Use the audioplayer function to create an audio player object.

You can also use the sound or soundsc function.

On PCs running Windows, you can use the wavplay function to listen to .wav files.


Previous page  Getting Information About Audio/Video Files Exporting Audio/Video Data Next page

© 1994-2005 The MathWorks, Inc.