diff options
author | lei.bian <mykofzone@gmail.com> | 2011-04-24 00:41:14 +0800 |
---|---|---|
committer | lei.bian <mykofzone@gmail.com> | 2011-04-24 00:41:14 +0800 |
commit | ce372dcaf68dce9ddef0ae4c3223c0fb515a196b (patch) | |
tree | fab1bbc34377762485ae777c07f431c9ee02bfbd | |
parent | ece3f1b6f1e6a67d02e42490eca6c7de62220b57 (diff) | |
download | alsa_sound-ce372dcaf68dce9ddef0ae4c3223c0fb515a196b.tar.gz |
which only set volume of earpiece.
Change-Id: I9cc92d941111b23fb1b7c747ededf0c207731809
-rw-r--r-- | AudioHardwareALSA.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/AudioHardwareALSA.cpp b/AudioHardwareALSA.cpp index cecfb4a..a7687db 100644 --- a/AudioHardwareALSA.cpp +++ b/AudioHardwareALSA.cpp @@ -129,10 +129,13 @@ status_t AudioHardwareALSA::initCheck() status_t AudioHardwareALSA::setVoiceVolume(float volume) { // The voice volume is used by the VOICE_CALL audio stream. - if (mMixer) - return mMixer->setVolume(AudioSystem::DEVICE_OUT_EARPIECE, volume, volume); - else + if (mOutStream) { + // the mOutStream will set the volume of current device + return mOutStream->setVolume(volume, volume); + } else { + // return error return INVALID_OPERATION; + } } status_t AudioHardwareALSA::setMasterVolume(float volume) |