Hello,
I am trying to use the capacitor-community/native-audio plugin in an Ionic Android app that plays .wav file.
I can get the plugin to play in a web browser on my computer, but when running on an Android device I am not able to hear anything being played.
The documentation has the location for the .wav file for Android as
Android: android/app/src/assets
I have tried it here.
NativeAudio.preload({
assetId: "green_noise",
assetPath: "green_noise.mp3",
audioChannelNum: 1,
isUrl: false
}).catch(err => console.log(err));
I have also seen it in the Android folder - public/assets/
NativeAudio.preload({
assetId: "green_noise",
assetPath: "public/assets/sounds/green_noise.mp3",
audioChannelNum: 1,
isUrl: false
}).cat
ch(err => console.log(err));
Both places I have not been able to hear the .wav file being played. I am not getting any errors.
Any insight on the what I might be doing incorrectly?
Thanks,
Brent
You say you are trying to play a wav file yet your assetPath
is a mp3 
Looking at the docs, if the file is in android/app/src/assets
, you just reference it via the file name, not the entire file path.
Sorry I meant .mp3 not a .wav, my bad! 
Yes the docs do have that though I was looking at this:
assetPath and audio file placement · Issue #41 · capacitor-community/native-audio · GitHub
where it states:
Description of the bug:
In the Readme.md the following is stated:
All audio place in specific platform folder
Andoid: android/app/src/assets
iOS: ios/App/App/sounds
This seems to be incorrect!
Suggestion for a fix:
All audio should be placed inside the specific folders:
Android: android/app/src/main/assets
iOS: ios/App/App/public/assets/
Note: in the case of Android the assethPath
is just the filename with the extension like 'sound.mp3'
but in the case of iOS
you need to specify more details like: assetPath: 'public/assets/sound.mp3'
I did create a new assets folder at android/app/src/ as documentation states and at android/app/src/main/assets as was suggested but still have the same issue.

I also tried performing a npx copy as someone else suggested and it copies the assets including the .mp3 file here:
android/app/src/main/assets/public/assets/
I have tried both
assetPath: ‘green_noise.mp3’,
assetPath: ‘public/assets/green_noise.mp3’,
Neither one works.
Any other suggestions?
Thanks,
Brent
Any update? I also want to know about it.
.
you’re on the right path! Make sure your audio file is in the correct format and placed in the android/app/src/main/assets folder. Update your preload code to reflect the .wav format. Also, ensure you’re calling the play method correctly after preloading. As a Literature student, I had an essay on Shakespeare’s works that I was struggling to complete. I turned to canadianwritings.com for help, and the service was fantastic! The writer delivered an insightful and well-organized essay that was submitted on time. I was able to submit it without any last-minute stress, and I got great feedback from my professor!
No, I was never able to figure it out.