JustMicRec: HTML5 JavaScript Microphone [-MP3-] Recording for You

Demo and test

In this section you can try JustMicRec and see how it works.

Note 1: you can pause, preview and resume recording before sending it to server
Note 2: your recordings here are in a public domain and will be live for at least 1 day.

justMicRec: Welcome!

maxTime:     Time left: 00:00

Microphone level:





Your WAV recording (size 0 bytes)
  

Events Log    

Commands

Commands & QueriesDescription
justMicRec.configure({
option: value,
option: value
...
})
Reconfigure JustMicRec for your needs. As a rule you should define path to your actual server-side script for uploading WAV files in hostPath parameter here and define various callbacks to control recording process inside your script.
justMicRec.start([maxTime])Start recording.
maxTime is optional parameter that defines maximum length of recording in seconds, it defaults to 60 seconds (1 minute) if not set. Throws recordingActivity callback during recording process.
justMicRec.stop()Stop/pause recording. Throws recordingStopped callback when recording is actually ready for further usage, such as previewing or uploading to server.
justMicRec.resume()Resume recording.
justMicRec.preview()Start previewing recording.
justMicRec.stoppreview()Stop previewing spawned by justMicRec.preview() command.
justMicRec.sendWAV()Send raw WAV recording to server. Must be runned after recordingStopped event. Throws WAVsendingFinished callback when sending succeeds.
justMicRec.UAhasUserMedia()Find out if current user agent (UA) supports MediaStream interfaces.
justMicRec.getWAVsize()Get the size of recorded WAV blob (in bytes).

Options

PropertyDefaultDescription
hostPath 'micrecajax.php'Pathname for a server side script for uploading recordings
workerPath 'js/justmicrecworker.js'Pathname to recording worker script
Callback functions
recordingError function(e) { alert(e) }Spawns when something goes wrong with recording/uploading process
recordingActivity function(analyserNode, seconds) {}Spawns during recording process about one tenth of second. seconds is time of recording left in seconds and analyserNode is a reference to an audio recorder audio node for visualizing microphone level.
recordingStopped function(){}Spawns when recording interrupts either by timer or by justrec.stop() command and when recording is ready for further manipulations such as previewing or uploading to server
uploadingProcess function(current, total) {}Spawns during uploading process.
WAVsendingFinished function(){}Spawns when WAV file fully transferred to the server by server-side script.

Callbacks

CallbackDescription
recordingError(e)Throws when some error occured. Parameter e is a string describing this error.
recordingActivity(analyserNode, seconds)Throws during recording process. Parameters are: analyserNode - reference to audio node of mic level, seconds - seconds left for recording.
recordingStoppedThrows when recording is being stopped and is ready for further usage - for previewing or uploading to server.
uploadingProcess(current, total)Throws while WAV file is being uploaded to server. current - number of data uploaded already (in bytes), total - size of whole WAV file in bytes. You can find percent of uploaded data by the next formula: Math.round(current / total * 100).
WAVsendingFinishedThrows when recording has been successfully sent to server.


Notes

Recording process

Users should allow microphone access when browser asks them permission to do it.

Actual recording process will start when user first allows it.

Recording is being processed in stereo WAV blob, and is converted to mono WAV file when recording stopped for minimizing requiring disk and memory space usage.

Using server-side script

Recordings are sent to server-side script as raw POST data. You can grab and save it anywhere by server-side script of your choice.

HTML + Flash MP3 Recording

For legacy page with recording using Flash/Action script refer to this page: JustFlashRec



  If you still need some help, please email me to beotiger@gmail.com.


Download

2018-05-05 release
justmicrec.zip (10.23 Kb)

Thank you for using JustMicRec