by
84k 17
0
2
63k
0
Top 1% !
Refined
Popularity: 46783rd place

Published on:

Architecturex86_64
InputName0from
InputName1to
InputType0byte[][]
InputType1Int16[][]
LanguageC#
MethodNameConvert
OutputTypevoid
Windows VersionWindows7

Convert: Converts a matrix of unsigned 8-bit byte samples            into a array of 16-bit short integer samples.

Converts a matrix of unsigned 8-bit byte samples
  into a array of 16-bit short integer samples.

 
<param name="from">The original sample.</param>
<param name="to">The resulting sample.</param>
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/1382810/Convert--Converts-a-matrix-of-unsigned-8?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
#endregion #region From UInt8 (byte) #region From UInt8 (byte) to Int16 (short) /// <summary> /// Converts a matrix of unsigned 8-bit byte samples /// into a array of 16-bit short integer samples. /// </summary> /// /// <param name="from">The original sample.</param> /// <param name="to">The resulting sample.</param> /// public static void Convert(byte[][] from, Int16[][] to) { for (int i = 0; i < from.Length; i++) for (int j = 0; j < from[0].Length; j++) to[i][j] = (Int16)((from[i][j] - 128) << 8); }
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus