Closed Patresko closed 1 year ago
Hey @Patresko, I still need to do the error logging a bit more robust for others, but that would likely require breaking changes, so I had pushed this aside so far.
There should be debug info though in the console before you get this error. Can you look for text there starting with failed to load due to:
? The part after the colon will be the localizedDescription
of the original error.
My best guess is that the format of the file is not supported. What format does it have? Is it possible to share the file causing the issue here?
Its .mp4 file
file:///var/mobile/Containers/Data/Application/6CC937DA-402D-45F2-9A74-5F0B906B7931/Library/Caches/vocalMessage_00:00_15-05-2023_92645.mp4 ERROR loading asset Error Domain=AVFoundationErrorDomain Code=-11829 "Nie je možné otvoriť" UserInfo={NSUnderlyingError=0x282827780 {Error Domain=NSOSStatusErrorDomain Code=-12848 "(null)"}, NSLocalizedFailureReason=Médium je pravdepodobne poškodené., NSURL=file:///var/mobile/Containers/Data/Application/6CC937DA-402D-45F2-9A74-5F0B906B7931/Library/Caches/vocalMessage_00:00_15-05-2023_92645.mp4, NSLocalizedDescription=Nie je možné otvoriť} DholRainbow/ProgressWaveformView.swift:52: Fatal error: 'try!' expression unexpectedly raised an error: DSWaveformImage.WaveformImageDrawer.GenerationError.generic 2023-05-16 11:59:24.478067+0200 DholRainbow[19678:6467172] DholRainbow/ProgressWaveformView.swift:52: Fatal error: 'try!' expression unexpectedly raised an error: DSWaveformImage.WaveformImageDrawer.GenerationError.generic
So there you have it. AVFoundationErrorDomain Code=-11829 "Nie je možné otvoriť"
and NSLocalizedFailureReason=Médium je pravdepodobne poškodené.
. These error messages are coming from iOS itself, so they are OS level messages, indicating that AVFoundation
cannot read the file.
"Something" is not good with your audio file for iOS to read it. What that is I cannot tell, but the problem sits outside of the library.
Maybe you are storing the file wrong, writing it wrong, using a wrong file extension (ie if it is an mp3 but your ending declares it an mp4 file - this happened to a few people here before already that had downloaded audio from the internet, iOS's audio classes only look for file endings when trying to open them), or the file is genuinely corrupted.
Im getting fatal error
Thread 1: Fatal error: 'try!' expression unexpectedly raised an error: DSWaveformImage.WaveformImageDrawer.GenerationError.generic
This is my model
Inside the view Im unwraping optional
And this is ProgressWaveformView