Texas Instruments OMAP35 Series User Manual page 85

Evm linux psp
Hide thumbs Also See for OMAP35 Series:
Table of Contents

Advertisement

5.6. Sample Applications
This chapter describes the sample application provided along with the package.
The binary and the source for these sample application can are available in the
Examples directory of the Release Package folder.
5.6.1. Introduction
Writing an audio application involves the following steps:
These steps are explained in detail in this section.
5.6.2. A minimal playback application
This program opens an audio interface for playback, configures it for stereo,
16 bit, 44.1kHz, interleaved conventional read/write access. Then its delivers a
chunk of random data to it, and exits. It represents about the simplest possible
use of the ALSA Audio API, and isn't meant to be a real program.
5.6.2.1. Opening the audio device
To write a simple PCM application for ALSA, we first need a handle for the PCM
device. Then we have to specify the direction of the PCM stream, which can be
either playback or capture. We also have to provide some information about
the configuration we would like to use, like buffer size, sample rate, pcm data
format. So, first we declare:
#include <stdio.h>
#include <stdlib.h>
#include <alsa/asoundlib.h>
#define BUFF_SIZE 4096
int main (int argc, char *argv[])
{
Version 02.01.01.08
Opening the audio device.
Set the parameters of the device.
Receive audio data from the device or deliver audio data to the device.
Close the device.
Note
User space ALSA libraries can be downloaded from this link [http://www.alsa-
project.org/main/index.php/Download].
User needs to build and install them before he starts using the ALSA based
applications.
Platform Support Products
Audio Driver
Sample Applications
63

Advertisement

Table of Contents
loading

This manual is also suitable for:

Omap3515Omap3525Omap3530

Table of Contents