Giter Site home page Giter Site logo

native-audio's Introduction


Native Audio

@capacitor-community/native-audio

Capacitor community plugin for playing sounds natively.


Capacitor Native Audio Plugin

Capacitor plugin for native audio engine. Capacitor v5 - βœ… Support!

Click on video to see example πŸ’₯

YouTube Example

Maintainers

Maintainer GitHub Social
Maxim Bazuev bazuka5801 Telegram

Mainteinance Status: Actively Maintained

Preparation

All audio place in specific platform folder

Andoid: android/app/src/assets

iOS: ios/App/App/sounds

Web: assets/sounds

Installation

To use npm

npm install @capacitor-community/native-audio

To use yarn

yarn add @capacitor-community/native-audio

Sync native files

npx cap sync

On iOS, Android and Web, no further steps are needed.

Configuration

No configuration required for this plugin.

Supported methods

Name Android iOS Web
configure βœ… βœ… ❌
preload βœ… βœ… βœ…
play βœ… βœ… βœ…
pause βœ… βœ… βœ…
resume βœ… βœ… βœ…
loop βœ… βœ… βœ…
stop βœ… βœ… βœ…
unload βœ… βœ… βœ…
setVolume βœ… βœ… βœ…
getDuration βœ… βœ… βœ…
getCurrentTime βœ… βœ… βœ…
isPlaying βœ… βœ… βœ…

Usage

Example repository

import {NativeAudio} from '@capacitor-community/native-audio'


/**
 * This method will load more optimized audio files for background into memory.
 * @param assetPath - relative path of the file or absolute url (file://)
 *        assetId - unique identifier of the file
 *        audioChannelNum - number of audio channels
 *        isUrl - pass true if assetPath is a `file://` url
 * @returns void
 */
NativeAudio.preload({
    assetId: "fire",
    assetPath: "fire.mp3",
    audioChannelNum: 1,
    isUrl: false
});

/**
 * This method will play the loaded audio file if present in the memory.
 * @param assetId - identifier of the asset
 * @param time - (optional) play with seek. example: 6.0 - start playing track from 6 sec
 * @returns void
 */
NativeAudio.play({
    assetId: 'fire',
    // time: 6.0 - seek time
});

/**
 * This method will loop the audio file for playback.
 * @param assetId - identifier of the asset
 * @returns void
 */
NativeAudio.loop({
  assetId: 'fire',
});


/**
 * This method will stop the audio file if it's currently playing.
 * @param assetId - identifier of the asset
 * @returns void
 */
NativeAudio.stop({
  assetId: 'fire',
});

/**
 * This method will unload the audio file from the memory.
 * @param assetId - identifier of the asset
 * @returns void
 */
NativeAudio.unload({
  assetId: 'fire',
});

/**
 * This method will set the new volume for a audio file.
 * @param assetId - identifier of the asset
 *        volume - numerical value of the volume between 0.1 - 1.0
 * @returns void
 */
NativeAudio.setVolume({
  assetId: 'fire',
  volume: 0.4,
});

/**
 * this method will getΒ the duration of an audio file.
 * only works if channels == 1
 */
NativeAudio.getDuration({
  assetId: 'fire'
})
.then(result => {
  console.log(result.duration);
})

/**
 * this method will get the current time of a playing audio file.
 * only works if channels == 1
 */
NativeAudio.getCurrentTime({
  assetId: 'fire'
});
.then(result => {
  console.log(result.currentTime);
})

/**
 * This method will return false if audio is paused or not loaded.
 * @param assetId - identifier of the asset
 * @returns {isPlaying: boolean}
 */
NativeAudio.isPlaying({
  assetId: 'fire'
})
.then(result => {
  console.log(result.isPlaying);
})

API

configure(...)

configure(options: ConfigureOptions) => Promise<void>
Param Type
options ConfigureOptions

preload(...)

preload(options: PreloadOptions) => Promise<void>
Param Type
options PreloadOptions

play(...)

play(options: { assetId: string; time?: number; }) => Promise<void>
Param Type
options { assetId: string; time?: number; }

pause(...)

pause(options: { assetId: string; }) => Promise<void>
Param Type
options { assetId: string; }

resume(...)

resume(options: { assetId: string; }) => Promise<void>
Param Type
options { assetId: string; }

loop(...)

loop(options: { assetId: string; }) => Promise<void>
Param Type
options { assetId: string; }

stop(...)

stop(options: { assetId: string; }) => Promise<void>
Param Type
options { assetId: string; }

unload(...)

unload(options: { assetId: string; }) => Promise<void>
Param Type
options { assetId: string; }

setVolume(...)

setVolume(options: { assetId: string; volume: number; }) => Promise<void>
Param Type
options { assetId: string; volume: number; }

getCurrentTime(...)

getCurrentTime(options: { assetId: string; }) => Promise<{ currentTime: number; }>
Param Type
options { assetId: string; }

Returns: Promise<{ currentTime: number; }>


getDuration(...)

getDuration(options: { assetId: string; }) => Promise<{ duration: number; }>
Param Type
options { assetId: string; }

Returns: Promise<{ duration: number; }>


isPlaying(...)

isPlaying(options: { assetId: string; }) => Promise<{ isPlaying: boolean; }>
Param Type
options { assetId: string; }

Returns: Promise<{ isPlaying: boolean; }>


addListener('complete', ...)

addListener(eventName: 'complete', listenerFunc: (event: { assetId: string; }) => void) => Promise<PluginListenerHandle> & PluginListenerHandle

Listen for asset completed playing event

Param Type
eventName 'complete'
listenerFunc (event: { assetId: string; }) => void

Returns: Promise<PluginListenerHandle> & PluginListenerHandle

Since: 5.0.1


Interfaces

ConfigureOptions

Prop Type Description Default
fade boolean indicating whether or not to fade audio. true
focus boolean indicating whether or not to disable mixed audio. true

PreloadOptions

Prop Type
assetPath string
assetId string
volume number
audioChannelNum number
isUrl boolean

PluginListenerHandle

Prop Type
remove () => Promise<void>

native-audio's People

Contributors

akhromieiev avatar bazuka5801 avatar dependabot[bot] avatar jcesarmobile avatar kheftel avatar kyoz avatar mamane10 avatar priyankpat avatar rdlabo avatar riderx avatar sitronik avatar whippym avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

native-audio's Issues

Capacitor 3 Support

Capacitor 3 is currently in alpha (with a beta quickly approaching!). It would be great if this plugin released a Capacitor 3 compatible version around the same time as the full release.

Happy to help out if I can πŸ˜„

preloadSimple is not a function

Describe the bug
preloadSimple is not a function, and preload fails to play very short audio files in quick succession. it stutters and delayed with some wired effects

Expected behavior
playing audio with no to little latency

Smartphone:

  • Device: Galaxy A7 2018
  • OS: android 10
  • Capacitor 3.4.1

Additional context
docs are partially out of date? or wrong as they show that preloadSimple and preloadComplex are supported but only preload is there.
I used to use native audio with Cordova and use preloadSimple to load a 'ticking' audio that's played very fast in some situations with acceptable results now that I migrated to capacitor I faced this issue, do I have to revert to using Cordova plugin?

Add listeners to plugin

Hi,

i would like to receive events from the plugin. I would like to know when a sound is played.
I tried :

NativeAudio.addListener('complete', (info: any) => {
console.log('myPluginEvent complete');
});

because in swift code you are notifying the plugin:

public func audioPlayerDidFinishPlaying(_ player: AVAudioPlayer, successfully flag: Bool) {
NSLog("playerDidFinish")
self.owner.notifyListeners("complete", data: [
"assetId": self.assetId
])
}

but on typescript i have an error :

Property 'addListener' does not exist on type 'NativeAudio'.

How can i do it ?
Thanks

`npx cap sync` error: `no podspec found`

Describe the bug
running npx cap sync results in this:

[error] Error running update: Analyzing dependencies
[!] No podspec found for `CapacitorCommunityNativeAudio` in `../../node_modules/@capacitor-community/native-audio`

To Reproduce
Steps to reproduce the behavior:

  1. npm install @capacitor-community/native-audio
  2. npx cap sync

Expected behavior
sync to happen successfully

Screenshots
image

Desktop (please complete the following information):

  • OS: macOS 10.15.5

Looking For Maintainers!

If you are interested in helping maintaining this plugin, you can comment here or contact @thomasv on the Capacitor Slack. to help you get set up on the Capacitor Community Github org πŸ˜„

This plugin is only Capacitor 2.x compatible and will not work with the upcoming Capacitor 3

[Bug] Play remote sound

Describe the bug
The remote sound does not play on iOS

To Reproduce
Steps to reproduce the behavior:

import { Plugins } from "@capacitor/core";

const { NativeAudio } = Plugins;

NativeAudio.preloadSimple({
  assetPath: "https://actions.google.com/sounds/v1/alarms/bugle_tune.ogg",
  assetId: "bugle_tune",
});

NativeAudio.play({
  assetId: "bugle_tune",
});

setTimeout(() =>
  NativeAudio.unload({
    assetId: "bugle_tune",
  })
, 5000);

Expected behavior
Remote sound is played

Actual behavior
Remote sound is not played

ERROR MESSAGE:  {"errorMessage":"","message":"Asset Path is missing"}

Smartphone:

  • Device: iPhone SE simulator
  • OS: iOS13.6/14
  • Version 0.1.3

Cannot find com.getcapacitor.community.audio.nativeaudio.NativeAudio;

Describe the bug
Cannot find com.getcapacitor.community.audio.nativeaudio.NativeAudio;

To Reproduce
Steps to reproduce the behavior:
Run my app in Android studio

Screenshots
image

Desktop (please complete the following information):

  • OS: macOS 11.01
  • Version Capacitor

Smartphone (please complete the following information):

  • Android stuido 4.1.1

Cannot play files in document folder

The native audio plugin is working really well for files provided in the build, but we are downloading files from the cloud and storing them in the document folder of the app (e.g. /var/mobile/Containers/Data/Application/5CF2D476-0B24-4F2C-A331-AEECDF390071/Documents/ in my case), which is where Capacitor filesystem saves them. We would like to play them from there.

However when I try this, and I set the path to, for example "var/mobile/Containers/Data/Application/5CF2D476-0B24-4F2C-A331-AEECDF390071/Documents/1630516106806.m4a" then I get an 'Error: Asset Path is missing' error message.

Is there a way around this? I tried "/var..." and "file://var..." as the path to no avail.

Any help much appreciated.

I cannot include this in my Ionic Capacitor project

Describe the bug
Whenever I add this plugin in my Capacitor project, it give me an error in PWA, iOS, Android, etc.

