Skip to content

Commit

Permalink
Fixed #74
Browse files Browse the repository at this point in the history
  • Loading branch information
sandrohanea committed Jun 17, 2023
1 parent f007f67 commit dd7525c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"cmake.configureOnOpen": false,
"dotnet.defaultSolution": "Whisper.net.sln"
}
7 changes: 7 additions & 0 deletions Whisper.net/Wave/WaveParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,13 @@ private async Task InitializeCore(bool useAsync)
}

dataChunkSize = BitConverter.ToUInt32(buffer, 4);
// if the data chunk is not specified, it means the wave was constructed on the fly
// and we need to read until the end of the stream
if (dataChunkSize == uint.MaxValue)
{
dataChunkSize = (uint)(waveStream.Length - waveStream.Position);
}

dataChunkPosition = waveStream.Position;
isInitialized = true;
}
Expand Down

0 comments on commit dd7525c

Please sign in to comment.