
Security News
Nx npm Packages Compromised in Supply Chain Attack Weaponizing AI CLI Tools
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
capacitor-sound-effect
Advanced tools
This plugin provides the ability to natively play sound effects in Capacitor based projects.
npm install capacitor-sound-effect
npx cap sync
npm install capacitor-sound-effect
ionic cap sync
loadSound(options: { id: string; path: string; }) => any
Param | Type |
---|---|
options | { id: string; path: string; } |
Returns: any
play(options: { id: string; }) => any
Param | Type |
---|---|
options | { id: string; } |
Returns: any
This example is based on an Ionic (Vue) project, but is generally applicable to other scenarios
import { SoundEffect } from 'capacitor-sound-effect';
In Ionic, the path is relative to your 'public' directory. So for a file located in /public/assets/sounds/, the below is applicable:
loadSounds() {
SoundEffect.loadSound({id:'message', path:'assets/sounds/message.mp3'});
SoundEffect.loadSound({id:'status', path:'assets/sounds/status.mp3'});
}
You must pass an object, as illustrated above, to the loadSound() method. The 'id' must be unique as it is used to reference the sound when you come to playing.
When playing a sound, you must reference the 'id' you provided during loadSound().
SoundEffect.play({id:'message'});
FAQs
Native sound effects
The npm package capacitor-sound-effect receives a total of 3 weekly downloads. As such, capacitor-sound-effect popularity was classified as not popular.
We found that capacitor-sound-effect 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.
Security News
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.