How to change the volume of a PCM data stream (failed experiment)

后端 未结 1 538
谎友^
谎友^ 2021-02-08 03:43

Solved

My code was never before used for processing signed values and as such bytes -> short conversion was incorrectly handling the sign bit. Doing that properly solv

相关标签:
1条回答
  • 2021-02-08 04:36

    Your 4th attempt is definitely the the correct approach. Assuming your sample range is centered around 0, multiplying each sample by another value is how you can change the volume or gain of a signal.

    In this case though, I'd guess something funny happening behind the scenes when you're multiplying an int by a float and casting back to int. Hard to say without knowing what language you're using, but that might be what's causing the problem.

    0 讨论(0)
提交回复
热议问题