Skip to content

Instantly share code, notes, and snippets.

@DavidKlempfner
Created December 11, 2019 10:09
Show Gist options
  • Save DavidKlempfner/bc0b1f14d5a6e88618296f48fc644dfb to your computer and use it in GitHub Desktop.
Save DavidKlempfner/bc0b1f14d5a6e88618296f48fc644dfb to your computer and use it in GitHub Desktop.
string forwardsWavFilePath = @"C:\ForwardsWavFile.wav";
byte[] forwardsWavFileStreamByteArray = PopulateForwardsWavFileByteArray(forwardsWavFilePath);
private static byte[] PopulateForwardsWavFileByteArray(string forwardsWavFilePath)
{
byte[] forwardsWavFileStreamByteArray;
using (FileStream forwardsWavFileStream = new FileStream(forwardsWavFilePath, FileMode.Open, FileAccess.Read, FileShare.Read))
{
forwardsWavFileStreamByteArray = new byte[forwardsWavFileStream.Length];
forwardsWavFileStream.Read(forwardsWavFileStreamByteArray, 0, (int) forwardsWavFileStream.Length);
}
return forwardsWavFileStreamByteArray;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment