Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the functions of dancer js

Shulou Source: shulou.com Published: 2022-06-02 15:52:57 09月30日 Update

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!

Tags: Audio functions effects visualization content data more knowledge support practical advanced successful learning next dilemma examples real-time actual situation plug-ins articles Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi MariaDB Huawei NVidia Redmi