Posts

Showing posts from March, 2023

Mp3 converter

 <!DOCTYPE html> <html> <head> <title>MP4 to MP3 Converter</title> <script> function convertToMP3() { // Get the input file and file name var input = document.getElementById("mp4file"); var fileName = input.value.split("\\").pop(); // Check if the file type is MP4 if (!fileName.endsWith(".mp4")) { alert("Please select an MP4 file."); return; } // Create an instance of the FileReader var reader = new FileReader(); // When the FileReader has loaded the file contents reader.onload = function() { // Convert the MP4 data to an audio Blob var audioBlob = new Blob([reader.result], {type: "audio/mp3"}); // Create a URL for the audio Blob var audioURL = URL.createObjectURL(audioBlob); // Create a link to download the MP3 file var downloadLink = document.createElement("a"); downloadLink.href = audioURL; do...