speech-command playRawAudio plays blank audio
See original GitHub issueSystem 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:
- Created 3 years ago
- Comments:8
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
@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