javascript - Getting sound data from embedded soundcloud element -


I have a small webpage with embedded sound-cloud elements, and I want to make the frequency spectrum analyzer thing. So far, I have succeeded in creating one that uses only a local sound file, but I can not understand how to get audio data from embedded elements.

Is there a way to remove sound data from embedded elements?

If this is not a simple task, it will still be equally satisfactory to be capable of analyzing the sound

Thank you in advance :)

Code (actually not written by me, I found most of this tutorial)

HTML (embedded sound tag)

  lt; Iframe id = "em1" width = "100%" height = "450" ​​scrolling = "no" frameborder = "no" src = "https://w.soundcloud.com/player/?url=https%3A //api.soundcloud.com/tracks/144737157&auto_play=false&hide_related=false&view = true "& gt; & Lt; / Iframe & gt; JS, where I want to attach SoundCloudAudioSource in somehow embedded tag or full browser window  
  var SoundCloudAudioSource = function (audioElement) {var player = document. GetElementById (audio element); Var self = this; Various analysts; var audioctx = new (window.AudioContext || window.webkitAudioContext); // This is because it is not standardized across browsers yet Analyzer = audioCtx.createAnalyser (); analyser.fftSize = 256; See // - There is that 'fft' thing var source = audioCtx.createMediaElementSource (player); // This is where we & lt; Audio & gt; Element source.connect (analyzer); analyser.connect (audioCtx.destination); var sampleAudioStream = function () {// This conclusion where magic happens because it is called down with setInterval, it constantly performs the audio data sample // and updates the stream data and volume properties of the SoundCouldAudioSource function Visualization Routine Can pass and continue to give real-time data to the // audio stream. analyser.getByteFrequencyData (self.streamData); // Total total value var tot = 0 calculation; (Var i = 0; i & lt; 80; i ++) {// Get volume from the first 80 compartment, otherwise this treble becomes very much with the total + = self.streamData [i]; } Self.volume = total; }; Set interval (sample audio program, 20); // // Public Properties and Methods this.volume = 0; this.streamData = New Uint8Array (128); // This means that we have 128 "bins" (always half the analyzer format value), each of which will be between 0 and 255. Receive the input stream from this.playstream = function (streamUrl) {// audio element player.setAttribute ('src', streamUrl); Player.play (); }   

}

Is there any way embedded To remove sound data from elements?

No.

If this is not a simple task, then it would be equally satisfying to be able to analyze it, this is probably not possible.

It is still not possible.

Comments

Popular posts from this blog

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -

jasper reports - How to center align barcode using jasperreports and barcode4j -

django - CommandError: You must set settings.ALLOWED_HOSTS if DEBUG is False -