android::AudioStreamOut Class Reference

AudioStreamOut is the abstraction interface for the audio output hardware. More...

#include <AudioHardwareInterface.h>


Public Member Functions

virtual ~AudioStreamOut ()=0
virtual uint32_t sampleRate () const =0
 return audio sampling rate in hz - eg.
virtual size_t bufferSize () const =0
 returns size of output buffer - eg.
virtual int channelCount () const =0
 return number of output audio channels.
virtual int format () const =0
 return audio format in 8bit or 16bit PCM format - eg.
uint32_t frameSize () const
 return the frame size (number of bytes per sample).
virtual uint32_t latency () const =0
 return the audio hardware driver latency in milli seconds.
virtual status_t setVolume (float volume)=0
 Use this method in situations where audio mixing is done in the hardware.
virtual ssize_t write (const void *buffer, size_t bytes)=0
 write audio buffer to driver.
virtual status_t dump (int fd, const Vector< String16 > &args)=0
 dump the state of the audio output device

Detailed Description

AudioStreamOut is the abstraction interface for the audio output hardware.

It provides information about various properties of the audio output hardware driver.

Definition at line 40 of file AudioHardwareInterface.h.


Constructor & Destructor Documentation

virtual android::AudioStreamOut::~AudioStreamOut (  )  [pure virtual]


Member Function Documentation

virtual uint32_t android::AudioStreamOut::sampleRate (  )  const [pure virtual]

return audio sampling rate in hz - eg.

44100

virtual size_t android::AudioStreamOut::bufferSize (  )  const [pure virtual]

returns size of output buffer - eg.

4800

virtual int android::AudioStreamOut::channelCount (  )  const [pure virtual]

return number of output audio channels.

Acceptable values are 1 (mono) or 2 (stereo)

virtual int android::AudioStreamOut::format (  )  const [pure virtual]

return audio format in 8bit or 16bit PCM format - eg.

AudioSystem:PCM_16_BIT

uint32_t android::AudioStreamOut::frameSize (  )  const [inline]

return the frame size (number of bytes per sample).

Definition at line 65 of file AudioHardwareInterface.h.

virtual uint32_t android::AudioStreamOut::latency (  )  const [pure virtual]

return the audio hardware driver latency in milli seconds.

virtual status_t android::AudioStreamOut::setVolume ( float  volume  )  [pure virtual]

Use this method in situations where audio mixing is done in the hardware.

This method serves as a direct interface with hardware, allowing you to directly set the volume as apposed to via the framework. This method might produce multiple PCM outputs or hardware accelerated codecs, such as MP3 or AAC.

virtual ssize_t android::AudioStreamOut::write ( const void *  buffer,
size_t  bytes 
) [pure virtual]

write audio buffer to driver.

Returns number of bytes written

virtual status_t android::AudioStreamOut::dump ( int  fd,
const Vector< String16 > &  args 
) [pure virtual]

dump the state of the audio output device


The documentation for this class was generated from the following file: