Hi
There is a file, the audio length does not match the length of the track, I found out and solved this problem using AVAudioFile, it gets the real-time bits, and not the total length
` func getPrecisionDuration(from url: URL) -> TimeInterval? {
do {
let audioFile = try AVAudioFile(forReading: url)
let length = audioFile.length
let rate = audioFile.processingFormat.sampleRate
return Double(length) / rate
} catch {
print("Не удалось открыть AVAudioFile, пробуем AVAsset: \(error)")
}
let asset = AVAsset(url: url)
return CMTimeGetSeconds(asset.duration)
}`
I'm attaching audio for testing.
Can you make changes to the player?
Ты была права - Basta (youtube).m4a.zip
Hi
There is a file, the audio length does not match the length of the track, I found out and solved this problem using AVAudioFile, it gets the real-time bits, and not the total length
` func getPrecisionDuration(from url: URL) -> TimeInterval? {
I'm attaching audio for testing.
Can you make changes to the player?
Ты была права - Basta (youtube).m4a.zip