capacitor-community / capacitor-community/native-audio

GetDuration returns a fatal erro

Open
#77 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.