To Reproduce
Steps to reproduce the behavior:

  1. Add the @capacitor-community/native-audio to your project (npm i @capacitor-community/native-audio)
  2. Pick a page to import it. (use "import { NativeAudio } from '@capacitor-community/native-audio';")
  3. Declare it in the constructor ( private nativeAudio: NativeAudio)
  4. See error - ERROR Error: Uncaught (in promise): SyntaxError: Unexpected token '('

Expected behavior
Should have all the functionality to at least load without errors like the old Cordova Native-Audio did. I'm trying to move from Cordova to Capacitor and this is a blocker for me.

Screenshots
Full Error below where I declared in my signin page:
ERROR Error: Uncaught (in promise): SyntaxError: Unexpected token '('
SyntaxError: Unexpected token '('
at eval ()
at newTrustedFunctionForJIT (/project/node_modules/@angular/compiler/fesm2022/compiler.mjs:5641:31)
at JitEvaluator.evaluateCode (/project/node_modules/@angular/compiler/fesm2022/compiler.mjs:5711:29)
at JitEvaluator.evaluateStatements (/project/node_modules/@angular/compiler/fesm2022/compiler.mjs:5685:21)
at CompilerFacadeImpl.jitExpression (/project/node_modules/@angular/compiler/fesm2022/compiler.mjs:25929:39)
at CompilerFacadeImpl.compileFactory (/project/node_modules/@angular/compiler/fesm2022/compiler.mjs:25896:21)
at SigninPage.get (/project/node_modules/@angular/core/fesm2022/core.mjs:25551:41)
at getFactoryDef (/project/node_modules/@angular/core/fesm2022/core.mjs:2289:32)
at configureViewWithDirective (/project/node_modules/@angular/core/fesm2022/core.mjs:12213:60)
at initializeDirectives (/project/node_modules/@angular/core/fesm2022/core.mjs:11947:9)
at resolvePromise (/project/node_modules/zone.js/fesm2015/zone.js:1193:31)
at resolvePromise (/project/node_modules/zone.js/fesm2015/zone.js:1147:17)
at /project/node_modules/zone.js/fesm2015/zone.js:1260:17
at _ZoneDelegate.invokeTask (/project/node_modules/zone.js/fesm2015/zone.js:402:31)
at /project/node_modules/@angular/core/fesm2022/core.mjs:27127:55
at AsyncStackTaggingZoneSpec.onInvokeTask (/project/node_modules/@angular/core/fesm2022/core.mjs:27127:36)
at _ZoneDelegate.invokeTask (/project/node_modules/zone.js/fesm2015/zone.js:401:60)
at Object.onInvokeTask (/project/node_modules/@angular/core/fesm2022/core.mjs:27437:33)
at _ZoneDelegate.invokeTask (/project/node_modules/zone.js/fesm2015/zone.js:401:60)
at Zone.runTask (http://localhost:8100/polyfills.js:8117:37) {rejection: SyntaxError: Unexpected token '('
at eva…s>)
at newTrustedFunctionForJIT (http:/…, promise: ZoneAwarePromise, zone: Zone, task: ZoneTask, stack: 'Error: Uncaught (in promise): SyntaxError: Un… (http://localhost:8100/polyfills.js:8117:37)', …}

Additional context
I've done a debug step through, but not even using the plugin, is causing this issue. I've tried changing settings in tsconfig stuff per other types of issues found on Google but nothing solves it.

Play different audio files in the app

How to know when the audio is done playing? So that i can unload the file. I'm having issue in playing different audio clips at different places of the application. It is always playing the firstly loaded audio file.

Anybody know how to handle this?

Loop function does not play the audio, only sets loop variable

Confusing documentation / Wrong behavior

I added this library to my project and I found out that my audio file was not being played. I thought it was due to the file location and the "assetPath" variable, buy I realized it was caused by a "bug" in the .loop() method I was calling. I was expecting for the audio to reproduce with the loop call, but this was not the actual behavior. Its confusing and it does not correspond with the documentation:


/**

  • This method will loop the audio file for playback.
  • @param assetId - identifier of the asset
  • @returns void
    */
    NativeAudio.loop({
    assetId: 'fire',
    });

I would suggest calling the play() method in the AudioAsset.java file after setting the loop variable or fixing the documentation.

STR:

  • Preload an audio file with an assetId (NativeAudio.preload())
  • Call the loop function with the same assetId.

Expected behavior:
The audio file will be reproduced in loop mode.

Actual behavior:
Nothing happens after loop is invoked.

On iOS stops the background music

Hello guys! πŸ‘‹
Whenever I play a sound in my iOS application with the help of the plugin the background music stops immediately. Do you know any solutions to resume the music after the audio played or play the two audio (background music and the audio from my application) at the same time with different volume levels?
On android it is working.

Add documentation of WHY developers should use this instead of HtmlAudioElement

I cannot find in the readme anywhere an explanation of what advtantages and differences this plugin brings to using the HTMLAudioElement

See this post, also looking for such more details:
https://stackoverflow.com/questions/75932418/play-sounds-in-ionic-react-with-capacitor

In my opinion the usage-case/reason of a plugin should be very visible in the documentation.

Thanks a lot for the plugin. If you quickly mention the pros/cons of each, I could make a PR for documentation and elaborate more

Can't register plugin in `MainActivity.java`

Describe the bug
Docs describing registering plugin still mention FirebaseCrashlytics. I try to register plugin class with import com.getcapacitor.community.audio.NativeAudio.class; but package community doesn't exist.

To Reproduce
Steps to reproduce the behavior:

  1. npm install @capacitor-community/native-audio
  2. npx cap sync
  3. npx cap open android
  4. Android Studio can't find the plugin class to import

Expected behavior
Android Studio should find the plugin class.

Screenshots
capacitor.settings.gradle appears to reference the npm package properly
image

Did I get the package/class wrong for import?
image

Desktop (please complete the following information):

  • OS: macOS 10.15.15
  • Android Studio 4.0

assetPath and audio file placement

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'

Add event listeners

Is your feature request related to a problem? Please describe.

There is no method to listen for player state changes making it only useful for async or background sounds.

Describe the solution you'd like

an addEventListener for error, end, start

Describe alternatives you've considered
None

Additional context
I'd like to wrap this in a promise so I can do something after a sound has finished being played.

Promise not resolve on NativeAudio.preload

Describe the bug
Promise does not resolve on preloading Assets

To Reproduce

NativeAudio.preload({
                    assetId: 'sound.mp3',
                    assetPath: 'public/assets/sound.mp3',
                    audioChannelNum: 1,
                    isUrl: false,
                })
.then(() => console.log('loaded'))
.catch(e => console.error(e))

Expected behavior
Promise should be resolve or fail

Smartphone (please complete the following information):

  • iOS 15

Additional context
Add any other context about the problem here.

trying to get audio file size, on promise return, context (this) is lost

