capacitor-community / native-audio

MIT License
102 stars 62 forks source link

Vite build & asset paths, how the hell? #93

Open codingMASTER398 opened 8 months ago

codingMASTER398 commented 8 months ago

I'm clearly missing something with this. I have an app built with vite, direct from Capacitor's quickstart. I've added my audio to source/assets/sounds, as seen here: image

and so, they build like this in the Android folder: image

I've tried preloading the audio in a ton of different ways, looking through different issues, trying different repos such as CapGo, and nothing has worked.

I've tried all of these:

assetPath: "public/assets/sounds/bang.1edeb9ba.wav",
assetPath: "public/assets/sounds/bang.wav",
assetPath: "assets/sounds/bang.wav",
assetPath: "sounds/bang.wav",
assetPath: "sounds/bang.1edeb9ba.wav",
assetPath: "assets/sounds/bang.1edeb9ba.wav",

Nothing is working? It just throws an error with the path of the file. The docs are super vague, and the "native-audio-example" seems to only be useful to those who know that exact framework.