html5-audio

HTML5 audio player drag and drop

杀马特。学长 韩版系。学妹 提交于 2019-12-12 02:33:17
问题 I'm implementing audio player in html5, which has drag-drop option for load and play mp3 files, but I have problem with plaing the file. When the file is dropped on the area, I can see in the console properties of object, but there is no information about absolute path, because of security in web browser. Is there an option, how to play mp3 this way ? index.html and body content: <div style="border: 1px solid black; width: 200px; height: 50px; padding: 10px;"" id="cudl">add file here</div>

Issues with HTML5 Audio Visualiser

不想你离开。 提交于 2019-12-11 20:35:34
问题 I am experimenting with code that I found on a website. The source of it is here: http://themaninblue.com/experiment/webAudioAPI/Source.zip Now the thing is: with a local file it works fine, but when I attempt to connect to a file that is on the Internet (basically changing the src attribute from audio), it plays, but I can't hear anything. Further, the visualizer is not doing anything. Edit: The only thing I changed in the HTML Code is: <audio id="music" src="http://www.mfiles.co.uk/mp3

playing a sound using html5/javascript

≡放荡痞女 提交于 2019-12-11 18:22:10
问题 My Problem: I would like a user to hear a sound of some sort if a number is over 100. If (x > 100) { play sound } How would I go about this using html5/javascript. Is it possible to play sound without having an inline little video clip. The only stuff I've seen thus far has those little quicktime players embedded within the page: http://www.w3schools.com/html/html_sounds.asp Hopefully there's a better solution? Thanks 回答1: Use an <audio> element. var foo = document.createElement('audio'); foo

Run function after audio is loaded

被刻印的时光 ゝ 提交于 2019-12-11 17:37:12
问题 I want to run a function after checking if an audio file is downloaded. My js: // https://freesound.org/people/jefftbyrd/sounds/486445/ var audioFile = "https://raw.githubusercontent.com/hitoribot/my-room/master/audio/test/test.mp3"; var audioElem = document.querySelector("audio"); var startElem = document.querySelector("button"); var resultScreen = document.querySelector("p"); function checkAudio() { audioElem.setAttribute("src", audioFile); if (audioElem.complete) { resultScreen.innerHTML =

Html audio player audio stops in the middle

我只是一个虾纸丫 提交于 2019-12-11 16:45:36
问题 I am using simple html audio player here: <source src="TestFile.mp3" type="audio/mpeg" /> Works fine in windows, mac safari. Also works fine in IPhone5s. But works partially in higher version of iPhone device (iPhone 7). Audio stops in the middle of the audio. For Example if audio duration is 1.45 min. Audio stops in 1.01 min. Please share any other suggestion. Thanks in advance! 回答1: We got the answer from after lot of surfing in online for the issue related to audio player not playing the

Caching sounds on Mobile Safari

两盒软妹~` 提交于 2019-12-11 16:27:46
问题 I have to play very short sounds on UI events (pressing a button, showing a popup) in my iOS web-app. I do it the following way: // Standard HTML5 implementation of PlaySound. function Html5PlaySound(sound) { var player = document.getElementById('soundPlayer'); player.pause(); player.setAttribute('src', 'sound/' + sound + '.mp3'); player.play(); } Unfortunately, it's being reloaded every time (I see 'waiting circle' in the title bar). Is it possible to force somehow iPhone to cache the sounds

Play a (short) sound extremely frequently?

南笙酒味 提交于 2019-12-11 13:11:19
问题 I want to create a metronome using setInterval . I want to be able to reach high bpms like 300 bpm. Even if the file is short enough to be played as many times as it's needed, it will hiccup very easily. Furthermore, many browsers have issues with short audio files - Safari for MP3 and Firefox for WAV. I tried using multiple files as you see below, to no avail. metronome = setInterval(function () { if (!tick.played) { tick.play(); } else { tick2.play(); } }, 200); // = 300 bmp How can I play

Internet Explorer 11 and Html5 Sound playback

蓝咒 提交于 2019-12-11 12:20:09
问题 I have a JSFiddle that has both a regular html5 <audio> tag in it for playback, as well a a call to the javascript Audio() function. As expected, in Chrome/Firefox/IE10 these work, but in IE11 (came with windows 8.1 yesterday) neither of these methods work and I get a "Error: Not implemented " exception. I haven't yet seen any documentation that Audio doesn't work on IE11 - is my installation just screwed up, or do others with IE11 see this as well? JSFiddle Here Also, heading over to http:/

wavesurfer.js multiple instances on page

我是研究僧i 提交于 2019-12-11 11:47:26
问题 I'm using wavesurfer.js which works fine when there is only one instance on the page, but I have multiple instances and have no idea (as I am a total javascript novice) how to link the play button to different instances. I just need some help... this is what I have so far <div id="demoOne"> <div id="trackOne"> <script type="text/javascript"> var wavesurfer = Object.create(WaveSurfer); wavesurfer.init({ container: document.querySelector('#trackOne'), waveColor: '#fff', progressColor: '#000',

HTML5 Audio: Music does not stop even after navigating away from the website

泄露秘密 提交于 2019-12-11 08:27:12
问题 I'm making a mobile game using HTML5. There is a background music that runs during the gameplay and should ideally stop once I navigate to another page... The logic works properly on older iPhones and android. However, on iPhone 4 and iPads the music doesn't stop and continues to play (even when I navigate to another website) until the browser is closed. Of course there is a call music_var.pause() function in the code as well as the unload handler... but this simply doesn't seem to work. Any