Describe the bug
ios16, xcode 14, ionic vue 6, capacitor 4.
tried with .then() as well.

        async doLoad() {
              await  NativeAudio.preload({
                assetId: "ping",
                assetPath: "sonar-ping-95840.mp3",
                audioChannelNum: 1,
                isUrl: false
            })
                this.LogIt("ping getting audio duration")
            let result= await  NativeAudio.getDuration({
                    assetId: 'ping'
                })
            let r = result.duration * 1000
            this.LogIt("in ms =" + r)
            this.setms(r)

see output

⚑️  To Native ->  NativeAudio getDuration 58430391
⚑️  [log] - 1676737401023 ping getting audio duration
⚑️  TO JS {"duration":1.0187755102040816}
⚑️  [log] - 1676737401025 in ms =1018.7755102040817

then
⚑️ TO JS undefined
⚑️ TO JS undefined

tried calling from IonicViewDidEnter()
and created()
tried using self instead of this

I am trying to save the ms elapsed so I can wait til the play finishes, so i  don't keep chopping it off while playing. 
not clear if play waits to return until finished. 

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
 - OS: [e.g. iOS] Mac OS
 - Browser [e.g. chrome, safari]  this is native mode app
 - Version [e.g. 22]

**Smartphone (please complete the following information):**
 - Device: [e.g. iPhone6]  iphone 12
 - OS: [e.g. iOS8.1] ios 16.2
 - Browser [e.g. stock browser, safari]???
 - Version [e.g. 22]???

[Bug] Sound stop does not work on iOS

Describe the bug
The sound does not stop on iOS after calling the stop method

To Reproduce
Steps to reproduce the behavior:

import { Plugins } from "@capacitor/core";

const { NativeAudio } = Plugins;

NativeAudio.preloadSimple({
  assetPath: "audio/chime.mp3",
  assetId: "chime_audio",
});

NativeAudio.play({
  assetId: "chime_audio",
});

setTimeout(() =>
  NativeAudio.stop({
    assetId: "chime_audio",
  })
, 500);

Expected behavior
Sound stops to play

Actual behavior
Sound continues to play

Smartphone:

  • Device: iPhone SE simulator
  • OS: iOS13.6
  • Version 0.1.3

Audio is not played

Describe the bug
When preload() is executed, it returns an error:

To Reproduce
Steps to reproduce the behavior:

  • Execute the beep function when preloading, the error occurs

Captura de tela 2023-01-17 092019
image

Sending plugin error:{"save":false,"callbackId":"18192255","pluginId":"NativeAudio","methodName":"preload","success":false,"error":{"message":"androidappsrcassetsaudio\beep_erro.wav"}}

Desktop (please complete the following information):

  • OS: windows 10
  • Browser: Chrome
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: samsung (tablet)
  • OS: android 11
  • Browser google
  • Version [e.g. 22]

Additional context
using capacitor 3.5.1, Cordova 10.1.2 and I've tried different audio locations but it didn't work

Thanks in advance.

Ps: the community must improve.

GetDuration returns a fatal erro

Describe the bug
When trying to get the duration of an audio track it returns NaN

To Reproduce

      NativeAudio.getDuration({ assetId: 'audioID'}).then(result => {
        console.log('Get Duration returned : ', result);
        console.log('Duration = ' + result.duration);
      })

Expected behavior
Expect it to return the length of the audio file

Screenshots
CapacitorNativeAudioStreamer/AudioAsset.swift:63: Fatal error: Unexpectedly found nil while unwrapping an Optional value 2023-03-27 14:15:41.114043-0600 App[2986:978608] CapacitorNativeAudioStreamer/AudioAsset.swift:63: Fatal error: Unexpectedly found nil while unwrapping an Optional value

Desktop (please complete the following information):

  • OS: iOS
  • Browser chrome
  • Version

Smartphone (please complete the following information):

  • Device: iPhone13
  • OS: iOS 16.3.1
  • Browser ionic app
  • Version ionic 6.20.5

Capacitor 5

Capacitor 5 released, can this plugin be updated? Thanks in advance!

On iOS make the AVAudioSession.Category configurable to support the silent switch

Is your feature request related to a problem? Please describe.
When playing audio with iOS, users expect for apps to silence the audio when the physical silent switch is toggled off.

This is supported in the API by setting the appropriate category on AVAudioSession.sharedInstance().setCategory which is hardcoded to "playback" in the plugin.

Describe the solution you'd like
Add a configuration parameter for iOS, perhaps in preloadComplex to set the iOS Audio Session category

Describe alternatives you've considered
Remove AVAudioSession.sharedInstance().setCategory from the plugin and let each app set it's own category in AppDelegate.

Additional context
See documentation here: https://developer.apple.com/documentation/avfaudio/avaudiosessioncategory

Setting "focus" to false breaks audio

The problem
The plugin works as a charm until you try to use the interesting part : mix audios

To Reproduce
Preload sounds, keep focus set to its default value (true), it is working correctly.
Set focus to false using configure, sounds are no longer triggered.

Expected behavior
Passing "focus: false" in configure should enable sound mixing

Smartphone (please complete the following information):

  • Device: iPhone 15 | mi9T Pro
  • OS: iOS | Android
  • Version 17.0 | 11.0

Pause function doesn't work on IOS

When I run the pause function, its logging in the console that the function was fired, but the audio keeps playing. All other functions work fine (except for resume as I haven't been able to test)

Android Audio loop not work

When I call the loop method, the sound is not played.
Only Android

To Reproduce
Steps to reproduce the behavior:
Angular Call
await NativeAudio.loop({assetId:soundToPlay.key});

Expected behavior
sound should be played

Smartphone (please complete the following information):

  • Device: Gigaset GS270 plus
  • OS: Android 8.1.0

Problem located
There was no exception.

File: AudioDispatcher.java line 93
public void loop() throws Exception { mediaPlayer.setLooping(true); }

I fix the problem with this change
public void loop() throws Exception { mediaPlayer.setLooping(true); mediaPlayer.start(); }

I don't know if this is the right place but it works.

add function "isPlaying"

Is your feature request related to a problem? Please describe.
It is difficult to know in the current Version if the the audio is playing, you need to keep truck if this separately, this is wasy to do on all platforms...

Describe the solution you'd like
just read the info from mediaPlayer/(ios)player

Mismatch between docs and implementation of `play` parameters

Describe the bug
When calling play the docs says that time is optinal but the typescript code does not permit to omit it.
See here:

play(options: { assetId: string, time: number }): Promise<void>;

To Reproduce
Steps to reproduce the behavior:

  1. Write in typescript: `NativeAudio.play({assetId: "fire"});

Expected behavior
The above should pass transpilation

Screenshots
image

Desktop (please complete the following information):

  • OS: [e.g. iOS] any
  • Browser [e.g. chrome, safari] any
  • Version [e.g. 22] any

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
The above line should simply be with time?: number.

Thanks for all the hard work!

bug: Incorrect documentation example

Describe the bug
Which folder i need to paste audio files.
WHY this is not documentated?
We need add full documentation step-by-step for adding sound to project for android & ios!

In android like example get error Resource ID not found
Why? Developers write incorrect examples (worked without file extension).
Examples must be fully tested, because new devs in capacitor do not deeply qualified in platform structure!

Android cannot find resource

Describe the bug
In an Ionic Angular project, the following method call in NativeAudio.java always returns 0.

int identifier = ctx .getResources() .getIdentifier(assetPath, "raw", this.getContext().getPackageName());

To Reproduce
Steps to reproduce the behavior:

  1. Create a new Ionic 5 Angular app
  2. Create a directory assets/audio and put an mp3 file in it
  3. Install this plugin + cap sync
  4. Try to load the file with NativeAudio.simpleLoad()

Expected behavior
The audio plays

Screenshots
If applicable, add screenshots to help explain your problem.
image
image

Additional context
I have tried this with every combination of directory paths I can think of. public/assets/audio, app/src/main/assets/public/assets/audio, just audio/, with and without filetype suffix, etc. No matter what I put there, it can't find the resource and returns 0.

I have even confirmed that this statement returns my "errorbeep.mp3"
ctx.getResources().getAssets().list("public/assets/audio");

But even still, it always results in this error

Sending plugin error: {"save":false,"callbackId":"24202082","pluginId":"NativeAudio","methodName":"preloadSimple","success":false,"error":{"message":"Resource ID #0x0"}}

[Android only] NativeAudio.play() promise doesn't trigger

    NativeAudio.play({
      assetId: fileName,
      time: 0,
    })
      .then((onfulfilled) => {
        console.log(`${fileName} playing...`);
      })
      .catch((e) => console.log(`error playing ${fileName}`, e));

on iOS the promise is trigger properly, however on Android, when the file is playing nothing shows up.

Screen Shot 2021-11-12 at 11 50 32

Screen Shot 2021-11-12 at 11 49 40

plugin crashing iOS app while in background.

Describe the bug
The app is running in testflight and users are complaining the app crashes while in the background. Please find below the crash report collected from app store connect.

To Reproduce
Steps to reproduce the behavior:
put the app in background for a while

Expected behavior
app should not crash

Screenshots

Desktop (please complete the following information):

  • OS: Monterey 12.5.1
  • Browser: chrome
  • Version:105.0.5195.102 (Official Build) (arm64)

Smartphone (please complete the following information):

  • Device: iPhone 13 Pro
  • OS: iOS 15.6.1
  • Browser chrome
  • Version 105.0.5195.102 (Official Build) (arm64)

Additional context

Relevant info towards the end of the report, I think

`Incident Identifier: A1BDC5C0-E03E-475C-AF37-02D903C915BA
Hardware Model: iPhone14,2
Process: App [90770]
Path: /private/var/containers/Bundle/Application/F1F6F711-8FBB-405D-BEA6-08A160A1F3AD/App.app/App
Identifier: xxx.xxxxxxxx.xx
Version: 4.0.0 (80)
AppStoreTools: 13F100
AppVariant: 1:iPhone14,2:15
Beta: YES
Code Type: ARM-64 (Native)
Role: Non UI
Parent Process: launchd [1]
Coalition: xxx.xxxxxxxx.xx [2817]

Date/Time: 2022-09-03 09:52:36.8225 +0200
Launch Time: 2022-09-03 09:08:05.1605 +0200
OS Version: iPhone OS 15.6.1 (19G82)
Release Type: User
Baseband Version: 1.70.01
Report Version: 104

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x8000000000000008 -> 0x0000000000000008 (possible pointer authentication failure)
Exception Codes: 0x0000000000000001, 0x8000000000000008
VM Region Info: 0x8 is not in any region. Bytes before following region: 4338827256
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
UNUSED SPACE AT START
--->
__TEXT 1029d4000-1029d8000 [ 16K] r-x/r-x SM=COW ...D/App.app/App
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: SIGNAL 11 Segmentation fault: 11
Terminating Process: exc handler [90770]

Triggered by Thread: 1

Thread 0 name:
Thread 0:
0 libsystem_kernel.dylib 0x00000001fbae34a0 mach_msg_trap + 8 (:-1)
1 libsystem_kernel.dylib 0x00000001fbae3ae4 mach_msg + 76 (mach_msg.c:119)
2 libdispatch.dylib 0x00000001c3b6f678 _dispatch_mach_send_and_wait_for_reply + 540 (mach.c:815)
3 libdispatch.dylib 0x00000001c3b6fa00 dispatch_mach_send_with_result_and_wait_for_reply + 60 (mach.c:1973)
4 libxpc.dylib 0x000000023587cf0c xpc_connection_send_message_with_reply_sync + 240 (connection.c:974)
5 Foundation 0x00000001c568bc4c NSXPCCONNECTION_IS_WAITING_FOR_A_SYNCHRONOUS_REPLY + 16 (NSXPCConnection.m:223)
6 Foundation 0x00000001c5691d1c -[NSXPCConnection _sendInvocation:orArguments:count:methodSignature:selector:withProxy:] + 2540 (NSXPCConnection.m:1649)
7 Foundation 0x00000001c570dfe4 -[NSXPCConnection _sendSelector:withProxy:arg1:arg2:arg3:arg4:] + 160 (NSXPCConnection.m:1301)
8 Foundation 0x00000001c56d55ac _NSXPCDistantObjectSimpleMessageSend4 + 92 (NSXPCDistantObject.m:292)
9 CoreServices 0x00000001c42c80c0 +[UTTypeRecord typeRecordWithTag:ofClass:conformingToIdentifier:] + 308 (UTTypeRecord.mm:218)
10 CoreServices 0x00000001c42bd418 UTTypeCreatePreferredIdentifierForTag + 88 (UTExternal.mm:46)
11 Capacitor 0x0000000102e93280 0x102e5c000 + 225920 (WebViewAssetHandler.swift:88)
12 Capacitor 0x0000000102e93ba8 0x102e5c000 + 228264 (WebViewAssetHandler.swift:33)
13 Capacitor 0x0000000102e90d08 0x102e5c000 + 216328 (:17)
14 WebKit 0x00000001d2f3fa0c WebKit::WebURLSchemeHandlerCocoa::platformStartTask(WebKit::WebPageProxy&, WebKit::WebURLSchemeTask&) + 84 (WebURLSchemeHandlerCocoa.mm:52)
15 WebKit 0x00000001d3114b48 WebKit::WebURLSchemeHandler::startTask(WebKit::WebPageProxy&, WebKit::WebProcessProxy&, WTF::ObjectIdentifierWebCore::PageIdentifierType, WebKit::URLSchemeTaskParameters&&, WTF::CompletionHandler... + 1348 (WebURLSchemeHandler.cpp:56)
16 WebKit 0x00000001d31145a8 WebKit::WebPageProxy::startURLSchemeTaskShared(WTF::Ref<WebKit::WebProcessProxy, WTF::RawPtrTraitsWebKit::WebProcessProxy >&&, WTF::ObjectIdentifierWebCore::PageIdentifierType, WebKit::URLSchem... + 124 (WebPageProxy.cpp:10065)
17 WebKit 0x00000001d31144f8 WebKit::WebPageProxy::startURLSchemeTask(WebKit::URLSchemeTaskParameters&&) + 52 (WebPageProxy.cpp:10056)
18 WebKit 0x00000001d348c364 WebKit::WebPageProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&) + 74628 (HandleMessage.h:125)
19 WebKit 0x00000001d2edee10 IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&, IPC::Decoder&) + 448 (MessageReceiverMap.cpp:129)
20 WebKit 0x00000001d312b16c WebKit::WebProcessProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&) + 40 (AuxiliaryProcessProxy.cpp:251)
21 WebKit 0x00000001d2ec42f0 IPC::Connection::dispatchMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_deleteIPC::Decoder >) + 264 (Connection.cpp:1105)
22 WebKit 0x00000001d2ec3b94 IPC::Connection::dispatchIncomingMessages() + 608 (Connection.cpp:1264)
23 JavaScriptCore 0x00000001cf1062d0 WTF::RunLoop::performWork() + 200 (Function.h:82)
24 JavaScriptCore 0x00000001cf10706c WTF::RunLoop::performWork(void*) + 36 (RunLoopCF.cpp:46)
25 CoreFoundation 0x00000001c3f0f414 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 28 (CFRunLoop.c:1972)
26 CoreFoundation 0x00000001c3f201a0 __CFRunLoopDoSource0 + 208 (CFRunLoop.c:2016)
27 CoreFoundation 0x00000001c3e59694 __CFRunLoopDoSources0 + 268 (CFRunLoop.c:2053)
28 CoreFoundation 0x00000001c3e5f05c __CFRunLoopRun + 828 (CFRunLoop.c:2951)
29 CoreFoundation 0x00000001c3e72bc8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
30 GraphicsServices 0x00000001dffde374 GSEventRunModal + 164 (GSEvent.c:2200)
31 UIKitCore 0x00000001c67e6b58 -[UIApplication _run] + 1100 (UIApplication.m:3511)
32 UIKitCore 0x00000001c6568090 UIApplicationMain + 364 (UIApplication.m:5064)
33 App 0x00000001029db2b8 main + 64 (AppDelegate.swift:7)
34 dyld 0x0000000102ccdda4 start + 520 (dyldMain.cpp:879)

