What are the functions of dancer js
This article introduces the relevant knowledge of "what are the functions of dancer js". In the operation of actual cases, many people will encounter such a dilemma. Then let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Dancer.js is an advanced audio API designed to create cool visual effects that can be used in conjunction with Mozilla's AudioDataAPI and Webkit's WebAudioAPI.
The main functions of Dancer.js are as follows:
Use real-time audio waveforms and frequency data, and can be mapped to a variety of visualization effects
Obtain audio data from existing audio sources
Your visualization can be detected.
Support for WebAudio (webkit), AudioData (mozilla) and flashfallback (v9 +)
Extensible to support plug-ins and custom behaviors
Dancer.js instance method
Setup
Load (source) specifiestheaudiosourceforthedancerinstance.sourcecaneitherbeanaudioelement,oranobjectwithasrcpropertyandanoptionalcodecsarray.Whiletheaudioelementsourceisrecommendedtousewithotherplayers,ifyouspecifyaconfigobject,thesrcpropertycaneitherbeastringoftheaudiopath,orastringoftheaudiopath,withoutthefileextension,ifyouspecifyacodecarraytoworkacrossmultipleaudioimplementations.Examplesofinput:
Vardancer=newDancer ()
/ / Usinganaudioobject
Vara=newAudio ()
A.srcroomsomesong.mp3'
Dancer.load (a)
/ / Usinganaudioelementonthepage
Dancer.load (document.getElementsByTagName ('audio') [0])
/ / Usingaconfigobjectandyouonlyhaveoneencoding
Dancer.load ({src:'somesong.mp3'})
/ / Usingaconfigobject,andyouhaveanoggandmp3version
Dancer.load ({src:'somesong',codecs: ['ogg','mp3']})
This is the end of the content of "what are the functions of dancer js"? thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!