summaryrefslogtreecommitdiffstats
path: root/pico/compat/jni
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2011-05-19 12:58:09 +0100
committerNarayan Kamath <narayan@google.com>2011-05-19 13:05:06 +0100
commit7ffd31ba2584359996e04cd3d4d92f810d651066 (patch)
tree2bbf666287f40747e9312d472e36716ce6647dce /pico/compat/jni
parentbfbc7bf7fe84b27752a9da51caab1cc96718ee67 (diff)
downloadexternal_svox-7ffd31ba2584359996e04cd3d4d92f810d651066.zip
external_svox-7ffd31ba2584359996e04cd3d4d92f810d651066.tar.gz
external_svox-7ffd31ba2584359996e04cd3d4d92f810d651066.tar.bz2
Break dependency between pico and the audio system.
The TTS engine should use only TTS defined constants, and not constants from the audiosystem. This happened to work because PCM_16_BIT in native was the same as DEFAULT in java, which happened to be PCM_16_BIT. Change-Id: I0f43a46afff8c45d1eb18c1beaab62dce87b8055
Diffstat (limited to 'pico/compat/jni')
-rw-r--r--pico/compat/jni/com_android_tts_compat_SynthProxy.cpp5
-rw-r--r--pico/compat/jni/tts.h5
2 files changed, 9 insertions, 1 deletions
diff --git a/pico/compat/jni/com_android_tts_compat_SynthProxy.cpp b/pico/compat/jni/com_android_tts_compat_SynthProxy.cpp
index c9c38c4..f410ee5 100644
--- a/pico/compat/jni/com_android_tts_compat_SynthProxy.cpp
+++ b/pico/compat/jni/com_android_tts_compat_SynthProxy.cpp
@@ -40,6 +40,11 @@
#define FILTER_GAIN 5.5f // linear gain
// android.media.AudioFormat.ENCODING_ values
+//
+// Note that these constants are different from those
+// defined in the native code (system/audio.h and others).
+// We use them because we use a Java AudioTrack to play
+// back our data.
#define AUDIO_FORMAT_ENCODING_DEFAULT 1
#define AUDIO_FORMAT_ENCODING_PCM_16_BIT 2
#define AUDIO_FORMAT_ENCODING_PCM_8_BIT 3
diff --git a/pico/compat/jni/tts.h b/pico/compat/jni/tts.h
index fb15108..9e05c9d 100644
--- a/pico/compat/jni/tts.h
+++ b/pico/compat/jni/tts.h
@@ -14,7 +14,7 @@
* limitations under the License.
*/
#ifndef ANDROID_TTS_H
-#define ANDROID_TTS_H
+#define ANDROID_TTS_H
// This header defines the interface used by the Android platform
// to access Text-To-Speech functionality in shared libraries that implement
@@ -62,6 +62,9 @@ typedef enum {
} android_tts_callback_status_t;
// Supported audio formats
+//
+// NOTE: This is duplicated in compat/include/TtsEngine.h
+// Please make changes there as well.
typedef enum {
ANDROID_TTS_AUDIO_FORMAT_INVALID = -1,
ANDROID_TTS_AUDIO_FORMAT_DEFAULT = 0,