Thread 1 name:
Thread 1 Crashed:
0 libswiftCore.dylib 0x00000001c8d01d08 swift_isUniquelyReferenced_nonNull_native + 0 (atomic:1010)
1 CapacitorCommunityNativeAudio 0x0000000102fcd1d0 specialized Dictionary.Variant.setValue(:forKey:) + 48 (:0)
2 CapacitorCommunityNativeAudio 0x0000000102fcdf38 specialized Dictionary.subscript.setter + 92 (:0)
3 CapacitorCommunityNativeAudio 0x0000000102fcc884 closure #1 in NativeAudio.preloadAsset(:isComplex:) + 1660 (Plugin.swift:0)
4 CapacitorCommunityNativeAudio 0x0000000102fcddf0 partial apply for closure #1 in NativeAudio.preloadAsset(
:isComplex:) + 76 (:0)
5 CapacitorCommunityNativeAudio 0x0000000102fca790 thunk for @escaping @callee_guaranteed () -> () + 28 (:0)
6 libdispatch.dylib 0x00000001c3b52e6c _dispatch_call_block_and_release + 32 (init.c:1517)
7 libdispatch.dylib 0x00000001c3b54a30 _dispatch_client_callout + 20 (object.m:560)
8 libdispatch.dylib 0x00000001c3b5c124 _dispatch_lane_serial_drain + 668 (inline_internal.h:2622)
9 libdispatch.dylib 0x00000001c3b5cc80 _dispatch_lane_invoke + 392 (queue.c:3944)
10 libdispatch.dylib 0x00000001c3b67500 _dispatch_workloop_worker_thread + 648 (queue.c:6732)
11 libsystem_pthread.dylib 0x00000002358550bc _pthread_wqthread + 288 (pthread.c:2599)
12 libsystem_pthread.dylib 0x0000000235854e5c start_wqthread + 8 (:-1)

Thread 2 name:
Thread 2:
0 libsystem_kernel.dylib 0x00000001fbae4600 __psynch_mutexwait + 8 (:-1)
1 libsystem_pthread.dylib 0x00000002358563dc pthread_mutex_firstfit_lock_wait + 84 (pthread_mutex.c:1414)
2 libsystem_pthread.dylib 0x000000023585d52c pthread_mutex_firstfit_lock_slow + 248 (pthread_mutex.c:1490)
3 AVFAudio 0x000000023733edfc AVAudioPlayerCpp::disposeQueue(bool) + 212 (AVAudioPlayerCpp.mm:161)
4 AVFAudio 0x000000023733f774 AVAudioPlayerCpp::prepareToPlayQueue() + 448 (AVAudioPlayerCpp.mm:888)
5 AVFAudio 0x000000023733f0ec AVAudioPlayerCpp::DoAction(unsigned int, unsigned long, void const*) + 300 (AVAudioPlayerCpp.mm:626)
6 AVFAudio 0x00000002372e7f0c -[AVAudioPlayer prepareToPlay] + 40 (AVAudioPlayer.mm:531)
7 CapacitorCommunityNativeAudio 0x0000000102fc9608 specialized AudioAsset.init(owner:withAssetId:withPath:withChannels:withVolume:withFadeDelay:) + 856 (AudioAsset.swift:39)
8 CapacitorCommunityNativeAudio 0x0000000102fcc800 closure #1 in NativeAudio.preloadAsset(
:isComplex:) + 1528 (Plugin.swift:0)
9 CapacitorCommunityNativeAudio 0x0000000102fcddf0 partial apply for closure #1 in NativeAudio.preloadAsset(
:isComplex:) + 76 (:0)
10 CapacitorCommunityNativeAudio 0x0000000102fca790 thunk for @escaping @callee_guaranteed () -> () + 28 (:0)
11 libdispatch.dylib 0x00000001c3b52e6c _dispatch_call_block_and_release + 32 (init.c:1517)
12 libdispatch.dylib 0x00000001c3b54a30 _dispatch_client_callout + 20 (object.m:560)
13 libdispatch.dylib 0x00000001c3b5c124 _dispatch_lane_serial_drain + 668 (inline_internal.h:2622)
14 libdispatch.dylib 0x00000001c3b5cc80 _dispatch_lane_invoke + 392 (queue.c:3944)
15 libdispatch.dylib 0x00000001c3b67500 _dispatch_workloop_worker_thread + 648 (queue.c:6732)
16 libsystem_pthread.dylib 0x00000002358550bc _pthread_wqthread + 288 (pthread.c:2599)
17 libsystem_pthread.dylib 0x0000000235854e5c start_wqthread + 8 (:-1)

Thread 3 name:
Thread 3:
0 libsystem_kernel.dylib 0x00000001fbae4600 __psynch_mutexwait + 8 (:-1)
1 libsystem_pthread.dylib 0x00000002358563dc pthread_mutex_firstfit_lock_wait + 84 (pthread_mutex.c:1414)
2 libsystem_pthread.dylib 0x000000023585d52c pthread_mutex_firstfit_lock_slow + 248 (pthread_mutex.c:1490)
3 AVFAudio 0x000000023733edfc AVAudioPlayerCpp::disposeQueue(bool) + 212 (AVAudioPlayerCpp.mm:161)
4 AVFAudio 0x000000023733f774 AVAudioPlayerCpp::prepareToPlayQueue() + 448 (AVAudioPlayerCpp.mm:888)
5 AVFAudio 0x000000023733f0ec AVAudioPlayerCpp::DoAction(unsigned int, unsigned long, void const*) + 300 (AVAudioPlayerCpp.mm:626)
6 AVFAudio 0x00000002372e7f0c -[AVAudioPlayer prepareToPlay] + 40 (AVAudioPlayer.mm:531)
7 CapacitorCommunityNativeAudio 0x0000000102fc9608 specialized AudioAsset.init(owner:withAssetId:withPath:withChannels:withVolume:withFadeDelay:) + 856 (AudioAsset.swift:39)
8 CapacitorCommunityNativeAudio 0x0000000102fcc800 closure #1 in NativeAudio.preloadAsset(
:isComplex:) + 1528 (Plugin.swift:0)
9 CapacitorCommunityNativeAudio 0x0000000102fcddf0 partial apply for closure #1 in NativeAudio.preloadAsset(
:isComplex:) + 76 (:0)
10 CapacitorCommunityNativeAudio 0x0000000102fca790 thunk for @escaping @callee_guaranteed () -> () + 28 (:0)
11 libdispatch.dylib 0x00000001c3b52e6c _dispatch_call_block_and_release + 32 (init.c:1517)
12 libdispatch.dylib 0x00000001c3b54a30 _dispatch_client_callout + 20 (object.m:560)
13 libdispatch.dylib 0x00000001c3b5c124 _dispatch_lane_serial_drain + 668 (inline_internal.h:2622)
14 libdispatch.dylib 0x00000001c3b5cc80 _dispatch_lane_invoke + 392 (queue.c:3944)
15 libdispatch.dylib 0x00000001c3b67500 _dispatch_workloop_worker_thread + 648 (queue.c:6732)
16 libsystem_pthread.dylib 0x00000002358550bc _pthread_wqthread + 288 (pthread.c:2599)
17 libsystem_pthread.dylib 0x0000000235854e5c start_wqthread + 8 (:-1)

Thread 4 name:
Thread 4:
0 libsystem_kernel.dylib 0x00000001fbae4600 __psynch_mutexwait + 8 (:-1)
1 libsystem_pthread.dylib 0x00000002358563dc pthread_mutex_firstfit_lock_wait + 84 (pthread_mutex.c:1414)
2 libsystem_pthread.dylib 0x000000023585d52c pthread_mutex_firstfit_lock_slow + 248 (pthread_mutex.c:1490)
3 AVFAudio 0x000000023733edfc AVAudioPlayerCpp::disposeQueue(bool) + 212 (AVAudioPlayerCpp.mm:161)
4 AVFAudio 0x000000023733f774 AVAudioPlayerCpp::prepareToPlayQueue() + 448 (AVAudioPlayerCpp.mm:888)
5 AVFAudio 0x000000023733f0ec AVAudioPlayerCpp::DoAction(unsigned int, unsigned long, void const*) + 300 (AVAudioPlayerCpp.mm:626)
6 AVFAudio 0x00000002372e7f0c -[AVAudioPlayer prepareToPlay] + 40 (AVAudioPlayer.mm:531)
7 CapacitorCommunityNativeAudio 0x0000000102fc9608 specialized AudioAsset.init(owner:withAssetId:withPath:withChannels:withVolume:withFadeDelay:) + 856 (AudioAsset.swift:39)
8 CapacitorCommunityNativeAudio 0x0000000102fcc800 closure #1 in NativeAudio.preloadAsset(
:isComplex:) + 1528 (Plugin.swift:0)
9 CapacitorCommunityNativeAudio 0x0000000102fcddf0 partial apply for closure #1 in NativeAudio.preloadAsset(
:isComplex:) + 76 (:0)
10 CapacitorCommunityNativeAudio 0x0000000102fca790 thunk for @escaping @callee_guaranteed () -> () + 28 (:0)
11 libdispatch.dylib 0x00000001c3b52e6c _dispatch_call_block_and_release + 32 (init.c:1517)
12 libdispatch.dylib 0x00000001c3b54a30 _dispatch_client_callout + 20 (object.m:560)
13 libdispatch.dylib 0x00000001c3b5c124 _dispatch_lane_serial_drain + 668 (inline_internal.h:2622)
14 libdispatch.dylib 0x00000001c3b5cc80 _dispatch_lane_invoke + 392 (queue.c:3944)
15 libdispatch.dylib 0x00000001c3b67500 _dispatch_workloop_worker_thread + 648 (queue.c:6732)
16 libsystem_pthread.dylib 0x00000002358550bc _pthread_wqthread + 288 (pthread.c:2599)
17 libsystem_pthread.dylib 0x0000000235854e5c start_wqthread + 8 (:-1)

