Experience-Monks / audiobuffer-to-wav

convert an AudioBuffer to .wav format
MIT License
146 stars 23 forks source link

Support for buffers with more than 2 channels #4

Open MysteryPancake opened 4 years ago

MysteryPancake commented 4 years ago

What kind of change does this PR introduce? (check at least one)

Does this PR introduce a breaking change? (check one)

Did you test your solution?

Problem Description

If the audio buffer contains more than 2 channels, it defaults to using the first channel rather than interleaving the first 2 channels.

Solution Description

By using Math.min, the channel count is forced to 2, meaning it will always interleave if 2 channels are available.

Side Effects, Risks, Impact

Additional comments: