Audio missing from ionic/angular android app

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.


        constructor (_config: object, audio: SoundService, private platform: Platform ) {
 = audio;
          this.platform.ready().then(() => {
    'shortbeep', '../../assets/beep_s.wav');
    'longbeep', '../../assets/longbeep.wav');

I can see from the console output that the code is run, so what could be wrong? Any help appreciated!

Appearently, the problem is that the path I use is wrong. I put the files in the src/assets folder, but how do I tell cordova? Current attempt is'longbeep', 'assets/longbeep.wav');

I tried various expressions of the path, but I just get FileNotFoundExceptions like this (in Android Studio logcat window):

Msg: SoundService: error: www/assets/longbeep.wav

I think the ionic documentation is very poor in some regards, like this problem with paths is not covered.