From: Dima Zavin Date: Tue, 5 Apr 2011 23:03:30 +0000 (-0700) Subject: srec: convert to use new audio.h X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=1b229941e91e25f6fa787b20cd6f53c818b2eb7f;p=android-x86%2Fexternal-srec.git srec: convert to use new audio.h Change-Id: Ifc945f9fd99e40a051406b0a0889967ceae92ece Signed-off-by: Dima Zavin --- diff --git a/audio/AudioIn/UNIX/src/audioinwrapper.cpp b/audio/AudioIn/UNIX/src/audioinwrapper.cpp index 9fb46f5..582d08e 100644 --- a/audio/AudioIn/UNIX/src/audioinwrapper.cpp +++ b/audio/AudioIn/UNIX/src/audioinwrapper.cpp @@ -26,6 +26,7 @@ #include #define N_CHANNELS 1 #else +#include #include #include using namespace android; @@ -95,10 +96,10 @@ int AudioOpen(void) #endif // TODO: get record buffer size from hardware. record = new android::AudioRecord( - android::AUDIO_SOURCE_DEFAULT, + AUDIO_SOURCE_DEFAULT, sampleRate, - android::AudioSystem::PCM_16_BIT, - (numChannels > 1) ? android::AudioSystem::CHANNEL_IN_STEREO : android::AudioSystem::CHANNEL_IN_MONO, + AUDIO_FORMAT_PCM_16_BIT, + (numChannels > 1) ? AUDIO_CHANNEL_IN_STEREO : AUDIO_CHANNEL_IN_MONO, 8*1024, 0); diff --git a/srec_jni/android_speech_srec_MicrophoneInputStream.cpp b/srec_jni/android_speech_srec_MicrophoneInputStream.cpp index 537c4f1..a4be812 100644 --- a/srec_jni/android_speech_srec_MicrophoneInputStream.cpp +++ b/srec_jni/android_speech_srec_MicrophoneInputStream.cpp @@ -28,6 +28,8 @@ #include #include +#include + #include using namespace android; @@ -55,8 +57,8 @@ static JNIEXPORT jint JNICALL Java_android_speech_srec_Recognizer_AudioRecordNew (JNIEnv *env, jclass clazz, jint sampleRate, jint fifoFrames) { android::AudioRecord* ar = new android::AudioRecord( - android::AUDIO_SOURCE_VOICE_RECOGNITION, sampleRate, - android::AudioSystem::PCM_16_BIT, android::AudioSystem::CHANNEL_IN_MONO, + AUDIO_SOURCE_VOICE_RECOGNITION, sampleRate, + AUDIO_FORMAT_PCM_16_BIT, AUDIO_CHANNEL_IN_MONO, fifoFrames, 0); if (ar == NULL) { LOGE("Error creating AudioRecord");