question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

speech-command playRawAudio plays blank audio

See original GitHub issue

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow.js): No
  • OS Platform and Distribution: Windows10
  • TensorFlow.js installed from: npm
  • TensorFlow.js version: 3.2.0
  • speech-command version: 0.5.2
  • Browser version: Version 88.0.4324.192 (Official Build) (x86_64)

Describe the current behavior I’m trying to use playRawAudio method by providing RawAudioData object. Float32Array as data and sampleRateHz:44100.

There’s an audio playing with the same duration of data, but the audio is blank (no audio)

I provided Float32Array array from SpeechCommandRecognizerResult.spectrogram.data in listen function, then concatenated the array using concatenateFloat32Arrays util function

Describe the expected behavior Expected to play the correct audio, not a blank audio.

Standalone code to reproduce the issue Example in Codesandbox

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

4reactions
lina128commented, Mar 18, 2021

If you have a transferRecognizer with collectExample({includeRawAudio = true}). And then get the rawAudio from tranferRecognizer.getExamples()[0].example.rawAudio.

If you just want a generic solution, you need to implement your own.

0reactions
adotnusiyancommented, May 8, 2021

@lina128 I tried your suggestion with basic code from the example in README and the audio doesn’t sound right. You can hear some distortion/glitching in the audio

You can try it yourself in this example

Read more comments on GitHub >

github_iconTop Results From Across the Web

Process Audio Files In Command-Line or Python - HackerNoon
This article shows the basics of handling audio data using command-line tools, and also provides a not-so-deep dive into handling sounds in ...
Read more >
Basic Audio Handling - Medium
This article shows the basics of handling audio data using command-line tools, and also provides a not-so-deep dive into handling sounds in ...
Read more >
sox [global-options] [format-options] infile1
DESCRIPTION. Introduction SoX reads and writes audio files in most popular formats and can optionally apply effects to them. It can combine multiple...
Read more >
linux - Play files as if they were raw audio samples
I once in the past used to play with files by playing them as if they were raw 8bit audio, but I forgot...
Read more >
Playing Audio Files From the Linux Command Line - Baeldung
Learn to play audio files from the Linux command line.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found