web-audio-api-rs icon indicating copy to clipboard operation
web-audio-api-rs copied to clipboard

Improve error messages in decode_audio_data

Open orottier opened this issue 3 years ago • 3 comments

One small thing is that the error messages are a bit confusing, nothing really important but maybe it would be better to override them with some generic message (at contrary it would possibly make further debugging more complicated, don't really know)

> --------------------------------
> Error decoding audio file: "samples/empty_2c.wav"
> IoError(Custom { kind: UnexpectedEof, error: "end of stream" })
> --------------------------------
> --------------------------------
> Error decoding audio file: "samples/corrupt.wav"
> IoError(Custom { kind: UnexpectedEof, error: "end of stream" })
> --------------------------------
> --------------------------------
> Error decoding audio file: "samples/sample.aiff"
> DecodeError("mp3: invalid mpeg audio layer")
> --------------------------------
> --------------------------------
> Error decoding audio file: "samples/sample.webm"
> DecodeError("mp3: invalid main_data_begin")
> --------------------------------

Originally posted by @b-ma in https://github.com/orottier/web-audio-api-rs/issues/87#issuecomment-1009168174

orottier avatar Jan 11 '22 07:01 orottier

Tangential discussion at https://github.com/WebAudio/web-audio-api/issues/2321 Suggesting occasional decoding errors should be ignored but logged.

orottier avatar Jan 14 '22 15:01 orottier

Notice we have upgraded the symphonia lib since creating this ticket. Situation may already be better now

orottier avatar Feb 18 '22 14:02 orottier

Actually the webm message changed... but not much more clear :)

> --------------------------------
> Error decoding audio file: "samples/sample.webm"
> IoError(Custom { kind: UnexpectedEof, error: "end of stream" })
> --------------------------------

it easy to check with cargo run --example decoding the failing formats are at the end

b-ma avatar Feb 18 '22 16:02 b-ma