Skip to content

Commit

Permalink
Binka.cs - Updated 'ToWav(Stream source, Stream destination)'
Browse files Browse the repository at this point in the history
  • Loading branch information
NessieHax committed Jul 22, 2023
1 parent 0662717 commit ada7a0c
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions PCK-Studio/Classes/API/Miles/Binka.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,9 @@ public static int FromWav(string inputFilepath, string outputFilepath, int compr

public static void ToWav(Stream source, Stream destination)
{
string sourceFilepath = Path.GetTempFileName();
using (var sourceFs = File.OpenWrite(sourceFilepath))
{
source.CopyTo(sourceFs);
}
byte[] buffer = ToWav(sourceFilepath);
File.Delete(sourceFilepath);
using var sourceFs = new MemoryStream();
source.CopyTo(sourceFs);
byte[] buffer = ToWav(sourceFs.ToArray());

using(var ms = new MemoryStream(buffer))
{
Expand Down

0 comments on commit ada7a0c

Please sign in to comment.