
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
webm-to-wav-converter
Advanced tools
Browser's MediaRecorder API generate a audio/webm Blob which is not very useful if you want to do some processing on the audio. This is a simple JavaScript package to convert audio/webm audio recorded in browser into audio/wave format. It doesn't use any Worker to do the conversion.
Here is a quick Demo
import { WavRecorder } from "webm-to-wav-converter";
// or const { WavRecorder } = require("webm-to-wav-converter");
const wavRecorder = new WavRecorder();
// To start recording
wavRecorder.start();
// To stop recording
wavRecorder.stop();
// To get the wav Blob in 16-bit encoding and defualt sample rate
wavRecorder.getBlob();
// To get the wav Blob in 32-bit encoding
wavRecorder.getBlob(true);
// To get the wav Blob in 32-bit encoding with AudioContext options
wavRecorder.getBlob(true, { sampleRate: 96000 });
// To download the wav file in 32-bit encoding with AudioContext options
wavRecorder.download('myFile.wav',true, { sampleRate: 96000 });
audio/wave)
const { getWaveBlob } = require("webm-to-wav-converter");
// or import { getWaveBlob } from "webm-to-wav-converter";
const constraints = { audio: true, video: false };
try {
const stream = await navigator.mediaDevices.getUserMedia(constraints);
const mediaRecorder = new MediaRecorder(stream);
const data = [];
mediaRecorder.ondataavailable = e => e.data.size && data.push(e.data);
mediaRecorder.onstop = () => {
// For 16-bit audio
const wavBlob = getWaveBlob(data,false);
// For 32-bit audio
const wavBlob = getWaveBlob(data,true);
};
} catch (err) {
console.error(err);
};
const { downloadWav } = require("webm-to-wav-converter");
// or import { downloadWav } from "webm-to-wav-converter";
const constraints = { audio: true, video: false };
try {
const stream = await navigator.mediaDevices.getUserMedia(constraints);
const mediaRecorder = new MediaRecorder(stream);
const data = [];
mediaRecorder.ondataavailable = e => e.data.size && data.push(e.data);
mediaRecorder.onstop = () => {
// For 16-bit audio file
downloadWav(data,false);
// For 32-bit audio file
downloadWav(data,true);
};
} catch (err) {
console.error(err);
};
FAQs
JavaScript package to record and convert WAV audio
The npm package webm-to-wav-converter receives a total of 2,718 weekly downloads. As such, webm-to-wav-converter popularity was classified as popular.
We found that webm-to-wav-converter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.