cwilso / audiorecorder Goto Github PK
View Code? Open in Web Editor NEWSimple live audio file recorder, based on RecorderJS
License: MIT License
Simple live audio file recorder, based on RecorderJS
License: MIT License
`function initAudio() {
// Older browsers might not implement mediaDevices at all, so we set an empty object first
if (navigator.mediaDevices === undefined) {
navigator.mediaDevices = {};
}
// Some browsers partially implement mediaDevices. We can't just assign an object
// with getUserMedia as it would overwrite existing properties.
// Here, we will just add the getUserMedia property if it's missing.
if (navigator.mediaDevices.getUserMedia === undefined) {
navigator.mediaDevices.getUserMedia = function(constraints) {
// First get ahold of the legacy getUserMedia, if present
var getUserMedia = navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
// Some browsers just don't implement it - return a rejected promise with an error to keep a consistent interface
if (!getUserMedia) {
return Promise.reject(new Error('getUserMedia is not implemented in this browser'));
}
// Otherwise, wrap the call to the old navigator.getUserMedia with a Promise
return new Promise(function(resolve, reject) {
getUserMedia.call(navigator, constraints, resolve, reject);
});
}
}
navigator.mediaDevices.getUserMedia({ audio: true, video: false })
.then(gotStream)
.catch(function(err) {
console.log(err.name + ": " + err.message);
});
}`
The initAudio() function on file main.js, should be changed with the above.
See this at:
https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia
Could you tag your releases and make the changelog directly visible in your GitHub releases? This would increase transparency for potential users and distribution maintainers. Something like https://skywinder.github.io/github-changelog-generator/ could be used to generate the changelog based on merged PRs and closed issues since the last release tag.
would you please tell me if i want to record for 10 seconds, and want it to show the wave on real time
(ex: when it record 3 seconds, then 3/10 timeline of canvas show the wave of record until 3 seconds)
thank you a lot!!
Where is stored the file being recorded?
I'm trying to make a radio and need the file in real time, your system supports it?
dear mr wilson...
can you help me how to display the frequency number ..
like FFT or Spectrum Applicaton...
I have try to make on your code,
but it doesn't work, the frecuency number froze, and the wave doesn't appear..
can you help me,?
regards,
dedet
Hi,
Thanks for wonderful library. I put it on server and using it on client machine. It works on my localhost but not working in client server mode.
There is no request to use the microphone when I open it through other peoples system. Getting message 'Error getting audio'.
In console I am getting following error.
navigator.mozGetUserMedia has been replaced by navigator.mediaDevices.getUserMedia main.js:169:14
MediaStreamError
constraint: ""
message: "The request is not allowed by the user agent or the platform in the current context."
name: "NotAllowedError"
stack: ""
: MediaStreamErrorPrototype { name: Getter, message: Getter, constraint: Getter, … }
main.js:182:21
Can you help me in this?
line 134: view.setUint32(4, 32 + samples.length * 2, true);
Shouldn't this be 36 rather than 32?
on line 128 you assign a buffer:
var buffer = new ArrayBuffer(44 + samples.length * 2);
and write 8 bytes into it, so it would figure that the next length would be 8 bytes smaller, ie 36.
And from a quick count there does appear to be 36 bytes written prior to the
Also see http://soundfile.sapp.org/doc/WaveFormat/
I have downloaded the source code from your repository, but i m getting an error 'Error getting audio'.
So could u help me why i'ts happening?????
thanks........
Hello all,
I have been testing the on-line example of AudioRecorder ( http://webaudiodemos.appspot.com/AudioRecorder/index.html ) with different browsers and Operating Systems and it seems that the example is not working on Firefox.
I tested the last stable version and the Nightly version in Mac OS X 10.8 and Debian 7 Linux.
The getMediaUser() is working because I can see the waveform but when I click at the image to download the wav file, the browser do nothing.
I tried to debug the example with firefox and it seems that work correctly but something it's not working, sure...
Thank you very much,
AudioRecorder is a great app. It allows to record and save, but how can I get it to playback the buffered audio recording prior to saving it? In addition to the Recorder.js, is there another JS library that I'll need to use to play back the buffered audio?
It works fine if I open it on Firefox, but there is no request to use the microphone when I open it through Chrome.
I guess it's because Chrome doesn't support getUserMedia anymore for non HTTPS requests. Good for security but expensive for fun purposes...
Is there anyway to work around that? anyway to make it work on non https website using Chrome?
Thanks in advance! loved your JS examples!
The app works fine online (http://webaudiodemos.appspot.com/AudioRecorder/index.html). But when I download to my local machine and try to run it, it does not work. The icon of a microphone is not clickable. What is the problem?
Currently the app does not work, because nothing starts the AudioContext, which requires a user gesture.
How can this be solved?
I close the application but it lingers on in the drop-down notification area. Only exit I find is by force closing it from Android settings. Is there a way or can it be?
Hi buddy . you did great job already.
I am new to this , can you please help me
how i can save the audio file directly to the server.
I know you will have batter solution guys.
Thanks.
Cool. Just a question. How are we able to record in a specific tempo(not changing bpm after recording)?
idk why but it doesn't work on google chrome(system and android device)
but it work on firefox
I'm recording audio while running recognition with webkitSpeechRecognition. On the desktop (Win7 + latest Chrome) it works perfectly. On Android (also latest Chrome) I get an "either or" behavior. When the recognition is working the audio working, but the output is just a quiet file. When the recording is working (seems random so far) the recognition doesn't output any results. But I get no visible error either way
It works fine in firefox as usual.
But it is not working in chrome or safari.
But web version of this recorder is working in chrome.
This seems to work only with Chrome Canary.
I have a few quick questions regarding the AudioRecorder app.
In my browser, once I grants access to my audio microphone, in JavaScript via the Audio API, is there a way to:
Hello guys,
Great work this AudioRecorder project huh!? Is very cool...
I don't know too much about javascript yet, I would like to send the recorded file to a server or something instead of save in local storage, have any easy way to do that?
Or I will have to change the "core" of the script to be able to do that?
Thanks!
Hi, thank you very much for your sample. One question though, is there any way I can encode the WAV at 16 bit PCM 8k sample rate? I know AudioContext doesn't allow to change the sample rate, but is there any other way of doing this?
I'm asking because the files are pretty large as it is right now, and I'm trying to send the WAV to the server, thus I'm trying to save the users a lot of bandwidth.
Thank you very much. Any idea would help.
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.