Thread 5 name:
Thread 5:
0 libsystem_kernel.dylib 0x00000001fbae34a0 mach_msg_trap + 8 (:-1)
1 libsystem_kernel.dylib 0x00000001fbae3ae4 mach_msg + 76 (mach_msg.c:119)
2 AudioToolbox 0x00000001ced05d00 AudioQueueDispose + 544 (AudioQueueIPCUser.c:641)
3 AVFAudio 0x000000023733edf0 AVAudioPlayerCpp::disposeQueue(bool) + 200 (AVAudioPlayerCpp.mm:1706)
4 AVFAudio 0x000000023733f774 AVAudioPlayerCpp::prepareToPlayQueue() + 448 (AVAudioPlayerCpp.mm:888)
5 AVFAudio 0x000000023733f0ec AVAudioPlayerCpp::DoAction(unsigned int, unsigned long, void const*) + 300 (AVAudioPlayerCpp.mm:626)
6 AVFAudio 0x00000002372e7f0c -[AVAudioPlayer prepareToPlay] + 40 (AVAudioPlayer.mm:531)
7 CapacitorCommunityNativeAudio 0x0000000102fc9608 specialized AudioAsset.init(owner:withAssetId:withPath:withChannels:withVolume:withFadeDelay:) + 856 (AudioAsset.swift:39)
8 CapacitorCommunityNativeAudio 0x0000000102fcc800 closure #1 in NativeAudio.preloadAsset(:isComplex:) + 1528 (Plugin.swift:0)
9 CapacitorCommunityNativeAudio 0x0000000102fcddf0 partial apply for closure #1 in NativeAudio.preloadAsset(
:isComplex:) + 76 (:0)
10 CapacitorCommunityNativeAudio 0x0000000102fca790 thunk for @escaping @callee_guaranteed () -> () + 28 (:0)
11 libdispatch.dylib 0x00000001c3b52e6c _dispatch_call_block_and_release + 32 (init.c:1517)
12 libdispatch.dylib 0x00000001c3b54a30 _dispatch_client_callout + 20 (object.m:560)
13 libdispatch.dylib 0x00000001c3b5c124 _dispatch_lane_serial_drain + 668 (inline_internal.h:2622)
14 libdispatch.dylib 0x00000001c3b5cc80 _dispatch_lane_invoke + 392 (queue.c:3944)
15 libdispatch.dylib 0x00000001c3b67500 _dispatch_workloop_worker_thread + 648 (queue.c:6732)
16 libsystem_pthread.dylib 0x00000002358550bc _pthread_wqthread + 288 (pthread.c:2599)
17 libsystem_pthread.dylib 0x0000000235854e5c start_wqthread + 8 (:-1)

Thread 6 name:
Thread 6:
0 libsystem_kernel.dylib 0x00000001fbae34a0 mach_msg_trap + 8 (:-1)
1 libsystem_kernel.dylib 0x00000001fbae3ae4 mach_msg + 76 (mach_msg.c:119)
2 CoreFoundation 0x00000001c3e5ad30 __CFRunLoopServiceMachPort + 372 (CFRunLoop.c:2646)
3 CoreFoundation 0x00000001c3e5f1bc __CFRunLoopRun + 1180 (CFRunLoop.c:3000)
4 CoreFoundation 0x00000001c3e72bc8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
5 Foundation 0x00000001c5665444 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 236 (NSRunLoop.m:373)
6 Foundation 0x00000001c56a6e0c -[NSRunLoop(NSRunLoop) runUntilDate:] + 92 (NSRunLoop.m:420)
7 UIKitCore 0x00000001c6760cc4 -[UIEventFetcher threadMain] + 524 (UIEventFetcher.m:1167)
8 Foundation 0x00000001c56b541c NSThread__start + 808 (NSThread.m:972)
9 libsystem_pthread.dylib 0x00000002358559ac _pthread_start + 148 (pthread.c:891)
10 libsystem_pthread.dylib 0x0000000235854e68 thread_start + 8 (:-1)

Thread 7 name:
Thread 7:
0 libsystem_kernel.dylib 0x00000001fbae4600 __psynch_mutexwait + 8 (:-1)
1 libsystem_pthread.dylib 0x00000002358563dc pthread_mutex_firstfit_lock_wait + 84 (pthread_mutex.c:1414)
2 libsystem_pthread.dylib 0x000000023585d52c pthread_mutex_firstfit_lock_slow + 248 (pthread_mutex.c:1490)
3 AVFAudio 0x000000023733edfc AVAudioPlayerCpp::disposeQueue(bool) + 212 (AVAudioPlayerCpp.mm:161)
4 AVFAudio 0x000000023733f774 AVAudioPlayerCpp::prepareToPlayQueue() + 448 (AVAudioPlayerCpp.mm:888)
5 AVFAudio 0x000000023733f0ec AVAudioPlayerCpp::DoAction(unsigned int, unsigned long, void const*) + 300 (AVAudioPlayerCpp.mm:626)
6 AVFAudio 0x00000002372e7f0c -[AVAudioPlayer prepareToPlay] + 40 (AVAudioPlayer.mm:531)
7 CapacitorCommunityNativeAudio 0x0000000102fc9608 specialized AudioAsset.init(owner:withAssetId:withPath:withChannels:withVolume:withFadeDelay:) + 856 (AudioAsset.swift:39)
8 CapacitorCommunityNativeAudio 0x0000000102fcc800 closure #1 in NativeAudio.preloadAsset(
:isComplex:) + 1528 (Plugin.swift:0)
9 CapacitorCommunityNativeAudio 0x0000000102fcddf0 partial apply for closure #1 in NativeAudio.preloadAsset(
:isComplex:) + 76 (:0)
10 CapacitorCommunityNativeAudio 0x0000000102fca790 thunk for @escaping @callee_guaranteed () -> () + 28 (:0)
11 libdispatch.dylib 0x00000001c3b52e6c _dispatch_call_block_and_release + 32 (init.c:1517)
12 libdispatch.dylib 0x00000001c3b54a30 _dispatch_client_callout + 20 (object.m:560)
13 libdispatch.dylib 0x00000001c3b5c124 _dispatch_lane_serial_drain + 668 (inline_internal.h:2622)
14 libdispatch.dylib 0x00000001c3b5cc80 _dispatch_lane_invoke + 392 (queue.c:3944)
15 libdispatch.dylib 0x00000001c3b67500 _dispatch_workloop_worker_thread + 648 (queue.c:6732)
16 libsystem_pthread.dylib 0x00000002358550bc _pthread_wqthread + 288 (pthread.c:2599)
17 libsystem_pthread.dylib 0x0000000235854e5c start_wqthread + 8 (:-1)

Thread 8 name:
Thread 8:
0 libsystem_kernel.dylib 0x00000001fbae4600 __psynch_mutexwait + 8 (:-1)
1 libsystem_pthread.dylib 0x00000002358563dc pthread_mutex_firstfit_lock_wait + 84 (pthread_mutex.c:1414)
2 libsystem_pthread.dylib 0x000000023585d52c pthread_mutex_firstfit_lock_slow + 248 (pthread_mutex.c:1490)
3 AVFAudio 0x000000023733edfc AVAudioPlayerCpp::disposeQueue(bool) + 212 (AVAudioPlayerCpp.mm:161)
4 AVFAudio 0x000000023733f774 AVAudioPlayerCpp::prepareToPlayQueue() + 448 (AVAudioPlayerCpp.mm:888)
5 AVFAudio 0x000000023733f0ec AVAudioPlayerCpp::DoAction(unsigned int, unsigned long, void const*) + 300 (AVAudioPlayerCpp.mm:626)
6 AVFAudio 0x00000002372e7f0c -[AVAudioPlayer prepareToPlay] + 40 (AVAudioPlayer.mm:531)
7 CapacitorCommunityNativeAudio 0x0000000102fc9608 specialized AudioAsset.init(owner:withAssetId:withPath:withChannels:withVolume:withFadeDelay:) + 856 (AudioAsset.swift:39)
8 CapacitorCommunityNativeAudio 0x0000000102fcc800 closure #1 in NativeAudio.preloadAsset(
:isComplex:) + 1528 (Plugin.swift:0)
9 CapacitorCommunityNativeAudio 0x0000000102fcddf0 partial apply for closure #1 in NativeAudio.preloadAsset(
:isComplex:) + 76 (:0)
10 CapacitorCommunityNativeAudio 0x0000000102fca790 thunk for @escaping @callee_guaranteed () -> () + 28 (:0)
11 libdispatch.dylib 0x00000001c3b52e6c _dispatch_call_block_and_release + 32 (init.c:1517)
12 libdispatch.dylib 0x00000001c3b54a30 _dispatch_client_callout + 20 (object.m:560)
13 libdispatch.dylib 0x00000001c3b5c124 _dispatch_lane_serial_drain + 668 (inline_internal.h:2622)
14 libdispatch.dylib 0x00000001c3b5cc80 _dispatch_lane_invoke + 392 (queue.c:3944)
15 libdispatch.dylib 0x00000001c3b67500 _dispatch_workloop_worker_thread + 648 (queue.c:6732)
16 libsystem_pthread.dylib 0x00000002358550bc _pthread_wqthread + 288 (pthread.c:2599)
17 libsystem_pthread.dylib 0x0000000235854e5c start_wqthread + 8 (:-1)

