mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-24 12:28:10 +00:00
Replace SpeechSynthesis.getBufferSizeInBytes with a constant in the C++ source, specified in the correct units (milliseconds).
This commit is contained in:
@@ -51,7 +51,6 @@ public class SpeechSynthesis {
|
||||
|
||||
public static final int CHANNEL_COUNT_MONO = 1;
|
||||
public static final int FORMAT_PCM_S16 = 2;
|
||||
public static final int BUFFER_SIZE_IN_MILLIS = 1000;
|
||||
|
||||
static {
|
||||
System.loadLibrary("ttsespeak");
|
||||
@@ -103,10 +102,6 @@ public class SpeechSynthesis {
|
||||
return FORMAT_PCM_S16;
|
||||
}
|
||||
|
||||
public int getBufferSizeInBytes() {
|
||||
return (BUFFER_SIZE_IN_MILLIS * mSampleRate) / 1000;
|
||||
}
|
||||
|
||||
private Locale getLocaleFromLanguageName(String name) {
|
||||
if (mLocaleFixes.containsKey(name)) {
|
||||
return mLocaleFixes.get(name);
|
||||
@@ -287,7 +282,7 @@ public class SpeechSynthesis {
|
||||
return;
|
||||
}
|
||||
|
||||
mSampleRate = nativeCreate(mDatapath, BUFFER_SIZE_IN_MILLIS);
|
||||
mSampleRate = nativeCreate(mDatapath);
|
||||
if (mSampleRate == 0) {
|
||||
Log.e(TAG, "Failed to initialize speech synthesis library");
|
||||
return;
|
||||
@@ -312,7 +307,7 @@ public class SpeechSynthesis {
|
||||
|
||||
private static native final boolean nativeClassInit();
|
||||
|
||||
private native final int nativeCreate(String path, int bufferSizeInMillis);
|
||||
private native final int nativeCreate(String path);
|
||||
|
||||
private native final static String nativeGetVersion();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user