I would like to have a block of JavaScript like this but this does not seem to be valid.
MYAPP.audioRecording = {
var navigator = window.navigator;
var Context = window.AudioContext || window.webkitAudioContext;
var context = new Context();
navigator.getUserMedia = (
navigator.getUserMedia ||
navigator.webkitGetUserMedia ||
navigator.mozGetUserMedia ||
navigator.msGetUserMedia
);
function startRecorder() {
//start recording code
}
function stopRecorder() {
//recorder stop
}
}
I then would like to call the startRecorder() and stopRecorder() functions from another block of code like this.
MYAPP.recordingManager = {
MYAPP.audioRecording.startRecorder();
MYAPP.audioRecording.stopRecorder();
}
I appreciate any help you can provide. Thanks!