Thread 9 name:
Thread 9:
0 libsystem_blocks.dylib 0x00000002357d171c Block_copy + 300 (runtime.cpp:58)
1 libsystem_blocks.dylib 0x00000002357d1850 -[NSMallocBlock retain] + 24 (data.m:56)
2 Capacitor 0x0000000102e804b8 0x102e5c000 + 148664
3 CapacitorCommunityNativeAudio 0x0000000102fcc8a4 closure #1 in NativeAudio.preloadAsset(
:isComplex:) + 1692 (Plugin.swift:243)
4 CapacitorCommunityNativeAudio 0x0000000102fcddf0 partial apply for closure #1 in NativeAudio.preloadAsset(_:isComplex:) + 76 (:0)
5 CapacitorCommunityNativeAudio 0x0000000102fca790 thunk for @escaping @callee_guaranteed () -> () + 28 (:0)
6 libdispatch.dylib 0x00000001c3b52e6c _dispatch_call_block_and_release + 32 (init.c:1517)
7 libdispatch.dylib 0x00000001c3b54a30 _dispatch_client_callout + 20 (object.m:560)
8 libdispatch.dylib 0x00000001c3b5c124 _dispatch_lane_serial_drain + 668 (inline_internal.h:2622)
9 libdispatch.dylib 0x00000001c3b5cc80 _dispatch_lane_invoke + 392 (queue.c:3944)
10 libdispatch.dylib 0x00000001c3b67500 _dispatch_workloop_worker_thread + 648 (queue.c:6732)
11 libsystem_pthread.dylib 0x00000002358550bc _pthread_wqthread + 288 (pthread.c:2599)
12 libsystem_pthread.dylib 0x0000000235854e5c start_wqthread + 8 (:-1)

Thread 10 name:
Thread 10:
0 libobjc.A.dylib 0x00000001dcc0c1f8 objc_destructInstance + 148 (objc-object.h:552)
1 libobjc.A.dylib 0x00000001dcc0c1c4 objc_destructInstance + 96 (objc-runtime-new.mm:8232)
2 libsystem_blocks.dylib 0x00000002357d1814 _Block_release + 208 (runtime.cpp:330)
3 Capacitor 0x0000000102e64f24 -[CAPPluginCall .cxx_destruct] + 28 (CAPPluginCall.m:4)
4 libobjc.A.dylib 0x00000001dcc0f380 object_cxxDestructFromClass(objc_object*, objc_class*) + 116 (objc-class.mm:455)
5 libobjc.A.dylib 0x00000001dcc0c1b4 objc_destructInstance + 80 (objc-class.mm:469)
6 libobjc.A.dylib 0x00000001dcc15a00 _objc_rootDealloc + 80 (objc-runtime-new.mm:8250)
7 CapacitorCommunityNativeAudio 0x0000000102fcdd60 0x102fc4000 + 40288
8 libswiftCore.dylib 0x00000001c8cc1424 _swift_release_dealloc + 56 (HeapObject.cpp:703)
9 libsystem_blocks.dylib 0x00000002357d1804 _Block_release + 192 (runtime.cpp:176)
10 libdispatch.dylib 0x00000001c3b54a30 _dispatch_client_callout + 20 (object.m:560)
11 libdispatch.dylib 0x00000001c3b5c124 _dispatch_lane_serial_drain + 668 (inline_internal.h:2622)
12 libdispatch.dylib 0x00000001c3b5cc80 _dispatch_lane_invoke + 392 (queue.c:3944)
13 libdispatch.dylib 0x00000001c3b67500 _dispatch_workloop_worker_thread + 648 (queue.c:6732)
14 libsystem_pthread.dylib 0x00000002358550bc _pthread_wqthread + 288 (pthread.c:2599)
15 libsystem_pthread.dylib 0x0000000235854e5c start_wqthread + 8 (:-1)

Thread 11 name:
Thread 11:
0 libsystem_kernel.dylib 0x00000001fbae4600 __psynch_mutexwait + 8 (:-1)
1 libsystem_pthread.dylib 0x00000002358563dc pthread_mutex_firstfit_lock_wait + 84 (pthread_mutex.c:1414)
2 libsystem_pthread.dylib 0x000000023585d52c pthread_mutex_firstfit_lock_slow + 248 (pthread_mutex.c:1490)
3 AVFAudio 0x000000023733edfc AVAudioPlayerCpp::disposeQueue(bool) + 212 (AVAudioPlayerCpp.mm:161)
4 AVFAudio 0x000000023733f774 AVAudioPlayerCpp::prepareToPlayQueue() + 448 (AVAudioPlayerCpp.mm:888)
5 AVFAudio 0x000000023733f0ec AVAudioPlayerCpp::DoAction(unsigned int, unsigned long, void const*) + 300 (AVAudioPlayerCpp.mm:626)
6 AVFAudio 0x00000002372e7f0c -[AVAudioPlayer prepareToPlay] + 40 (AVAudioPlayer.mm:531)
7 CapacitorCommunityNativeAudio 0x0000000102fc9608 specialized AudioAsset.init(owner:withAssetId:withPath:withChannels:withVolume:withFadeDelay:) + 856 (AudioAsset.swift:39)
8 CapacitorCommunityNativeAudio 0x0000000102fcc800 closure #1 in NativeAudio.preloadAsset(
:isComplex:) + 1528 (Plugin.swift:0)
9 CapacitorCommunityNativeAudio 0x0000000102fcddf0 partial apply for closure #1 in NativeAudio.preloadAsset(
:isComplex:) + 76 (:0)
10 CapacitorCommunityNativeAudio 0x0000000102fca790 thunk for @escaping @callee_guaranteed () -> () + 28 (:0)
11 libdispatch.dylib 0x00000001c3b52e6c _dispatch_call_block_and_release + 32 (init.c:1517)
12 libdispatch.dylib 0x00000001c3b54a30 _dispatch_client_callout + 20 (object.m:560)
13 libdispatch.dylib 0x00000001c3b5c124 _dispatch_lane_serial_drain + 668 (inline_internal.h:2622)
14 libdispatch.dylib 0x00000001c3b5cc80 _dispatch_lane_invoke + 392 (queue.c:3944)
15 libdispatch.dylib 0x00000001c3b67500 _dispatch_workloop_worker_thread + 648 (queue.c:6732)
16 libsystem_pthread.dylib 0x00000002358550bc _pthread_wqthread + 288 (pthread.c:2599)
17 libsystem_pthread.dylib 0x0000000235854e5c start_wqthread + 8 (:-1)

Thread 12 name:
Thread 12:
0 libsystem_kernel.dylib 0x00000001fbae3f24 __psynch_cvwait + 8 (:-1)
1 libsystem_pthread.dylib 0x000000023585c298 _pthread_cond_wait + 1236 (pthread_cond.c:636)
2 JavaScriptCore 0x00000001cf1a2148 scavenger_thread_main + 1232 (pas_scavenger.c:135)
3 libsystem_pthread.dylib 0x00000002358559ac _pthread_start + 148 (pthread.c:891)
4 libsystem_pthread.dylib 0x0000000235854e68 thread_start + 8 (:-1)

Thread 13 name:
Thread 13:
0 libsystem_kernel.dylib 0x00000001fbae34a0 mach_msg_trap + 8 (:-1)
1 libsystem_kernel.dylib 0x00000001fbae3ae4 mach_msg + 76 (mach_msg.c:119)
2 CoreFoundation 0x00000001c3e5ad30 __CFRunLoopServiceMachPort + 372 (CFRunLoop.c:2646)
3 CoreFoundation 0x00000001c3e5f1bc __CFRunLoopRun + 1180 (CFRunLoop.c:3000)
4 CoreFoundation 0x00000001c3e72bc8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
5 CoreFoundation 0x00000001c3ef3da8 CFRunLoopRun + 64 (CFRunLoop.c:3293)
6 CoreMotion 0x00000001d1311a9c CLMotionCore::runMotionThread(void*) + 1208 (CLMotionCore.mm:370)
7 libsystem_pthread.dylib 0x00000002358559ac _pthread_start + 148 (pthread.c:891)
8 libsystem_pthread.dylib 0x0000000235854e68 thread_start + 8 (:-1)

Thread 14 name:
Thread 14:
0 libsystem_kernel.dylib 0x00000001fbae34a0 mach_msg_trap + 8 (:-1)
1 libsystem_kernel.dylib 0x00000001fbae3ae4 mach_msg + 76 (mach_msg.c:119)
2 CoreFoundation 0x00000001c3e5ad30 __CFRunLoopServiceMachPort + 372 (CFRunLoop.c:2646)
3 CoreFoundation 0x00000001c3e5f1bc __CFRunLoopRun + 1180 (CFRunLoop.c:3000)
4 CoreFoundation 0x00000001c3e72bc8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
5 AudioSession 0x00000001cd487f04 CADeprecated::GenericRunLoopThread::Entry(void*) + 164 (GenericRunLoopThread.h:95)
6 AudioSession 0x00000001cd4918f0 CADeprecated::CAPThread::Entry(CADeprecated::CAPThread*) + 92 (CAPThread.cpp:324)
7 libsystem_pthread.dylib 0x00000002358559ac _pthread_start + 148 (pthread.c:891)
8 libsystem_pthread.dylib 0x0000000235854e68 thread_start + 8 (:-1)

Thread 15 name:
Thread 15:
0 libsystem_kernel.dylib 0x00000001fbae34a0 mach_msg_trap + 8 (:-1)
1 libsystem_kernel.dylib 0x00000001fbae3ae4 mach_msg + 76 (mach_msg.c:119)
2 CoreFoundation 0x00000001c3e5ad30 __CFRunLoopServiceMachPort + 372 (CFRunLoop.c:2646)
3 CoreFoundation 0x00000001c3e5f1bc __CFRunLoopRun + 1180 (CFRunLoop.c:3000)
4 CoreFoundation 0x00000001c3e72bc8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
5 CFNetwork 0x00000001c48ef1dc +[__CFN_CoreSchedulingSetRunnable _run:] + 472 (CoreSchedulingSet.mm:1372)
6 Foundation 0x00000001c56b541c NSThread__start + 808 (NSThread.m:972)
7 libsystem_pthread.dylib 0x00000002358559ac _pthread_start + 148 (pthread.c:891)
8 libsystem_pthread.dylib 0x0000000235854e68 thread_start + 8 (:-1)

