Research
Recent Trends in Malicious Packages Targeting Discord
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
startaudiocontext
Advanced tools
Readme
StartAudioContext starts the Web Audio API's AudioContext on an explicit user action.
According to the Apple's documentation:
On iOS, the Web Audio API requires sounds to be triggered from an explicit user action, such as a tap. Calling noteOn() from an onload event will not play sound.
StartAudioContext listens for the first non-dragged touchend
or mouseup
event on any of the given elements, then triggers a silent AudioBuffer which will start the AudioContext if it isn't already started.
Choose one:
npm install startaudiocontext
bower install startaudiocontext
//pass in the audio context
var context = new AudioContext();
//on iOS, the context will be started on the first valid user action on the #playButton element
StartAudioContext(context, "#playButton")
StartAudioContext(AudioContext, (Elements), (Callback)) => Promise
StartAudioContext will monitor the passed in AudioContext and resolve the promise and/or invoke the passed in callback when the AudioContext.state === 'running'
.
The second argument can be an Element, Selector String, NodeList, jQuery Element or an Array of any of those. An event listener is bound to any of the passed in elements which will listen for a valid touch events to trigger a silent AudioBuffer which will start the AudioContext.
StartAudioContext(audioContext, '#button', function(){
//audio context is started
})
If no element is passed in, it will bind to document.body.
The third argument is the callback to invoke when the AudioContext has started.
StartAudioContext returns a promise which is resolved when the AudioContext state is 'running'.
StartAudioContext(audioContext).then(function(){
//context is started
})
If you're using StartAudioContext with Tone.js or any other library which creates an AudioContext, pass in that AudioContext instead of creating a new one:
StartAudioContext(Tone.context, '#button').then(function(){
//started
})
Copyright 2016 Yotam Mann
FAQs
Start the AudioContext on an explicit user action.
We found that startaudiocontext demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Research
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
Security News
Socket CEO Feross Aboukhadijeh joins a16z partners to discuss how modern, sophisticated supply chain attacks require AI-driven defenses and explore the challenges and solutions in leveraging AI for threat detection early in the development life cycle.
Security News
NIST's new AI Risk Management Framework aims to enhance the security and reliability of generative AI systems and address the unique challenges of malicious AI exploits.