Skip to content

Audio Converter to WAV with Browser Javascript. Supported formats: MP3, M4A, WMA, WAV, FLAC, OGG, WEBM/A

License

Notifications You must be signed in to change notification settings

ewwink/AudioToWAV

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AudioToWAV

Convert audio to .wav file with Browser Javascript.

Supported formats: MP3, M4A, WMA, WAV, FLAC, OGG, WEBM, WEBA, OPUS

it use Web API decodeAudioData and OfflineAudioContext

Example

Run on JSFiddle

<input type="file" id="audioInput" accept="audio/*" />
<button id="btnConvert">convert</button>

<script src="https://cdn.jsdelivr.net/gh/ewwink/AudioToWAV@main/audio-to-wav.min.js"></script>
<script>
    document.querySelector('#btnConvert').addEventListener('click', async function(e) {
        let audioInput = document.querySelector('#audioInput')
        let audio = new AudioToWAV(audioInput.files[0])
        // audio.setSampleRate(44100) // optional, default set to 24000 or 24Khz
        // await audio.convert(); // convert only to wav blob
        // console.log(audio.wavBlob)
        audio.download(); // convert and download
    })
</script>

credit: here

About

Audio Converter to WAV with Browser Javascript. Supported formats: MP3, M4A, WMA, WAV, FLAC, OGG, WEBM/A

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published