82704

alternative to audioContext.copyToChannel() in Safari and Edge

Question:

Both Safari and Edge do not support the audioContext.copyToChannel() function to populate an audioBuffer with custom content. Is there any other way to do it?

In my case, I want to create an impulse response, populate a buffer with that response and convolve some sound with that buffer. For Chrome and Firefox this works:

buffer = audioCtx.createBuffer(numOfChannels, 1, sampleRate); buffer.copyToChannel(impulseResponse, 0); buffer.copyToChannel(impulseResponse, 1); convolverNode.buffer = buffer;

Answer1:

You can just use getChannelData(channel) on the AudioBuffer, you then get a regular Float32Array than you can modify at will. Maybe you want to look at the set method ?

copyToChannel is there to optimize buffer copies , as noted in the <a href="http://webaudio.github.io/web-audio-api/#widl-AudioBuffer-copyToChannel-void-Float32Array-source-long-channelNumber-unsigned-long-startInChannel" rel="nofollow">spec</a> (see the little green box below.

Answer2:

edge now supports copyToChannel (tested on edge 38.14393.0.0)

Recommend

  • Does calling stop() on a source node trigger an ended event?
  • How to place span tags around each word in div with contenteditable set
  • Embedding most recent YouTube video with Channel ID
  • Trying to initate guided access from within an iOS6 app?
  • Is there a way to continuously pipe data from Azure Blob into BigQuery?
  • Do not save model on duplicate file - Django 2
  • difference between document.cookie and res.cookie
  • Checking the string for null or empty space
  • wxpython notebook inside boxsizer
  • Python extension: symbol(s) not found for architecture x86_64 error
  • How to properly create a RollingFileAppender with AppenderComponentBuilder in log4j 2
  • This thread program shows me different answers every time
  • How to use a string like a variable in Visual Basic
  • How to store model in `.pb` file with Estimator in TensorFlow?
  • 128 bit string to array using boost::spirit::*
  • SVG animation not working in Chrome (using animateTransform in GWT)
  • why can't I use reflection to take the address of a slice?
  • Eclipse (ctrl+space) content assist hook
  • How can I access the Google account user_id?
  • How to use CoreFoundation in QuickTime SDK for Windows?
  • Align microsoft access queries
  • Scripting Support For Image Filtering in DigitalMicrograph
  • How does the dispatcher work when mixing sync/async with serial/concurrent queue?
  • JavaMail connection problems [duplicate]
  • All Event listing on specified date in Google Calender api (V3) in java?
  • How to run chrome.tabs.insertCSS from the background page on each page?
  • using maven pom while creating jar:test-jar some times it says JAR will be empty - no content was ma
  • Is there a better way for handling SpatialPolygons that cross the antimeridian (date line)?
  • How to configure the APNS.Certificate in the arm template
  • Geokit in Ruby on Rails, problem with acts_as_mappable
  • JavaScript Regex to Match Boundaries of Words with diacritics
  • How to call jQuery function in HTML returned by AJAX
  • How do I add a mouse over tooltip to an Image using .DrawImage()
  • How to warp text around image in iOS?