sound
sound copied to clipboard
Nuxt not working with sound
Hi @Tahul ,
You asked for my experience with nuxt and this package. I tried to get it to work after the latest update, but it seems like it doesn't work. I have a sound in my public folder like this : public/sounds/back.wav
`
const { play, sound } = useSound('/sounds/back.wav')
`This is my test component
modules: ['@vueuse/sound/nuxt'] sound: { sounds: { scan: true, }, },
Did I have something wrong or do I need to change something to get it to work?
Thanks in advance!
Any news on this issue ? Still don't work @Tahul
@louia @ThimoDEV Have you tried setting the config options like this?
defineNuxtConfig({
[...]
},
sound: {
scan: './src/public/sounds/',
},
});
Maybe the readme is wrongly showing the scan: true
option being in sound.sounds
but needing to be directly in the sound module config at the "top level".
In my case I had to use a string for the path as the module didn't pickup my sounds in a different src dir, but I haven't investigated further than that as it at least generates the types definitions with the config posted.