Thread 16 name:
Thread 16:
0 libsystem_kernel.dylib 0x00000001fbae4600 __psynch_mutexwait + 8 (:-1)
1 libsystem_pthread.dylib 0x00000002358563dc pthread_mutex_firstfit_lock_wait + 84 (pthread_mutex.c:1414)
2 libsystem_pthread.dylib 0x000000023585d52c pthread_mutex_firstfit_lock_slow + 248 (pthread_mutex.c:1490)
3 AVFAudio 0x000000023733edfc AVAudioPlayerCpp::disposeQueue(bool) + 212 (AVAudioPlayerCpp.mm:161)
4 AVFAudio 0x000000023733f774 AVAudioPlayerCpp::prepareToPlayQueue() + 448 (AVAudioPlayerCpp.mm:888)
5 AVFAudio 0x000000023733f0ec AVAudioPlayerCpp::DoAction(unsigned int, unsigned long, void const*) + 300 (AVAudioPlayerCpp.mm:626)
6 AVFAudio 0x00000002372e7f0c -[AVAudioPlayer prepareToPlay] + 40 (AVAudioPlayer.mm:531)
7 CapacitorCommunityNativeAudio 0x0000000102fc9608 specialized AudioAsset.init(owner:withAssetId:withPath:withChannels:withVolume:withFadeDelay:) + 856 (AudioAsset.swift:39)
8 CapacitorCommunityNativeAudio 0x0000000102fcc800 closure #1 in NativeAudio.preloadAsset(
:isComplex:) + 1528 (Plugin.swift:0)
9 CapacitorCommunityNativeAudio 0x0000000102fcddf0 partial apply for closure #1 in NativeAudio.preloadAsset(
:isComplex:) + 76 (:0)
10 CapacitorCommunityNativeAudio 0x0000000102fca790 thunk for @escaping @callee_guaranteed () -> () + 28 (:0)
11 libdispatch.dylib 0x00000001c3b52e6c _dispatch_call_block_and_release + 32 (init.c:1517)
12 libdispatch.dylib 0x00000001c3b54a30 _dispatch_client_callout + 20 (object.m:560)
13 libdispatch.dylib 0x00000001c3b5c124 _dispatch_lane_serial_drain + 668 (inline_internal.h:2622)
14 libdispatch.dylib 0x00000001c3b5cc80 _dispatch_lane_invoke + 392 (queue.c:3944)
15 libdispatch.dylib 0x00000001c3b67500 _dispatch_workloop_worker_thread + 648 (queue.c:6732)
16 libsystem_pthread.dylib 0x00000002358550bc _pthread_wqthread + 288 (pthread.c:2599)
17 libsystem_pthread.dylib 0x0000000235854e5c start_wqthread + 8 (:-1)

Thread 17 name:
Thread 17:
0 Capacitor 0x0000000102e6f7d0 0x102e5c000 + 79824
1 libswiftCore.dylib 0x00000001c8cc1424 _swift_release_dealloc + 56 (HeapObject.cpp:703)
2 Capacitor 0x0000000102e6fd24 0x102e5c000 + 81188
3 libswiftCore.dylib 0x00000001c8cc1424 _swift_release_dealloc + 56 (HeapObject.cpp:703)
4 libsystem_blocks.dylib 0x00000002357d1804 _Block_release + 192 (runtime.cpp:176)
5 Capacitor 0x0000000102e64f30 -[CAPPluginCall .cxx_destruct] + 40 (CAPPluginCall.m:4)
6 libobjc.A.dylib 0x00000001dcc0f380 object_cxxDestructFromClass(objc_object*, objc_class*) + 116 (objc-class.mm:455)
7 libobjc.A.dylib 0x00000001dcc0c1b4 objc_destructInstance + 80 (objc-class.mm:469)
8 libobjc.A.dylib 0x00000001dcc15a00 _objc_rootDealloc + 80 (objc-runtime-new.mm:8250)
9 CapacitorCommunityNativeAudio 0x0000000102fcdd60 0x102fc4000 + 40288
10 libswiftCore.dylib 0x00000001c8cc1424 _swift_release_dealloc + 56 (HeapObject.cpp:703)
11 libsystem_blocks.dylib 0x00000002357d1804 _Block_release + 192 (runtime.cpp:176)
12 libdispatch.dylib 0x00000001c3b54a30 _dispatch_client_callout + 20 (object.m:560)
13 libdispatch.dylib 0x00000001c3b5c124 _dispatch_lane_serial_drain + 668 (inline_internal.h:2622)
14 libdispatch.dylib 0x00000001c3b5cc80 _dispatch_lane_invoke + 392 (queue.c:3944)
15 libdispatch.dylib 0x00000001c3b67500 _dispatch_workloop_worker_thread + 648 (queue.c:6732)
16 libsystem_pthread.dylib 0x00000002358550bc _pthread_wqthread + 288 (pthread.c:2599)
17 libsystem_pthread.dylib 0x0000000235854e5c start_wqthread + 8 (:-1)

Thread 18 name:
Thread 18:
0 libsystem_kernel.dylib 0x00000001fbae4600 __psynch_mutexwait + 8 (:-1)
1 libsystem_pthread.dylib 0x00000002358563dc pthread_mutex_firstfit_lock_wait + 84 (pthread_mutex.c:1414)
2 libsystem_pthread.dylib 0x000000023585d52c pthread_mutex_firstfit_lock_slow + 248 (pthread_mutex.c:1490)
3 AVFAudio 0x000000023733edfc AVAudioPlayerCpp::disposeQueue(bool) + 212 (AVAudioPlayerCpp.mm:161)
4 AVFAudio 0x000000023733f774 AVAudioPlayerCpp::prepareToPlayQueue() + 448 (AVAudioPlayerCpp.mm:888)
5 AVFAudio 0x000000023733f0ec AVAudioPlayerCpp::DoAction(unsigned int, unsigned long, void const*) + 300 (AVAudioPlayerCpp.mm:626)
6 AVFAudio 0x00000002372e7f0c -[AVAudioPlayer prepareToPlay] + 40 (AVAudioPlayer.mm:531)
7 CapacitorCommunityNativeAudio 0x0000000102fc9608 specialized AudioAsset.init(owner:withAssetId:withPath:withChannels:withVolume:withFadeDelay:) + 856 (AudioAsset.swift:39)
8 CapacitorCommunityNativeAudio 0x0000000102fcc800 closure #1 in NativeAudio.preloadAsset(
:isComplex:) + 1528 (Plugin.swift:0)
9 CapacitorCommunityNativeAudio 0x0000000102fcddf0 partial apply for closure #1 in NativeAudio.preloadAsset(
:isComplex:) + 76 (:0)
10 CapacitorCommunityNativeAudio 0x0000000102fca790 thunk for @escaping @callee_guaranteed () -> () + 28 (:0)
11 libdispatch.dylib 0x00000001c3b52e6c _dispatch_call_block_and_release + 32 (init.c:1517)
12 libdispatch.dylib 0x00000001c3b54a30 _dispatch_client_callout + 20 (object.m:560)
13 libdispatch.dylib 0x00000001c3b5c124 _dispatch_lane_serial_drain + 668 (inline_internal.h:2622)
14 libdispatch.dylib 0x00000001c3b5cc80 _dispatch_lane_invoke + 392 (queue.c:3944)
15 libdispatch.dylib 0x00000001c3b67500 _dispatch_workloop_worker_thread + 648 (queue.c:6732)
16 libsystem_pthread.dylib 0x00000002358550bc _pthread_wqthread + 288 (pthread.c:2599)
17 libsystem_pthread.dylib 0x0000000235854e5c start_wqthread + 8 (:-1)

Thread 19 name:
Thread 19:
0 libsystem_kernel.dylib 0x00000001fbae4600 __psynch_mutexwait + 8 (:-1)
1 libsystem_pthread.dylib 0x00000002358563dc pthread_mutex_firstfit_lock_wait + 84 (pthread_mutex.c:1414)
2 libsystem_pthread.dylib 0x000000023585d52c pthread_mutex_firstfit_lock_slow + 248 (pthread_mutex.c:1490)
3 AVFAudio 0x000000023733edfc AVAudioPlayerCpp::disposeQueue(bool) + 212 (AVAudioPlayerCpp.mm:161)
4 AVFAudio 0x000000023733f774 AVAudioPlayerCpp::prepareToPlayQueue() + 448 (AVAudioPlayerCpp.mm:888)
5 AVFAudio 0x000000023733f0ec AVAudioPlayerCpp::DoAction(unsigned int, unsigned long, void const*) + 300 (AVAudioPlayerCpp.mm:626)
6 AVFAudio 0x00000002372e7f0c -[AVAudioPlayer prepareToPlay] + 40 (AVAudioPlayer.mm:531)
7 CapacitorCommunityNativeAudio 0x0000000102fc9608 specialized AudioAsset.init(owner:withAssetId:withPath:withChannels:withVolume:withFadeDelay:) + 856 (AudioAsset.swift:39)
8 CapacitorCommunityNativeAudio 0x0000000102fcc800 closure #1 in NativeAudio.preloadAsset(
:isComplex:) + 1528 (Plugin.swift:0)
9 CapacitorCommunityNativeAudio 0x0000000102fcddf0 partial apply for closure #1 in NativeAudio.preloadAsset(
:isComplex:) + 76 (:0)
10 CapacitorCommunityNativeAudio 0x0000000102fca790 thunk for @escaping @callee_guaranteed () -> () + 28 (:0)
11 libdispatch.dylib 0x00000001c3b52e6c _dispatch_call_block_and_release + 32 (init.c:1517)
12 libdispatch.dylib 0x00000001c3b54a30 _dispatch_client_callout + 20 (object.m:560)
13 libdispatch.dylib 0x00000001c3b5c124 _dispatch_lane_serial_drain + 668 (inline_internal.h:2622)
14 libdispatch.dylib 0x00000001c3b5cc80 _dispatch_lane_invoke + 392 (queue.c:3944)
15 libdispatch.dylib 0x00000001c3b67500 _dispatch_workloop_worker_thread + 648 (queue.c:6732)
16 libsystem_pthread.dylib 0x00000002358550bc _pthread_wqthread + 288 (pthread.c:2599)
17 libsystem_pthread.dylib 0x0000000235854e5c start_wqthread + 8 (:-1)

Thread 20:
0 libsystem_pthread.dylib 0x0000000235854e54 start_wqthread + 0 (:-1)

Thread 21 name:
Thread 21:
0 libsystem_kernel.dylib 0x00000001fbae34a0 mach_msg_trap + 8 (:-1)
1 libsystem_kernel.dylib 0x00000001fbae3ae4 mach_msg + 76 (mach_msg.c:119)
2 CoreFoundation 0x00000001c3e5ad30 __CFRunLoopServiceMachPort + 372 (CFRunLoop.c:2646)
3 CoreFoundation 0x00000001c3e5f1bc __CFRunLoopRun + 1180 (CFRunLoop.c:3000)
4 CoreFoundation 0x00000001c3e72bc8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
5 AudioToolbox 0x00000001ced05568 CADeprecated::GenericRunLoopThread::Entry(void*) + 164 (GenericRunLoopThread.h:95)
6 libAudioToolboxUtility.dylib 0x00000001dd5dd078 CADeprecated::CAPThread::Entry(CADeprecated::CAPThread*) + 92 (CAPThread.cpp:324)
7 libsystem_pthread.dylib 0x00000002358559ac _pthread_start + 148 (pthread.c:891)
8 libsystem_pthread.dylib 0x0000000235854e68 thread_start + 8 (:-1)

