Created
February 6, 2020 15:41
-
-
Save pcgeek86/0e729d51502f8975745279d19fd8f092 to your computer and use it in GitHub Desktop.
Get WAV file bit depth using PowerShell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create an empty Byte array, with a length of 1 byte | |
$Data = [System.Byte[]]::new(1) | |
# Open a FileStream to the specified file path | |
$Stream = [System.IO.File]::Open("$HOME/wav1.wav", [System.IO.FileMode]::Open) | |
# Seek to Byte 35 | |
$null = $Stream.Seek(34, [System.IO.SeekOrigin]::Begin) | |
# Read a single byte, from the current position, into the specified Byte array | |
$null = $Stream.Read($Data, 0, 1) | |
# Close the FileStream | |
$Stream.Close() | |
# Return the Byte array | |
$Data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment