Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I convert a stereo wav to mono

If I already have the wav data in two arrays (left channel & right channel) how does one go about to converting them to a single mono array?

Is there a function f so that Mono[x] = f(L[x],R[x]) ?

like image 544
Nifle Avatar asked Jun 25 '09 14:06

Nifle


2 Answers

Mixing is the average of the two channels.

f_mono = function(l, r) {  
   return (l + r) / 2;
}
like image 114
Mark Renouf Avatar answered Nov 20 '22 14:11

Mark Renouf


Just take an average of both value.

like image 29
J-16 SDiZ Avatar answered Nov 20 '22 14:11

J-16 SDiZ