Stream audio from the microphone connected to your browser to a node js server.
You can change the encoding of the saved audio from "WAV" to "MP3" in config.json
install dependencies:
npm install
run:
npm start
HTML5 realtime audio streaming to nodejs
Hi, I downloaded a copy of this project and installed it on my localhost to test. When I run the server.js with nodejs a browser tab opens automatically to https://localhost:9191 and nothing loads from the server. I see a message on the browser screen saying "Cannot GET /", and there's no output in the console from the server. I tried this in Firefox and Chrome, same error in both.
Any idea why?
I also noticed that in site.js for the client you have this:
socket = new WebSocket('ws://localhost:9000/demo');
but the server listens on 9191, so I'm not sure why it points to port 9000 over an insecure connection (ws://).
I want to save the file name as the value of the data passed in the client page. (index.html (convert to index.ejs))
What should I do?
Hi my audio out like voice donald duck, you have any sugestion ?
noamtcohen, thanks for this great project! I would like to know though, is there anyway to set a max record length time / file size on the server side js?
Thanks
The re-smapler code works after the last change and I could use it with sample rate of 8000 (128kbps), also the delay is better ; however, the Chrome browser crashes after a few minutes.
The chrome doesn't leave anything that I could catch in debug, it just moves suddenly to the "Ah snap. something went wrong..."
I tried increasing the buffer with no help, but what I did notice is that if the page I am using has additional traffic, like a player streaming it crashes much faster and when reverting to without the re-sampler, it doesn't happen.
Any idea how to debug it?
It works on chrome, but the button does nothing on Safari. Any suggestions?
The audio is being saved, but how can I actually listen to the audio? Have you build another page where I can "press play" and listen to the live stream?
hi, when I click on start recording on the client side just creates an empty wav-file on the server side. I have installed the two required modules but I am not that experienced with node.js.. what could I possibly do wrong? thanks
Hello! Thank you for such an awesome streamer. Could you tell if there is possible to record data as well as stream it to other clients?
Hello,
I want to process the live stream coming from the browser and for that, I'll need to save small chunks, say 2 seconds each of the audio.
The end result might look something like 1.wav, 2.wav, 3.wav etc. where every file is 2 seconds long.
I tried different approaches but was unable to make it work properly.
I would appreciate any help :)
Thanks!
How do I automatically stop recording during a long pause?
Maybe consider adding your private key to your .gitignore so not everyone can see it.
I want to use good examples.
However, I would like to change what is wss to http post using ajax or axios.
In site.js, is the client sent as wss, resampler-worker.js in resample to postMessage, and delivered to its own server?
I tried with axios directly but it does not work. What should I do?
There's a problem on lame encoder when encoding to Mp3 returning segmentation fault. I've just downloaded the project files and changed config.json to Mp3. Is there any configuration in lame that should be done prior to executing the code?
Hi, thanks for the solution, simple and nice.
I need to play the sound in real time instead of saving it. Any suggestions, how can I achieve it?
Regards
Hi Noam
I noticed you have added a re-sampler code, I tried loading it on the client page together with the site.js, etc...
In the server.js, still when I change the sample rate to anything that is 44100, the sound is distorted, because its working only on the playback.
Its a great solution and with the option to lower the bit rate (lower the sample), it can be economic and more reliable. Right now its using more than 700kbps.
Thanks,
Yaki
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.