--- url: "https://web.dev/articles/media-recording-audio" titulek: "Recording Audio from the User | Articles | web.dev" h1: "Recording Audio from the User Stay organized with collections Save and categorize content based on your preferences." popis: "Most browsers can get access to the user's microphone." jazyk: "en" kanonicka: "https://web.dev/articles/media-recording-audio" drobecky: ["Articles", "Recording Audio from the User"] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-14 11:11:54" znaku: 9539 slov: 1451 kodovani: "iso-8859-2" sha256: "638c9ce2337057a5ea4b66a9f3d3b9fc2f539220dc68a208b0ab42d25b66022c" --- Recording Audio from the User Stay organized with collections Save and categorize content based on your preferences. Paul Kinlan Many browsers now have the ability to access video and audio input from the user. However, depending on the browser, it might be a full dynamic and inline experience, or it could be delegated to another app on the user's device. Start simple and progressively The easiest thing to do is simply ask the user for a pre-recorded file. Do this by creating a simple file input element and adding an `accept` filter that indicates we can only accept audio files, and a `capture` attribute that indicates we want to get it direct from the microphone. `` This method works on all platforms. On desktop, it will prompt the user to upload a file from the file system (ignoring the `capture` attribute). In Safari on iOS, it will open up the microphone app, allowing you to record audio and then send it back to the web page; on Android, it will give the user the choice of which app to use record the audio in before sending it back to the web page. Once the user has finished recording and they are back in the website, you need to somehow get ahold of the file data. You can get quick access by attaching an `onchange` event to the input element and then reading the `files` property of the event object. ` ` Once you have access to the file, you can do anything you want with it. For example, you can: Attach it directly to an `