Remove sample rate parameter usage from Java binding
This commit is contained in:
parent
385279bc20
commit
1007d93da2
|
@ -100,7 +100,7 @@ public class DeepSpeechActivity extends AppCompatActivity {
|
|||
|
||||
long inferenceStartTime = System.currentTimeMillis();
|
||||
|
||||
String decoded = this._m.stt(shorts, shorts.length, sampleRate);
|
||||
String decoded = this._m.stt(shorts, shorts.length);
|
||||
|
||||
inferenceExecTime = System.currentTimeMillis() - inferenceStartTime;
|
||||
|
||||
|
|
|
@ -104,9 +104,9 @@ public class BasicTest {
|
|||
ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN).asShortBuffer().get(shorts);
|
||||
|
||||
if (extendedMetadata) {
|
||||
return metadataToString(m.sttWithMetadata(shorts, shorts.length, sampleRate));
|
||||
return metadataToString(m.sttWithMetadata(shorts, shorts.length));
|
||||
} else {
|
||||
return m.stt(shorts, shorts.length, sampleRate);
|
||||
return m.stt(shorts, shorts.length);
|
||||
}
|
||||
} catch (FileNotFoundException ex) {
|
||||
|
||||
|
|
|
@ -59,12 +59,11 @@ public class DeepSpeechModel {
|
|||
* @param buffer A 16-bit, mono raw audio signal at the appropriate
|
||||
* sample rate.
|
||||
* @param buffer_size The number of samples in the audio signal.
|
||||
* @param sample_rate The sample-rate of the audio signal.
|
||||
*
|
||||
* @return The STT result.
|
||||
*/
|
||||
public String stt(short[] buffer, int buffer_size, int sample_rate) {
|
||||
return impl.SpeechToText(this._msp, buffer, buffer_size, sample_rate);
|
||||
public String stt(short[] buffer, int buffer_size) {
|
||||
return impl.SpeechToText(this._msp, buffer, buffer_size);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -74,12 +73,11 @@ public class DeepSpeechModel {
|
|||
* @param buffer A 16-bit, mono raw audio signal at the appropriate
|
||||
* sample rate.
|
||||
* @param buffer_size The number of samples in the audio signal.
|
||||
* @param sample_rate The sample-rate of the audio signal.
|
||||
*
|
||||
* @return Outputs a Metadata object of individual letters along with their timing information.
|
||||
*/
|
||||
public Metadata sttWithMetadata(short[] buffer, int buffer_size, int sample_rate) {
|
||||
return impl.SpeechToTextWithMetadata(this._msp, buffer, buffer_size, sample_rate);
|
||||
public Metadata sttWithMetadata(short[] buffer, int buffer_size) {
|
||||
return impl.SpeechToTextWithMetadata(this._msp, buffer, buffer_size);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -87,12 +85,11 @@ public class DeepSpeechModel {
|
|||
* by this function can then be passed to feedAudioContent()
|
||||
* and finishStream().
|
||||
*
|
||||
* @param sample_rate The sample-rate of the audio signal.
|
||||
* @return An opaque object that represents the streaming state.
|
||||
*/
|
||||
public DeepSpeechStreamingState createStream(int sample_rate) {
|
||||
public DeepSpeechStreamingState createStream() {
|
||||
SWIGTYPE_p_p_StreamingState ssp = impl.new_streamingstatep();
|
||||
impl.CreateStream(this._msp, sample_rate, ssp);
|
||||
impl.CreateStream(this._msp, ssp);
|
||||
return new DeepSpeechStreamingState(impl.streamingstatep_value(ssp));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue