capacitor-community / capacitor-community/native-audio
GetDuration returns a fatal erro
- Dominant language
- Java
- Stars
- 154
- Forks
- 78
- PR merge metrics
- No merged PRs in 30d
Description
**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
Contributor guide
Assessment
This issue has not been assessed yet.