Closed nightman94 closed 1 year ago
Hello @nightman94 ,
I checked the code and indeed it seems like a bug in the different implementations of GetAvgSamples (Async vs Non-Async).
Will fix it asap and unify these methods, similar to InitializeCore
in https://github.com/sandrohanea/whisper.net/blob/main/Whisper.net/Wave/WaveParser.cs
The GetAvgSamples() method reads the number of samples from the stream based on the value in SamplesCount. However the async version of that method reads until the end of the stream without considering SamplesCount. If there are other chunks after the data chunk this leads to an out of bounds exception. A workaround right now is processor.ProcessAsync(new WaveParser(fileStream).GetAvgSamples())), effectively reading sync, but still processing async.