html5-audio

Sending mp3 file through PHP to be used with the audio tag of HTML5 fails in the middle of the mp3

旧巷老猫 提交于 2019-12-23 01:03:54
问题 I'm trying to send my mp3 files through a PHP script in order to hide the path to the file in the HTML. Everything works perfectly fine except half way into the mp3 chrome gives me a GET [URL] error. And the rest of the mp3 is just blank. The audio tag thinks it's still reading the file, but there is no sound. This is how I'm sending the mp3 file from php: if (file_exists($filename)) { header("Content-Transfer-Encoding: binary"); header("Content-Type: audio/mpeg"); header('Content-length: ' .

Not able to play audio using javascript in webview in android

若如初见. 提交于 2019-12-22 13:04:59
问题 On Android phone, audio is playing when i used the following code in html file, but when i remove the "autoplay" attribute i am unable to play the audio on webview. Does anyone has solution for this? <audio id="audiotag1" style="display:none" preload="auto" hidden='true' autoplay> </audio> <script type="text/javascript"> var audio1 = document.getElementById("audiotag1"); audio1.src = "file:///sdcard/Music/intro.mp3"; audio1.type = "audio/mpeg"; audio1.play(); </script> Thanks in advance 回答1:

Streaming MP3: iOS restarts HTML5 audio after 2 minutes

ε祈祈猫儿з 提交于 2019-12-22 10:48:45
问题 I'm trying to stream an mp3 file and play it via HTML5 audio tag. After about 2 minutes, iOS starts playing the audio from the start. I tested this on Safari @ iOS 11.4. Below is simplified code: File: index.html <!DOCTYPE html> <html> <body> <audio controls><source src="audio.php" type="audio/mpeg"></audio> </body> </html> File: audio.php header('Content-Type: audio/mpeg'); header('Content-Disposition: inline; filename="audio.mp3"'); header('X-Pad: avoid browser bug'); header('Cache-Control:

make style on html5 audio player timeline

无人久伴 提交于 2019-12-22 10:16:31
问题 I want to make a style on html5 audio player. <audio id="player" controls="controls"> <source src="song.ogg" type="audio/ogg" /> <!-- using mozilla firefox --> Your browser does not support HTML5 audio. Please upgrade your browser. </audio> Is it possible to put css style on the html5 generic audio player timeline? -thanks. 回答1: The following code, when pasted into Chrome's developer console, reveals a document fragment that describes the audio element's structure: var aud = document

Remove max-width on audio player in Chrome

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-22 10:07:51
问题 I'd like the default HTML5 audio player to fit the width of its parent container. I set its display to 'block' and width to '100%'. However, it seems like Chrome starts to add padding on the left and right sides after surpassing a certain window size: Firefox is behaving as I'd like it to, with the edges of the player reaching exactly to the edge of the parent div: How can I remove this extra padding in Chrome?? EDIT:: As pointed out in the comments, it looks like it's actually a max-width

how to create a button that plays a mp3 google tts

自作多情 提交于 2019-12-22 08:22:25
问题 i'm new here but i hope you can help me. i'm trying to create a button that plays the text to speech mp3 that google generates. i'm creating a translator, so, what i want is to do something like google translate is (in some way). i've tried with javascript and actionscript but i couldn't make it work. i have this javascript function: function audio () { // here i get the word that i want to hear texto = document.getElementById('txt-result-palabra').innerHTML; // now i get the language idioma

HTML 5 AudioElement won't play mp3 Livestreams in safari on IOS 11 devices

﹥>﹥吖頭↗ 提交于 2019-12-22 08:19:10
问题 I'm a web developer at a radio broadcaster. Since the release of IOS 11, we received several user complaints that our audio live streams can't be played on IOS 11 devices anymore. To embed the streams in our websites we use the HTML5 AudioElement. When debugging the javascript on an iPhone whit IOS 11 we recognized that calling the audio elements play() method resulted in a MediaError of ErrorCode 4 (MEDIA_ERR_SRC_NOT_SUPPORTED). All other devices (Android, Windows and IOS 10 and below) play

JavaScript - failing to use createJavaScriptNode?

本小妞迷上赌 提交于 2019-12-22 06:56:04
问题 How to fix this? its failing in past it was working fine but not anymore. (Normally it show green bar in the canvas if you speak in the mic.) <script type="text/javascript"> var navigator = window.navigator; navigator.getMedia = ( navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia); navigator.getMedia({ video: false, audio: true}, function(stream) { console.log('doing....'); audioContext = new webkitAudioContext(); analyser =

Firefox createMediaStreamDestination bug using rtc?

冷暖自知 提交于 2019-12-22 05:39:28
问题 I stream audio over rtc and want to mute and unmute the audio. This works... but no gain control: function(stream) { /* getUserMedia stream */ console.log("Access granted to audio/video"); peer_connection.addStream(stream); } This works on chrome but NOT on Firefox (with gain control) function(stream) { /* getUserMedia stream */ console.log("Access granted to audio/video"); var microphone = context.createMediaStreamSource(stream); gainNode = context.createGain(); var dest = context

I can get audio.currentTime but not set it (in Google Chrome)

吃可爱长大的小学妹 提交于 2019-12-22 05:34:14
问题 This is driving me crazy. Here is the code I use to set current time: $("#audio").click(function(e) { e.preventDefault(); mr_waveform_skip(e) }); function mr_waveform_skip(event) { clientX = event.clientX; left = event.currentTarget.offsetLeft; clickoffset = clientX - left; percent = clickoffset/event.currentTarget.offsetWidth audio_duration = audio_element.duration; duration_seek = percent*audio_duration; audio_element.currentTime = duration_seek; // audio_element.currentTime = 10; console