html5-audio

Playing multiple sounds in Chrome

人走茶凉 提交于 2019-12-06 07:29:26
问题 I am developing a HTML5 game for Facebook. I have the following HTML code: <audio style="visibility: hidden;" controls="controls" id="sound-0"> <source src="sound/sound_new.ogg" type="audio/ogg"/> <source src="sound/sound_new.mp3" type="audio/mp3"/> </audio> <audio style="visibility: hidden;" controls="controls" id="sound-1"> <source src="sound/sound_new.ogg" type="audio/ogg"/> <source src="sound/sound_new.mp3" type="audio/mp3"/> </audio> <audio style="visibility: hidden;" controls="controls"

Cracks in webaudio playback during streaming of raw audio data

爱⌒轻易说出口 提交于 2019-12-06 07:21:31
问题 I have a server sending chunks of raw audio over a websocket. The idea is to retrieve those and play them in a way to have the smoothest playback possible. Here is the most important piece of code: ws.onmessage = function (event) { var view = new Int16Array(event.data); var viewf = new Float32Array(view.length); audioBuffer = audioCtx.createBuffer(1, viewf.length, 22050); audioBuffer.getChannelData(0).set(viewf); source = audioCtx.createBufferSource(); source.buffer = audioBuffer; source

HTML5 Audio Buffer getting stuck

蓝咒 提交于 2019-12-06 07:09:42
问题 I'm using the HTML5 webkitAudioContext to get the realtime levels of a user's microphone using this following code: var liveSource; function getLevel(){ var context = new webkitAudioContext(); navigator.webkitGetUserMedia({audio: true}, function(stream) { liveSource = context.createMediaStreamSource(stream); liveSource.connect(context.destination); var levelChecker = context.createJavaScriptNode(4096, 1 ,1); liveSource.connect(levelChecker); levelChecker.connect(context.destination);

Not able to play audio using javascript in webview in android

陌路散爱 提交于 2019-12-06 07:01:24
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 Try using this code snippet //String[] temp = cm.message().split("#"); AudioManager audiomanager=

Hide HTML5 Audio/Video notification in Android Chrome

痞子三分冷 提交于 2019-12-06 06:03:07
I have an HTML5 Audio element on my web app. At some point, I programmatically stop the playback, using this code: audioElement.pause(); audioElement.currentTime = 0; When the audio is playing, there is a notification on my Android device (using Google Chrome). I would expect this notification to disappear once I stop the playback, but it doesn't. How do I remove the notification? you can do this by setting src attribute to blank and load it again. below is line of code audioElement.setAttribute('src', ''); audioElement.load(); it worked for me for Video element but for same problem. Happy

how I can get current time when use playbackRate.value in Web Audio API

故事扮演 提交于 2019-12-06 04:52:05
问题 I need to know the current time of a source that is playing, but I can't use context.currentTime because when I change the source.playbackRate.value the speed rate of the context don't change too, so I can't determinate where is the current position of sound. There isn't another way? Edit, some code: I use this functions to load and play an mp3 from the network function loadSoundFile(url) { source = null; var request = new XMLHttpRequest(); request.open('GET', url, true); request.responseType

Play symbol (▶) squished in document.title

北慕城南 提交于 2019-12-06 04:33:24
问题 Adding to the question on Why does the HTML symbol for ▶ not work in document.title, when I add the play symbol to the document title using the properly escaped javascript hex value, the symbol seems squished: JavaScript: document.title = '\u25BA' + document.title; Inside Page (correct) Inside Title (not so correct) See this fiddle for a working model. I've added /show/light so the javascript can actually access the document title on the main page, but if you take off the extension, you can

AudioContext() doesn't exist on some phones?

限于喜欢 提交于 2019-12-06 03:25:25
问题 I'm attempting to use AudioContext() in the latest version of Chrome (34.0.1847.114) on a Samsung Galaxy SII 4G, but for some reason AudioContext() does not exist, nor does webkitAudioContext. The exact same code functions perfectly fine on a Nexus 5 and an older phone like a Galaxy Nexus, but not the SII. Is HTML5 audio not supported on some devices? If not can anyone explain why or point me to some documentation about AudioContext support? Exact code I'm using: window.AudioContext = window

Record Sounds from AudioContext (Web Audio API)

半腔热情 提交于 2019-12-06 02:23:34
问题 Is there a way to record the audio data that's being sent to webkitAudioContext.destination ? The data that the nodes are sending there is being played by the browser, so there should be some way to store that data into a (.wav) file. 回答1: Currently, there's not a native way to do that, but as Max said in the comment above, Recorderjs does essentially this (it doesn't chain onto the destination, but is a ScriptProcessorNode you can connect other nodes to, and have its input recorded. I built

make style on html5 audio player timeline

夙愿已清 提交于 2019-12-06 00:27:51
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. The following code, when pasted into Chrome's developer console, reveals a document fragment that describes the audio element's structure: var aud = document.createElement('audio'); document.querySelector('body').appendChild(aud); aud.controls = true; Going to the chrome