I can think of two ways.
Within your audio tag:
src="https://stackoverflow.com/questions/21737224/file:///C:/.file.mp3"
or you could use a Blob using the file API.
HTML:
<input type="file"></input>
JS:
audio.src = URL.createObjectURL(document.getElementsByTagName('input')[0].files[0]);
Related Contents:
- How to play audio?
- Setting HTML5 audio position
- HTML5 record audio to file
- HTML5 audio streaming: precisely measure latency?
- Sound effects in JavaScript / HTML5
- How can I add predefined length to audio recorded from MediaRecorder in Chrome?
- HTML5 Audio Looping
- change src with javascript
- HTML5 Audio tag on Safari has a delay
- How do you check if a HTML5 audio element is loaded?
- html5 display audio currentTime
- HTML5 Audio can’t play through Javascript unless triggered manually once
- How can I add multiple sources to an HTML5 audio tag, programmatically?
- HTML5 audio playlist – how to play a second audio file after the first has ended?
- Fastest way to flatten / un-flatten nested JSON objects
- change type of input field with jQuery
- Callback after all asynchronous forEach callbacks are completed
- Most efficient way to convert an HTMLCollection to an Array
- Case insensitive regex in JavaScript
- Is it possible to gain access to the closure of a function?
- How to check a not-defined variable in JavaScript
- Javascript close alert box
- Dangerous implications of Allman style in JavaScript
- ES6 Array destructuring weirdness
- Angular2 : render a component without its wrapping tag
- Can jQuery .keypress() detect more than one key at the same time?
- Sum of array object property values in new array of objects in Javascript [duplicate]
- How do I check if string contains substring? [duplicate]
- “Access is denied” JavaScript error when trying to access the document object of a programmatically-created (IE-only)
- Is there a downside to using ES6 template literals syntax without a templated expression?
- Find day difference between two dates (excluding weekend days)
- Does a javascript if statement with multiple conditions test all of them?
- How to request the Garbage Collector in node.js to run?
- How do I replace the entire HTML node using jQuery
- Why can’t we have return in the ternary operator?
- BigDecimal in JavaScript
- Lodash – difference between .extend() / .assign() and .merge()
- document.body.scrollTop Firefox returns 0 : ONLY JS
- Can’t get currentUser on load
- stop all instances of node.js server
- how to make sure only my own website (clientside code) can talk to Firebase backend?
- Phone mask with jQuery and Masked Input Plugin
- How to pass a javascript variable into a erb code in a js view?
- Pattern for CoffeeScript modules [duplicate]
- Uploading Image to Amazon s3 with HTML, javascript & jQuery with Ajax Request (No PHP)
- JavaScript resize event on scroll – mobile
- How do I unset an element in an array in javascript?
- Null Conditional Operators
- Determining whether one array contains the contents of another array in JavaScript/CoffeeScript
- HTML5 drop event doesn’t work unless dragover is handled