-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
speech-command playRawAudio plays blank audio #4736
Comments
@adotnusiyan |
Not yet. |
Hi @adotnusiyan and @zipweight , I'm investigating this, I'm seeing a sampleRate mismatch error in my browser, not sure if it is related, just fyi: tensorflow/tfjs-models#612 |
Hi @adotnusiyan, I looked at the code you provided, it seems you provide the spectrum data to the playRawAudio function. You need to provide raw audio sound, not the spectrum data. |
How to play the spectrum data as audio? Or how can I get raw audio data from listen function? Thanks |
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 |
System information
Describe the current behavior
I'm trying to use playRawAudio method by providing
RawAudioData
object.Float32Array
as data andsampleRateHz:44100
.There's an audio playing with the same duration of
data
, but the audio is blank (no audio)I provided
Float32Array
array fromSpeechCommandRecognizerResult.spectrogram.data
inlisten
function, then concatenated the array usingconcatenateFloat32Arrays
util functionDescribe the expected behavior
Expected to play the correct audio, not a blank audio.
Standalone code to reproduce the issue
Example in Codesandbox
The text was updated successfully, but these errors were encountered: