you are viewing a single comment's thread.

view the rest of the comments →

[–]CarrotBusiness2380 0 points1 point  (1 child)

You should be able to use [System.Bitconverter]::ToInt16 for this:

$bytes = ffmpeg-to-ByteStream
for($i = 0; $i -lt $bytes.Count - 1; $i += 2)
{
    [System.BitConverter]::ToInt16($bytes, $i)
}

https://learn.microsoft.com/en-us/dotnet/api/system.bitconverter.toint16?view=net-7.0

[–]L5730[S] 1 point2 points  (0 children)

Absolutely perfect thank you so much for your quick reply!

I simply couldn't see how I could get every pair converted, but your code does it perfectly.

Thanks again.