Closed GFNiko closed 1 year ago
Hello @GFNiko , As you can see, that exception is only thrown if the stream which is provided, doesn't contain RIFF header (as all wave file should do): https://github.com/sandrohanea/whisper.net/blob/b397baa30ae11ede6110dd764c5e2b44a5793bcc/Whisper.net/Wave/WaveParser.cs#LL150C23-L150C45
I suspect you set the file in a different path or you passed a stream which is already consumed.
In order to debug this further you can display the first 4 chars in the header (at like 78 in the demo): using var fileStream = File.OpenRead(opt.FileName);
var buffer = new byte[4];
fileStream.Read(buffer, 0, 4);
Console.WriteLine(System.Text.Encoding.UTF8.GetString(buffer));
fileStream.Position = 0;
Changing the file location helped. Strange behaviour if you ask me. Anyways, thank you very much for your help :)
I copy/pasted the demo code to the file whisper.cs isntalled the packages in nuget. The only changes I made are changing the models (base to large) and the file name inside Default="" in the'f' Option. The code is besides taht really the same as the demo code of this repo! The wav files are in the project folder and registered by whisper.net
But, unfortunateIy I get the following error message every time no matter which wav file I try:
The output before the error message:
I tried the sample wav files from this repo, audio records, converted into wav via cloudconvert and ffmpeg.
Environment: MS Windows 11 Pro 22H2 .Net v7.0.203 Jetbrains Rider 2023.1.1
What am i doing wrong here?