{"repo":"Rajaniraiyn/svelte-sound","free":true,"listed":false,"github":"https://github.com/Rajaniraiyn/svelte-sound","clone":"git clone https://github.com/Rajaniraiyn/svelte-sound.git","description":"sound interactions made easy","language":"TypeScript","stars":64,"topics":["svelte","svelte-action","sveltekit","vite","hacktoberfest"],"license":"MIT","category":"saas-starters-boilerplates","readme_excerpt":"svelte-sound Svelte Actions to play interaction sounds on target DOM events Features - Lightweight and performant - Only Howler core is used - Loads Howler using dynamic imports to support partial hydration - Scalable (can be used in complex game interactions) - Truly reactive by default Installation or or Usage svelte-sound can be used in three ways, 1. sound 2. useSound 3. Sound class sound This can be directly used on elements within svelte as a svelte action. This actions following mandatory options, Option Type Description --- --- --- src string The source of the sound file events [PlayEvent, StopEvent?] An array of events to play and stop the sound and valid Howler Core Options as optional options useSound This can be reused multiple times on multiple elements within svelte. This returns a svelte action. This method accepts following parameters, Parameter Type Description --- --- --- src string The source of the sound file events [PlayEvent, StopEvent?] An array of events to play and stop the sound options HowlerOptions? An object of valid Howler Core Options Sound class This can be used to play the sound programmatically. This returns a Sound class instance. This method accepts following parameters, Parameter Type Description --- --- --- src string The source of the sound file options HowlerOptions? An object of valid Howler Core Options Example For usage example have a look at example directory FAQs How to Stop the sound/audio? You can always pass an event as the seco","default_branch":null,"files":null,"tree":[],"storefront":"/r/Rajaniraiyn","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Rajaniraiyn/svelte-sound/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}