Android-x86
Fork
Spenden

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-srec: Commit

external/srec


Commit MetaInfo

Revision1b229941e91e25f6fa787b20cd6f53c818b2eb7f (tree)
Zeit2011-04-26 08:10:33
AutorDima Zavin <dima@andr...>
CommiterDima Zavin

Log Message

srec: convert to use new audio.h

Change-Id: Ifc945f9fd99e40a051406b0a0889967ceae92ece
Signed-off-by: Dima Zavin <dima@android.com>

Ändern Zusammenfassung

Diff

--- a/audio/AudioIn/UNIX/src/audioinwrapper.cpp
+++ b/audio/AudioIn/UNIX/src/audioinwrapper.cpp
@@ -26,6 +26,7 @@
2626 #include <fcntl.h>
2727 #define N_CHANNELS 1
2828 #else
29+#include <hardware/audio.h>
2930 #include <media/AudioRecord.h>
3031 #include <media/mediarecorder.h>
3132 using namespace android;
@@ -95,10 +96,10 @@ int AudioOpen(void)
9596 #endif
9697 // TODO: get record buffer size from hardware.
9798 record = new android::AudioRecord(
98- android::AUDIO_SOURCE_DEFAULT,
99+ AUDIO_SOURCE_DEFAULT,
99100 sampleRate,
100- android::AudioSystem::PCM_16_BIT,
101- (numChannels > 1) ? android::AudioSystem::CHANNEL_IN_STEREO : android::AudioSystem::CHANNEL_IN_MONO,
101+ AUDIO_FORMAT_PCM_16_BIT,
102+ (numChannels > 1) ? AUDIO_CHANNEL_IN_STEREO : AUDIO_CHANNEL_IN_MONO,
102103 8*1024,
103104 0);
104105
--- a/srec_jni/android_speech_srec_MicrophoneInputStream.cpp
+++ b/srec_jni/android_speech_srec_MicrophoneInputStream.cpp
@@ -28,6 +28,8 @@
2828 #include <media/AudioRecord.h>
2929 #include <media/mediarecorder.h>
3030
31+#include <hardware/audio.h>
32+
3133 #include <jni.h>
3234
3335 using namespace android;
@@ -55,8 +57,8 @@ static JNIEXPORT jint JNICALL Java_android_speech_srec_Recognizer_AudioRecordNew
5557 (JNIEnv *env, jclass clazz, jint sampleRate, jint fifoFrames) {
5658
5759 android::AudioRecord* ar = new android::AudioRecord(
58- android::AUDIO_SOURCE_VOICE_RECOGNITION, sampleRate,
59- android::AudioSystem::PCM_16_BIT, android::AudioSystem::CHANNEL_IN_MONO,
60+ AUDIO_SOURCE_VOICE_RECOGNITION, sampleRate,
61+ AUDIO_FORMAT_PCM_16_BIT, AUDIO_CHANNEL_IN_MONO,
6062 fifoFrames, 0);
6163 if (ar == NULL) {
6264 LOGE("Error creating AudioRecord");
Show on old repository browser