Fix checks for audio format.
Change-Id: I43e9a94f8ddd46f72d24e06d72702f354bbeae46
diff --git a/core/java/android/speech/tts/FileSynthesisCallback.java b/core/java/android/speech/tts/FileSynthesisCallback.java
index c7a4ccc..dea766b 100644
--- a/core/java/android/speech/tts/FileSynthesisCallback.java
+++ b/core/java/android/speech/tts/FileSynthesisCallback.java
@@ -104,8 +104,8 @@
Log.d(TAG, "FileSynthesisRequest.start(" + sampleRateInHz + "," + audioFormat
+ "," + channelCount + ")");
}
- if (audioFormat != AudioFormat.ENCODING_PCM_8BIT ||
- audioFormat != AudioFormat.ENCODING_PCM_16BIT ||
+ if (audioFormat != AudioFormat.ENCODING_PCM_8BIT &&
+ audioFormat != AudioFormat.ENCODING_PCM_16BIT &&
audioFormat != AudioFormat.ENCODING_PCM_FLOAT) {
Log.e(TAG, "Audio format encoding " + audioFormat + " not supported. Please use one " +
"of AudioFormat.ENCODING_PCM_8BIT, AudioFormat.ENCODING_PCM_16BIT or " +
diff --git a/core/java/android/speech/tts/PlaybackSynthesisCallback.java b/core/java/android/speech/tts/PlaybackSynthesisCallback.java
index a6fb543..dcc0095 100644
--- a/core/java/android/speech/tts/PlaybackSynthesisCallback.java
+++ b/core/java/android/speech/tts/PlaybackSynthesisCallback.java
@@ -123,8 +123,8 @@
public int start(int sampleRateInHz, int audioFormat, int channelCount) {
if (DBG) Log.d(TAG, "start(" + sampleRateInHz + "," + audioFormat + "," + channelCount
+ ")");
- if (audioFormat != AudioFormat.ENCODING_PCM_8BIT ||
- audioFormat != AudioFormat.ENCODING_PCM_16BIT ||
+ if (audioFormat != AudioFormat.ENCODING_PCM_8BIT &&
+ audioFormat != AudioFormat.ENCODING_PCM_16BIT &&
audioFormat != AudioFormat.ENCODING_PCM_FLOAT) {
Log.w(TAG, "Audio format encoding " + audioFormat + " not supported. Please use one " +
"of AudioFormat.ENCODING_PCM_8BIT, AudioFormat.ENCODING_PCM_16BIT or " +