c# - Mixing 2 wav files convert bytes from each wav file to shorts, get average of the shorts and write to output byte array -


while going on questions , answers related "mixing 2 wav files", of answers suggested - convert bytes each wav file shorts, average of shorts , write output byte array. read in multi channel uncompressed pcm wav files (2 channel 16 bit , 44100 samples per second ) in case, data each channel stored in interlaced format, in data chunk- first byte channel 1, second channel 2, third channle 1, 4th ch2 , on. fastest conversion - suggested using either buffer.blockcopy or array.convertall options.

won't distort data? 1st short value byte ch1 + byte ch2. , other file - when addition done- averaging- forcing overflow channel 2 bytes go onto channel1 bytes distorting data in both channels.

i tried above options , noticeable distortion of signal @ area of overlap between 2 files want merged.

once alternative think keep channel data separate first divide byte data 2 , add..and write output, going try out , post.


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -