-
Notifications
You must be signed in to change notification settings - Fork 5
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
live streaming wav is inconsistent / stops #1
Comments
What is the input audio stream format and what is logged at the |
Hey. i'm using this https://www.npmjs.com/package/node-portaudio it's says raw audio but your wav codec works just fine. I can't log / find anything that show me why it drops :/ PS : working on the port-message branch. |
If you have control over the input stream you can remove WAV header and use s16le to avoid remoal of the first 44 bytes. Is input 1 channel or 2 channel? What is the sampling rate? |
Here is my input for now (using my iphone ear / mic for now). Works like a charm but stops. Tried other branches of your repo :) Wasm memory hearing seems to be limited by the duration of the memory allowed. Not sure to understand this "and use s16le to avoid remoal of the first 44 bytes" but very nice of you to answer. |
According to https://www.npmjs.com/package/node-portaudio
Can you upload the WAV file here so that we can test using the same code? |
See http://www.topherlee.com/software/pcm-tut-wavformat.html, https://github.com/guest271314/AudioWorkletStream/blob/message-port-post-message/audioWorklet.js#L12. |
well it's actually not a file but a live stream from my mic. actually if you are interested and have time i can MP you a link ? |
Interesting. Thanks. I actually removed this part // accumulate 344 * 512 * 1.5 of data (to achieve real time, maybe that's what causing latency) |
You should be able to record the microphone output per the NPM documentation. To capture microphone directly see also guest271314/SpeechSynthesisRecorder#17 (comment), https://github.com/guest271314/setUserMediaAudioSource, https://github.com/guest271314/captureSystemAudio.
This is capable of streaming without waiting for accumulation of data https://github.com/guest271314/webtransport/blob/main/webTransportAudioWorkletWebAssemblyMemoryGrow.js. |
Actually i'm not trying to record but to stream :) (server to browser, ie soundcard input (node server) to browser (client) ) your last link looks very nice, you think i can use it with an endless wav/raw stream ? |
It is difficult to test and verify "endless" https://bugs.chromium.org/p/chromium/issues/detail?id=1161429. During testing I streamed 8 hours of audio yesterday. Capturing entire system output or specific application audio output is possible by creating a virtual microphone and setting the source to an application or user-defined stream, at the browser capturing with The |
Thanks you very much for all the explaination. Yes navigator.mediaDevice.getUserMedia({audio: true}) but not working for what i want since i want the server to be the source :/ I'll take a look at all your links. All this is still very complicated and confused for me ! 🤪 You look way beyond everyone on the internet regarding this specifics API !! Have a good evening. |
For an "infinite" or "endless" audio stream I would try using |
Thanks a ton. i'll look into that ! |
Is this issue resolved? |
héhé. i'm not that fast. i have to understand all the sources you gave me :) |
HI @guest271314 i was reading this whole thread. looks like exaclty what i was trying to achieve : wasmerio/wasmer-php#121 (except using node instead of php passthru) did you make anyprogress on this ? regarding memory grow / duration ? Thank you; |
The Native Messaging, PHP Craeting a virtual microphone device and using |
Hi @guest271314 i'm now having fun with your MessagePort.postMessage() branch. From what i understand the time limit should be limited by the Uint8Array size of the AudioWorkletProcessor. I still have inconsistency in the playback (stops occurs after few seconds, sometimes a minute) but i suspect my wav stream to be to inconsistent (too big ?). the appendBuffers log shows huge variation in the array length so there must be a issue here. Still digging ! |
Think i found a hack (ugly ?) issues indeed occurs when index was lower than offset // magic "if" hack 😅 if( this.offset < this.index ){
} |
The offset is the bytes read, the index is the bytes written.
One solution
|
Hi ! My "hack" works like a charm. Before that it actually stopped every time index was beyond offset (i suppose it make sense). Now it never stops. |
HI there ! |
For the
Sending to
the response is
the
that we |
To install
create the necessary certificates https://github.com/guest271314/webtransport/blob/main/quic_transport_server_tts.py#L40, launch Chrome or Chromium with the appropriate flags found in the same comment block. Note, I commented, do not use |
awesome, thanks a lot. |
Relevant to running the code at |
Hi, first of all i would like to thank you for that POC / Script. Exactly what i was looking for. Amazing work.
But I ran into an issue when i started to stream a "live stream". Actually raw audio stream from a node server (using node port audio). It works well for few seconds. (maybe a minute) then sounds is muted / gone. Do you think it's buffer related ? network issue ? For information i'm trying to broadcast audio without latency from node portaudio to the browser. I thought your script was a good way to start !
Thanks for your time. Benoit
The text was updated successfully, but these errors were encountered: