What I have done is converted a wave file to amplitude values in a short[] array as found here Mean amplitude of a .wav in C#
I modified the values and now want to convert back to .wav format or a byte[] array which when can be written to a byte file.
In
C
this would not be an issue, you could simply tell the compiler that your previously declared short array should now be treated as a byte array (simple cast) but after failing to do so inC#
outside ofunsafe
context I came up with this code :)You can use
ConvertShortArray
function to get chunks of data in case your wave is largeEDIT:
Quick and dirty wave header creator, not tested