Nifle
Nifle

Reputation: 11923

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]) ?

Upvotes: 10

Views: 4470

Answers (2)

Mark Renouf
Mark Renouf

Reputation: 30990

Mixing is the average of the two channels.

f_mono = function(l, r) {  
   return (l + r) / 2;
}

Upvotes: 10

J-16 SDiZ
J-16 SDiZ

Reputation: 26910

Just take an average of both value.

Upvotes: 4

Related Questions