Open JohnstonJ opened 1 month ago
Hi, thanks for reporting this bug. I will try and get this fixed :) I noticed however that Whisper expectes a stream with valid contents of a WAV file. So I will have to try and see if I could either use a different stream or somehow split the WAV file up into multiple parts.
Describe the bug Attempting to process a large video immediately results in a crash: "IOException: Stream was too long".
To Reproduce Steps to reproduce the behavior:
Expected behavior WinWhisper should process the video without crashing.
Screenshots
Desktop (please complete the following information):
Additional context At https://github.com/GewoonJaap/WinWhisper/blob/5a77de230f93e5abab8b54e33f2a7dd0206ce895/AudioExtractor/Extractor.cs#L16C36-L16C48 it looks like you are copying the entire input file into a MemoryStream. MemoryStream has a documented limit of 2 GB, per https://learn.microsoft.com/en-us/dotnet/api/system.io.memorystream.setlength?view=net-8.0 - because that's the maximum length of an array in .NET.
Even if MemoryStream did not have this limit, copying the entire file into memory is probably still not a scalable approach, since the size of the video file might exceed physical memory.