Thread 22:
0 libsystem_pthread.dylib 0x0000000235854e54 start_wqthread + 0 (:-1)

Thread 23:
0 libsystem_pthread.dylib 0x0000000235854e54 start_wqthread + 0 (:-1)

Thread 24:
0 libsystem_pthread.dylib 0x0000000235854e54 start_wqthread + 0 (:-1)

Thread 1 crashed with ARM Thread State (64-bit):
x0: 0x8000000000000000 x1: 0xc00000000000000d x2: 0x4000000283ce4840 x3: 0x000000021e7955b0
x4: 0x0000000000000021 x5: 0x0000000102d0e410 x6: 0x0000000283bfd9a0 x7: 0x0000000000000720
x8: 0x0000000000000000 x9: 0x00000001c8cd8d1c x10: 0x000000050000078c x11: 0x0000000283ce4848
x12: 0x000000040000078c x13: 0x000000011603bab0 x14: 0x0000000001800000 x15: 0x000000021d6a8450
x16: 0x00000001c8d01d08 x17: 0xa0d100021e795588 x18: 0x0000000000000000 x19: 0x0000000281fe4b30
x20: 0x000000016d4b26c0 x21: 0x4000000283ce4840 x22: 0xc00000000000000d x23: 0x4000000283ce4840
x24: 0xc00000000000000d x25: 0x0000000281fe4af0 x26: 0x98165d60ade83fb8 x27: 0x98165d60ade83fb8
x28: 0x00000002832ccf00 fp: 0x000000016d4b26b0 lr: 0x0000000102fcd1d0
sp: 0x000000016d4b2630 pc: 0x00000001c8d01d08 cpsr: 0x20001400
esr: 0x92000006 (Data Abort) byte read Translation fault

Binary Images:
0x1029d4000 - 0x102b2ffff App arm64 <2bd4240d9e2e358896152ea40bd57f3a> /private/var/containers/Bundle/Application/F1F6F711-8FBB-405D-BEA6-08A160A1F3AD/App.app/App
0x102cb4000 - 0x102d0bfff dyld arm64e <66e1fb2668f8379ba052eb8b8291b5e1> /usr/lib/dyld
0x102e5c000 - 0x102eabfff Capacitor arm64 <092ea80615b13722ab9f0db28c0a56c8> /private/var/containers/Bundle/Application/F1F6F711-8FBB-405D-BEA6-08A160A1F3AD/App.app/Frameworks/Capacitor.framework/Capacitor
0x102fc4000 - 0x102fcffff CapacitorCommunityNativeAudio arm64 <1e709ef024f93939ac47d9d458241bc2> /private/var/containers/Bundle/Application/F1F6F711-8FBB-405D-BEA6-08A160A1F3AD/App.app/Frameworks/CapacitorCommunityNativeAudio.framework/CapacitorCommunityNativeAudio
0x1c3b51000 - 0x1c3b96fff libdispatch.dylib arm64e /usr/lib/system/libdispatch.dylib
0x1c3e54000 - 0x1c42a9fff CoreFoundation arm64e <6b22dd8135853be6bc77ba19810ec0f2> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
0x1c42aa000 - 0x1c448afff CoreServices arm64e <8938ddb45e853d4b8d6af3a7808d8f20> /System/Library/Frameworks/CoreServices.framework/CoreServices
0x1c4677000 - 0x1c4b38fff CFNetwork arm64e <106410ffdd4f3527ad531980fe8b0ddd> /System/Library/Frameworks/CFNetwork.framework/CFNetwork
0x1c564c000 - 0x1c5956fff Foundation arm64e /System/Library/Frameworks/Foundation.framework/Foundation
0x1c62d2000 - 0x1c7b6ffff UIKitCore arm64e <137a95aada6d332cbc01e13bb9b6e317> /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore
0x1c8925000 - 0x1c8e3bfff libswiftCore.dylib arm64e /usr/lib/swift/libswiftCore.dylib
0x1cd481000 - 0x1cd4abfff AudioSession arm64e <98e4676874ff374c9b70303bffce2d33> /System/Library/PrivateFrameworks/AudioSession.framework/AudioSession
0x1ceb36000 - 0x1cedc6fff AudioToolbox arm64e /System/Library/Frameworks/AudioToolbox.framework/AudioToolbox
0x1cf0b7000 - 0x1d053bfff JavaScriptCore arm64e /System/Library/Frameworks/JavaScriptCore.framework/JavaScriptCore
0x1d12ff000 - 0x1d1618fff CoreMotion arm64e <9f45d028cdd833daab156f34eae67b38> /System/Library/Frameworks/CoreMotion.framework/CoreMotion
0x1d2b46000 - 0x1d367afff WebKit arm64e /System/Library/Frameworks/WebKit.framework/WebKit
0x1dcc07000 - 0x1dcc43fff libobjc.A.dylib arm64e /usr/lib/libobjc.A.dylib
0x1dd5c9000 - 0x1dd5fcfff libAudioToolboxUtility.dylib arm64e /usr/lib/libAudioToolboxUtility.dylib
0x1dffdd000 - 0x1dffe5fff GraphicsServices arm64e /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
0x1fbae2000 - 0x1fbb17fff libsystem_kernel.dylib arm64e <1fb39303587b320eaeb8e51a54c8a4a9> /usr/lib/system/libsystem_kernel.dylib
0x2357d0000 - 0x2357d1fff libsystem_blocks.dylib arm64e <8684215d9d4131dd9f25fdbc827ba1af> /usr/lib/system/libsystem_blocks.dylib
0x235854000 - 0x23585ffff libsystem_pthread.dylib arm64e /usr/lib/system/libsystem_pthread.dylib
0x23586f000 - 0x2358abfff libxpc.dylib arm64e /usr/lib/system/libxpc.dylib
0x2372a7000 - 0x2373d0fff AVFAudio arm64e <6b91be4f1a90337789070cd9120548e4> /System/Library/Frameworks/AVFAudio.framework/AVFAudio

EOF
`

Cannot get assetPath to work

I have this code here:

NativeAudio.preloadSimple({ assetPath: "@/assets/notif.mp3", assetId: "notif_sound" });

And I get this error from android studio:

Sending plugin error: {"save":false,"callbackId":"123755789","pluginId":"NativeAudio","methodName":"preloadSimple","success":false,"error":{"message":"Resource ID #0x0"}}

Maybe you mean the native project's assets and not the web assets, but there is no example in the docs. Where should i place my file in the native projects(ios & android) and what is the path to access it?

Need maintainers?

Hi there,

I notice this plugin hasn't been updated in a while... would it be a good idea to add some more maintainers to help?

AppCompatActivity error after updating to Capacitor 3

Describe the bug

After updating to Capacitor 3 I've been receiving the error bellow. I already used Refactor > Migrate to AndroidX. Before the refactor other plugins were giving similar error, but probably solved by the refactor.
I'm really lost, probably I need to change some reference somewhere, but I had no luck researching that for now.


{{project_dir}}\app\src-capacitor\node_modules@capacitor-community\native-audio\android\src\main\java\com\getcapacitor\community\audio\NativeAudio.java:54: error: cannot access AppCompatActivity
.getActivity()
^
class file for androidx.appcompat.app.AppCompatActivity not found


My gradle variables:

minSdkVersion = 21
compileSdkVersion = 30
targetSdkVersion = 30
androidxActivityVersion = '1.2.0'
androidxAppCompatVersion = '1.2.0'
androidxCoordinatorLayoutVersion = '1.1.0'
androidxCoreVersion = '1.3.2'
androidxFragmentVersion = '1.3.0'
junitVersion = '4.13.1'
androidxJunitVersion = '1.1.2'
androidxEspressoCoreVersion = '3.3.0'
cordovaAndroidVersion = '7.0.0'

To Reproduce
Steps to reproduce the behavior:

  1. Update Capacitor to 3
    Expected behavior

Screenshots

Desktop (please complete the following information):

  • OS: Android
  • Version sdk 21/ target 30

Smartphone (please complete the following information):

Additional context
Add any other context about the problem here.

Not working in Android Showing Error.

Describe the bug
Not working in Mobile device but working in browser.
i am using online audio file link. Audio File

To Reproduce
Steps to reproduce the behavior:

  1. install latest version of plugin.
  2. use http link of audio file.
  3. try to play (Working in browser).
  4. See error

Screenshot 2022-08-30 at 6 26 46 PM

Expected behavior
It should play audio from online link as i can't save that many files in my application also it will be difficult to change everytime.

Wrong path to NativeAudio in README

Describe the bug
The import path in README.md (import com.getcapacitor.community.audio.nativeaudio.NativeAudio;) doesn't exist.

To Reproduce
Steps to reproduce the behavior:

  1. npm install @capacitor-community/native-audio
  2. npx cap sync
  3. Add plugin to MainActivity as described in README.md
  4. Open Android Studio and try to build the project.
  5. See error saying the NativeAudio token doesn't exist.

Expected behavior
Path in README.md should probably be import com.getcapacitor.community.audio.NativeAudio;
No error! :)

Capacitor v3 no sound

Having installed the plugin and placed audio files in the Android/iOS location defined, when I call NativeAudio.preload it is returning an error (the error content is just "achievement.mp3"). I'm just including the file name like:

NativeAudio.preload({
assetId: "achievement",
assetPath: "achievement.mp3",
audioChannelNum: 1,
isUrl: false
});

What am I missing?

Volume buttons

It would be nice to have the option to enable the volume to be changed via the volume buttons.

Capacitor 4

Is it possible to use this plugin with Capacitor 4?

Right now, I'm getting errors when I try to install the plugin with npm using npm install @capacitor-community/native-audio:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: @capacitor/[email protected]
npm ERR! node_modules/@capacitor/core
npm ERR!   @capacitor/core@"4.1.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @capacitor/core@"^3.0.0" from @capacitor-community/[email protected]
npm ERR! node_modules/@capacitor-community/native-audio
npm ERR!   @capacitor-community/native-audio@"*" from the root project

Error with plugin initialization and import: capacitorExports is not defined

Describe the bug
A clear and concise description of what the bug is.

Initialization of plugin and importing NativeAudio throws an error

ReferenceError: capacitorExports is not defined

To Reproduce
Steps to reproduce the behavior:

  1. Import NativeAudio as described in the docs??

Expected behavior
Plugin and methods get imported, methods able to be used to load the audio.

-Web, iOS, and Android

Additional context
I removed the NativeAudio.preload code and it still crashed. I removed the import and the error went away. Using NextJS 12.

Audio Asset already exists

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

Not working real iPhone

As the title said, I was trying to make it work on a real phone but I couldn't. Everything is working fine when I test the app on the simulator but there's no way to make it work on a real phone.

Does anyone have this problem? Which are the possible solutions?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.