capacitor-community / native-audio

MIT License
109 stars 66 forks source link

Audio Asset already exists #69

Open matudelatower opened 1 year ago

matudelatower commented 1 year ago

Describe the bug

Audio Asset already exists

image

To Reproduce Steps to reproduce the behavior: Where to place audios asset, npx cap copy doesnt copy to public asset, when i place de file on android/app/src/main/assets

Expected behavior Playd audios

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Capacitor 4 Ionic 6 Angular 13

HarelM commented 1 year ago

I get the same error from time to time, I'm not sure why. I looked at the code and can't figure out why. Let me know if you find the solution for this...

Lucas-Wanat commented 1 year ago

image I have the same problem, I'm using capacitor 3 because I have to use it in order to use serial bluetooth (cordova plug-in). This audio error is delaying my project, if you find something let me know.

HarelM commented 1 year ago

Can any of you reproduce this "always"? Can you share a project that can reproduce this? I have this sometimes and it doesn't reproduce on my simulator...

Lucas-Wanat commented 1 year ago

Can any of you reproduce this "always"? Can you share a project that can reproduce this? I have this sometimes and it doesn't reproduce on my simulator...

@HarelM I have my project, but it's private and also part of it is in Portuguese because that's what the team asked for.

HarelM commented 1 year ago

Can you narrow it down somehow to make a reproducible example (P.S. I'm not the maintainer of this package)

HarelM commented 1 year ago

Coming to think about it, I haven't seen this issue lately since I switched to use @capgo/native-audio so it's worth a shot. It also fixes another issue I had with other apps (spotify for exmaple) stopping when opening my app.

Lucas-Wanat commented 1 year ago

Coming to think about it, I haven't seen this issue lately since I switched to use @capgo/native-audio so it's worth a shot. It also fixes another issue I had with other apps (spotify for exmaple) stopping when opening my app.

It seems like a good option, I'm about to start using it, I got the same error that the audio already exists, but I'm trying to solve it, I'll come back here and let you know if I succeed.

Lucas-Wanat commented 1 year ago

Describe the bug

Audio Asset already exists

image

To Reproduce Steps to reproduce the behavior: Where to place audios asset, npx cap copy doesnt copy to public asset, when i place de file on android/app/src/main/assets

Expected behavior Playd audios

Desktop (please complete the following information):

  • OS: Android
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: Moto G6
  • OS: Android 9

Additional context Capacitor 4 Ionic 6 Angular 13

dear friends @HarelM and @matudelatower , a possible solution is to use after the play() method is to trigger the unload() method, other information, make each file name and id be written with single quotes (ie leave them all in single quotes or double quotes).