javascript - WebAudioAPI: Troubles appending JS audio object to <audio> html5 player in Firefox -
I recently created a 3D visualizer and I have a problem getting my audio code to work in Firefox I
I am setting up my audiocontext:
AudiContextet Setup: Function () {try.soud.audioContext = new (window.AudioContext || window) WebkitAudioContext) (); } Catch (e) {Warning ('Web Audio API is not supported in this browser'); }},
Let me create an audio object:
createAudioObject: function () {sound.audio0 = new audio (); Sound.audio0. src = '/audio/MakeYouWanna.mp3'; Sound. Audio0. controls = true; Sound.audio0.autoplay = false; Sound.audio.0.lop = true; },
I set my audio nodes:
setupAudioNodes: function () {Sound.sourceNode = Sound.audioContext.createMediaElementSource (sound.audio0 ); Soundtrack AnalyzerNode = Sound.Audocontext.CreateAliser (); Soundtrack AnalyzerNode.fficism = 1024, sound. French Array = New UIT 8 array (sound.analisnernode.fixianbinkount); SoundTimeDamainAre = new UIT 8 array (sound.analisnnn.d.fiksigninacount); },
I connect my audio nodes:
connect audio nodes: function () {Sound.sourceNode.connect (Sound.analyserNode); Sound.analyserNode.connect (Sound.audioContext.destination); },
Again, I run this magical line that works perfectly in Chrome: (Note that #player is a blank box.)
$ ('.player') attached (Sound.sourceNode.mediaElement);
But in Firefox, I do not find love. I recently found out that MP3s do not work in Firefox (lame), but should the player still show up right?
I have a file drag and drop feature which also uses the .append () line above it, and I tried a .wav file and that too could not work.
Website: Zithub Repo:
Thank you, John Lopez.
The problem is:
$ ('# player') . Attachments (Sound source media. Element);
MediaElementAudioSourceNode
's media element
property is disliked for a while, it will no longer be supported in Chrome ( Or maybe it has already been removed, is not sure), and never existed in Firefox (because we started implementing the Web Audio API after removing it).
You need to mapping (just a mediaAluminumAudioSourceNode
& lt; -> & lt; audio & gt;
map), or simply Do:
$ ('# player') .andand (sound.audio0);
Comments
Post a Comment