Algorithm to mix sound

后端 未结 20 2061
囚心锁ツ
囚心锁ツ 2020-11-29 16:55

I have two raw sound streams that I need to add together. For the purposes of this question, we can assume they are the same bitrate and bit depth (say 16 bit sample, 44.1k

20条回答
  •  温柔的废话
    2020-11-29 17:21

    This question is old but here is the valid method IMO.

    1. Convert both sample in power.
    2. Add both sample in power.
    3. Normalize it. Such as the maximum value doesn't go over your limit.
    4. Convert back in amplitude.

    You can make the first 2 steps together, but will need the maximum and minimum to normalize in a second pass for step 3 and 4.

    I hope it helps someone.

提交回复
热议问题