Simply put there is no built-in cross browser way to record audio to a common format.

The MediaRecorder API is supported in most modern browsers, but does encode audio in any shared codec. This means that Chrome may support recording and encoding audio with the webm format, and Safari may not support playback of that type. Let alone you may want to record audio in a different format like wav or mp3 which may not be supported by the browser at all.

However, there are polyfills and libraries that can help you record audio in the browser, and this example uses the extendable-media-recorder to record to wav format.