Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuxt not working with sound #33

Open
ThimoDEV opened this issue Feb 9, 2023 · 2 comments
Open

Nuxt not working with sound #33

ThimoDEV opened this issue Feb 9, 2023 · 2 comments

Comments

@ThimoDEV
Copy link

ThimoDEV commented Feb 9, 2023

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

image

`<script setup>
import { useSound } from '@vueuse/sound'

const { play, sound } = useSound('/sounds/back.wav')
</script>

test `

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!

@louia
Copy link

louia commented Jun 19, 2023

Any news on this issue ? Still don't work @Tahul

@galexrt
Copy link

galexrt commented Aug 31, 2023

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants