Hi there,
I’m working on a relatively simple app - more or less a glorified timer, and it contains two sounds. I managed to get rid of all errors, but I still get on sound, running the app on my phone through android studio.
I followed the docs, and added the native-audio plugin with npm + capacitor in my project, added it to app.modules.ts, created a service which exposes a preload() and a play() method, and preload my sounds guarded with platform.ready().
In webbrowser, I get an error that cordova is missing, but in android no errors. But no sound either.
src/app/home/home.page.ts
constructor (_config: object, audio: SoundService, private platform: Platform ) {
this.audio = audio;
this.platform.ready().then(() => {
this.audio.preload('shortbeep', '../../assets/beep_s.wav');
this.audio.preload('longbeep', '../../assets/longbeep.wav');
});
I can see from the console output that the code is run, so what could be wrong? Any help appreciated!