web-audio-api

Routing multiple effects in the Webaudio API

萝らか妹 提交于 2019-12-11 14:09:10
问题 this.source.connect(this.filter); // Filter set to eq value 200 this.source.connect(this.convolver); this.source.connect(this.dry); this.convolver.connect(this.wet); // Convolver is the actual convolver this.filter.connect( context.destination ); this.dry.connect(context.destination); // Dry is a gain (at 1) this.wet.connect(context.destination); // Wet is a gain (at 1) As soon as I wanted to add a filter things got utterly confusing. You can assume that the filters and everything are set up

How to stop audio in an iframe using web audio api after hiding its container div?

浪子不回头ぞ 提交于 2019-12-11 08:07:09
问题 I have an iframe where users can play/stop audio (using web audio api). But how can I stop audio if I hide that iframe? (e.g., by setting the CSS property containerDiv.css('display', 'none') ). I've tried to clear the parent div with containerDiv.html('') , but audio inside iframe still keeps playing. 回答1: You can use the postMessage API to communicate with the iframe. This would allow you to send a message to the iframe telling it to stop the audio. A script in the parent window: // Assuming

Javascript - Seek audio to certain position when at exact position in audio track

ε祈祈猫儿з 提交于 2019-12-11 05:18:29
问题 Scenario: Audio starts playing from 0:00 . At exactly 0:05 , the track skips forwards to 0:30 . The track immediately starts playing at 0:30 , and at exactly 0:35 , the track skips backwards to 0:05 and plays the rest of the audio file Summary: Play: 0:00 to 0.05 , Skip: 0:05 to 0:30 , Play: 0:30 to 0:35 , Skip: 0:35 to 0:05 , Play: 0.05 to END The real problem comes when there is the need for a immediate and seamless skip. For example, setTimeout is very inaccurate and drifts meaning it

Streaming audio buffer from a web page to C# Google Cloud Speech to Text SDK and receiving 400 errors

半腔热情 提交于 2019-12-11 04:37:42
问题 I have a requirement to add speech-to-text from a web page. I cannot find enough documentation to tell me what the best approach would be. I have read posts and reviewed samples Stream Audio from C#. UPDATE: I have converted to WAV format on the client before sending to the server. The result is a file that is recognized as WAV with no output. UPDATE[20181004]: I can successfully send record and save a full WAV file and then send it to Google Speech API branch_Record-in-browser-before-sending

Avoid stopping background audio for howler.js sprite playback on iOS

房东的猫 提交于 2019-12-11 03:02:42
问题 I'm making a little browser game as a study project, with howler.js 2.0 handling the sound effects. When I play the game on iOS and I'm listening to music (say, in the music player app), the game sound effects will stop the background audio. Actually, I believe all background audio stops upon load of the game. Is there any way to prevent this and keep the background audio going? I'd prefer to avoid audio ducking as well, but could live with that if it's the only option. The game is here: http

Audio recording with HTML5 Web Audio Api

筅森魡賤 提交于 2019-12-11 01:47:40
问题 Does anyone know if the Web Audio API provides the ability to save audio played using the WebAudioContext? 回答1: I actually wrote a small utility called RecorderJS that might help. 回答2: There is a startRendering function in Chrome at least (haven't checked Safari). I think it's undergoing some rework and thus isn't included in the spec, but might be added at a later stage (or not). If you want to check out the current implementation, have a look at the answer at Is there a way to use the Web

Chrome - createMediaElementSource not working

点点圈 提交于 2019-12-11 00:43:52
问题 I have a simple audio analyzer for my website: var analyser = document.getElementById('analyzer'); var beat = document.getElementById('track_meta') var canvas, ctx, source, context, analyser, fbc_array, bars, bar_x, bar_width, bar_height; function playAnalyzer() { context = new AudioContext(); analyser = context.createAnalyser(); canvas = document.getElementById('analyzer'); ctx = canvas.getContext('2d'); source = context.createMediaElementSource(playerE); source.connect(analyser); analyser

Is this a bug in firefox or is chrome proactively fixing something I've done wrong?

戏子无情 提交于 2019-12-10 23:35:01
问题 The following code simply turns a box red whenever the signal from the microphone goes over a set threshold. It merrily runs all day on chromium on linux and chrome on windows. It also runs fine on firefox on both platforms - for all of about 15 seconds. When it stops working on firefox it gives no errors, .getChannelData just starts returning all zeros. Have I discovered a bug in FF or is chrome just doing a better job of clearing up my shonky javascipt? <!DOCTYPE html> <html lang="en-us">

Web Audio API: seek, play-/buffer-progress

不想你离开。 提交于 2019-12-10 22:16:07
问题 When you play audio using the audio element in Chrome you get annoying clicks and cracks. At least under my 64bit Linux installation, even after I formatted and installed a new Fedora version. (Firefox and Opera are fine, even IE9 in a VirtualBox Windows 7.) But demos using the Web Audio API instead of the audio element have perfect sound. So I was wondering if I could use the Web Audio API like the audio element? But there are some things you seem not to be able to do with this API. Or am I

Play live audio stream - html5

泪湿孤枕 提交于 2019-12-10 19:23:55
问题 I have a desktop application which streams raw PCM data to my browser over a websocket connection. The stream looks like this ...\\x00\\x00\\x02\\x00\\x01\\x00\\x00\\x00\\x01\\x00\\xff\\xff\\xff\\xff\\... . The question is simple: can I play such a stream in HTML with the Web Audio API / WebRTC / ...? Any suggestions are very welcome! code edit This code plays noise, randomly generated: function myPCMSource() { return Math.random() * 2 - 3; } var audioContext; try { window.AudioContext =