Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
tb-web-audio
Advanced tools
Readme
Simplified Web Audio API with cross-browser support. This module is optimized to be used in any web project for:
As of May 2016, the module has been tested with the following devices and browsers:
For overall support, please refer to Web Audio API.
npm install tb-web-audio
git clone https://github.com/thinkingboxmedia/tb-web-audio.git
cd tb-web-audio
npm install
npm start
The example will run at http://localhost:3000. For source code of each example, please refer to example.
Loads audio file. Only one audio file is loaded at once - if load
is called twice, the only the second file will be loaded.
src
(string) - relative/absolute path to the audio source.onload
(function, optional) - callback function after audio source is loaded. Default is null
.onended
(function, optional) - callback function after audio source has ended playing. Default is null
.autoplay
(boolean, optional) - option for audio to be auto-played after loading. Default is true
.loop
(boolean, optional) - option for audio to be continuously looped. Default is true
.Plays the loaded file. If the file is already playing, no action is taken.
Pauses the loaded file. If the file is already paused, no action is taken.
Returns true
if playing and false
if paused.
Returns total duration of the loaded file in seconds.
Returns currentTime of the loaded file in seconds.
Sets currentTime of the loaded file. This is essentially a seek function.
time
(number) - currentTime of audio to be played. Its value must be between 0 and total duration of the file.Mutes the loaded file.
Ummutes the loaded file.
Returns volume of the loaded file as a number.
Sets volume of the loaded file.
value
(number) - volume of the audio. The value must be between 0 and 100.Slowly increases the volume to create a fade in effect.
time
(number) - time span for fade in effect. Unit is in milliseconds.Slowly decreases the volume to create a fade out effect.
time
(number) - time span for fade out effect. Unit is in milliseconds.pause
(boolean, optional) - option to pause the audio after faded out. Default is true
.Returns Uint8Array that contains byte frequency data of the audio.
Sets length of the Uint8Array that contains byte frequency data of the audio.
length
(number) - length of the array. Its value must be between 1 and 1024. The length is set to default of 1024.MIT - please refer to LICENSE.
FAQs
Simplified Web Audio API with cross-browser support
The npm package tb-web-audio receives a total of 9 weekly downloads. As such, tb-web-audio popularity was classified as not popular.
We found that tb-web-audio demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.