Public Member Functions | Static Public Member Functions | Protected Member Functions
android_audio_legacy::AudioHardwareInterface Class Referenceabstract

AudioHardwareInterface.h defines the interface to the audio hardware abstraction layer. More...

Public Member Functions

virtual void closeInputStream (AudioStreamIn *in)=0
 
virtual void closeOutputStream (AudioStreamOut *out)=0
 
virtual status_t dumpState (int fd, const Vector< String16 > &args)=0
 This method dumps the state of the audio hardware. More...
 
virtual size_t getInputBufferSize (uint32_t sampleRate, int format, int channelCount)=0
 
virtual status_t getMicMute (bool *state)=0
 
virtual String8 getParameters (const String8 &keys)=0
 
virtual status_t initCheck ()=0
 check to see if the audio hardware interface has been initialized. More...
 
virtual AudioStreamInopenInputStream (uint32_t devices, int *format, uint32_t *channels, uint32_t *sampleRate, status_t *status, AudioSystem::audio_in_acoustics acoustics)=0
 This method creates and opens the audio hardware input stream. More...
 
virtual AudioStreamOutopenOutputStream (uint32_t devices, int *format=0, uint32_t *channels=0, uint32_t *sampleRate=0, status_t *status=0)=0
 This method creates and opens the audio hardware output stream. More...
 
virtual status_t setMasterVolume (float volume)=0
 set the audio volume for all audio activities other than voice call. More...
 
virtual status_t setMicMute (bool state)=0
 
virtual status_t setMode (int mode)=0
 setMode is called when the audio mode changes. More...
 
virtual status_t setParameters (const String8 &keyValuePairs)=0
 
virtual status_t setVoiceVolume (float volume)=0
 set the audio volume of a voice call. More...
 
virtual ~AudioHardwareInterface ()
 

Static Public Member Functions

static AudioHardwareInterfacecreate ()
 

Protected Member Functions

virtual status_t dump (int fd, const Vector< String16 > &args)=0
 

Detailed Description

AudioHardwareInterface.h defines the interface to the audio hardware abstraction layer.

The interface supports setting and getting parameters, selecting audio routing paths, and defining input and output streams.

AudioFlinger initializes the audio hardware and immediately opens an output stream. You can set Audio routing to output to handset, speaker, Bluetooth, or a headset.

The audio input stream is initialized when AudioFlinger is called to carry out a record operation.

Definition at line 191 of file AudioHardwareInterface.h.

Constructor & Destructor Documentation

virtual android_audio_legacy::AudioHardwareInterface::~AudioHardwareInterface ( )
inlinevirtual

Definition at line 194 of file AudioHardwareInterface.h.

Member Function Documentation

virtual void android_audio_legacy::AudioHardwareInterface::closeInputStream ( AudioStreamIn in)
pure virtual
virtual void android_audio_legacy::AudioHardwareInterface::closeOutputStream ( AudioStreamOut out)
pure virtual
static AudioHardwareInterface* android_audio_legacy::AudioHardwareInterface::create ( )
static
virtual status_t android_audio_legacy::AudioHardwareInterface::dump ( int  fd,
const Vector< String16 > &  args 
)
protectedpure virtual
virtual status_t android_audio_legacy::AudioHardwareInterface::dumpState ( int  fd,
const Vector< String16 > &  args 
)
pure virtual

This method dumps the state of the audio hardware.

virtual size_t android_audio_legacy::AudioHardwareInterface::getInputBufferSize ( uint32_t  sampleRate,
int  format,
int  channelCount 
)
pure virtual
virtual status_t android_audio_legacy::AudioHardwareInterface::getMicMute ( bool *  state)
pure virtual
virtual String8 android_audio_legacy::AudioHardwareInterface::getParameters ( const String8 &  keys)
pure virtual
virtual status_t android_audio_legacy::AudioHardwareInterface::initCheck ( )
pure virtual

check to see if the audio hardware interface has been initialized.

return status based on values defined in include/utils/Errors.h

virtual AudioStreamIn* android_audio_legacy::AudioHardwareInterface::openInputStream ( uint32_t  devices,
int *  format,
uint32_t *  channels,
uint32_t *  sampleRate,
status_t *  status,
AudioSystem::audio_in_acoustics  acoustics 
)
pure virtual

This method creates and opens the audio hardware input stream.

virtual AudioStreamOut* android_audio_legacy::AudioHardwareInterface::openOutputStream ( uint32_t  devices,
int *  format = 0,
uint32_t *  channels = 0,
uint32_t *  sampleRate = 0,
status_t *  status = 0 
)
pure virtual

This method creates and opens the audio hardware output stream.

virtual status_t android_audio_legacy::AudioHardwareInterface::setMasterVolume ( float  volume)
pure virtual

set the audio volume for all audio activities other than voice call.

Range between 0.0 and 1.0. If any value other than NO_ERROR is returned, the software mixer will emulate this capability.

virtual status_t android_audio_legacy::AudioHardwareInterface::setMicMute ( bool  state)
pure virtual
virtual status_t android_audio_legacy::AudioHardwareInterface::setMode ( int  mode)
pure virtual

setMode is called when the audio mode changes.

NORMAL mode is for standard audio playback, RINGTONE when a ringtone is playing, and IN_CALL when a call is in progress.

virtual status_t android_audio_legacy::AudioHardwareInterface::setParameters ( const String8 &  keyValuePairs)
pure virtual
virtual status_t android_audio_legacy::AudioHardwareInterface::setVoiceVolume ( float  volume)
pure virtual

set the audio volume of a voice call.

Range is between 0.0 and 1.0