-
Notifications
You must be signed in to change notification settings - Fork 287
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
Where is the 'www' path? #168
Comments
Try to put your audio files in |
@leafiy - did you get this to work? I spend hours already, but I'm not getting anywhere. I found a hardcoded www directory (hmmm) in the sourcecode, but my build doesn't create a www dir.
The tip from @Maraaghib didn't make any difference. NativeAudio.preloadSimple("ballbounce", "assets/audio/basketball.mp3") Line 1 - Msg: Error loading sound: java.io.FileNotFoundException: www/assets/audio/basketball.mp3 I have put the file in src/assets/audio and in public/assets/audio. I would expect the latter to be correct, I would expect public to be 'www' - it is correct for other assets like images and fonts. I'm using ionic/capacitor and Vue 3 - did anyone get this to work in that setting?
|
Hello @micksp, I had the same problem as you. Configuration example:
Example how to use in vue 3: <script lang="ts">
import {NativeAudio} from '@ionic-native/native-audio';
export default defineComponent({
name: 'App',
setup() {
NativeAudio.preloadSimple('sound', 'public/audio/you_sound.wav').then((data) => {
console.log('success', data);
},
(data) => {
console.log('error', data);
});
}
});
</script> |
Thanks @Sitronik - In the meantime I have ported my app to Flutter/Dart. |
Hello, where would I put my audio folder in angular for it to work with your fork ? |
You need to place your audio folder in the public folder in the root of the ionic project It work correct on vue ionic project, on angular not tested |
I ended up using the Web Audio API instead: https://developer.mozilla.org/en-US/docs/Web/API/HTMLAudioElement Might not be suitable for everyone, but in my case this worked fine. |
In ionic 6 + capacitor 4 in file
change www with public.
And audio should load fine. |
I'm using capacitorjs, the only www folder I can found in the whole project is 'src-capacitor/www'. But its not work. So where should I put my audio files?
The text was updated successfully, but these errors were encountered: