Skip to content

Commit

Permalink
Remove sample rate parameter usage from examples
Browse files Browse the repository at this point in the history
  • Loading branch information
reuben committed Oct 10, 2019
1 parent 11ad23c commit baaa584
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions examples/ffmpeg_vad_streaming/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const ffmpeg = spawn('ffmpeg', [
]);

let audioLength = 0;
let sctx = model.createStream(AUDIO_SAMPLE_RATE);
let sctx = model.createStream();

function finishStream() {
const model_load_start = process.hrtime();
Expand All @@ -108,7 +108,7 @@ function finishStream() {

function intermediateDecode() {
finishStream();
sctx = model.createStream(AUDIO_SAMPLE_RATE);
sctx = model.createStream();
}

function feedAudioContent(chunk) {
Expand Down
4 changes: 2 additions & 2 deletions examples/net_framework/DeepSpeechWPF/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private async void BtnTranscript_Click(object sender, RoutedEventArgs e)
watch.Start();
await Task.Run(() =>
{
string speechResult = _sttClient.SpeechToText(waveBuffer.ShortBuffer, Convert.ToUInt32(waveBuffer.MaxSize / 2), 16000);
string speechResult = _sttClient.SpeechToText(waveBuffer.ShortBuffer, Convert.ToUInt32(waveBuffer.MaxSize / 2));
watch.Stop();
Dispatcher.Invoke(() =>
{
Expand Down Expand Up @@ -250,7 +250,7 @@ private void _capture_DataAvailable(object sender, DataAvailableEventArgs e)

private void BtnStartRecording_Click(object sender, RoutedEventArgs e)
{
_sttClient.CreateStream(16000);
_sttClient.CreateStream();
_audioCapture.Start();
btnStartRecording.IsEnabled = false;
btnStopRecording.IsEnabled = true;
Expand Down
2 changes: 1 addition & 1 deletion examples/nodejs_wav/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ audioStream.on('finish', () => {
const audioLength = (audioBuffer.length / 2) * ( 1 / 16000);
console.log('audio length', audioLength);

let result = model.stt(audioBuffer.slice(0, audioBuffer.length / 2), 16000);
let result = model.stt(audioBuffer.slice(0, audioBuffer.length / 2));

console.log('result:', result);
});
4 changes: 2 additions & 2 deletions examples/vad_transcriber/wavTranscriber.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ def load_model(models, alphabet, lm, trie):
'''
def stt(ds, audio, fs):
inference_time = 0.0
audio_length = len(audio) * (1 / 16000)
audio_length = len(audio) * (1 / fs)

# Run Deepspeech
logging.debug('Running inference...')
inference_start = timer()
output = ds.stt(audio, fs)
output = ds.stt(audio)
inference_end = timer() - inference_start
inference_time += inference_end
logging.debug('Inference took %0.3fs for %0.3fs audio file.' % (inference_end, audio_length))
Expand Down

0 comments on commit baaa584

Please sign in to comment.