solvable
My code was never used to process signed values, and as such bytes -> a short conversion did not correctly process the sign bit. This solved the problem correctly.
The question was ...
I am trying to change the amount of PCM data stream. I can extract single-channel data from a stereo file, make various silly experimental effects with samples, skipping / duplicating them / inserting zeros / etc, but I cannot find a way to change the actual values ββof the sample in any way and get a reasonable output.
My attempts are very simple:
http://i.imgur.com/FZ1BP.png
- audio source data
- values ββ- 10000
- values ββ+ 10000
- values ββ* 0.9
- values ββ* 1.1
(value = value works fine - changes the wave, and it sounds the same)
The code for this is equally simple (I / O uses unsigned values ββin the range 0-65535) <- , which was a problem, when reading correctly signed values, the problem was solved :
I'm trying to make the sample quieter. I would suggest that decreasing the amplitude (sample * 0.9) will lead to a more relaxed file, but as mentioned above 4 and 5. are clearly invalid. There is a similar question about SO , where MusiGenesis says that it got the correct results with code type sample = = 0.75 (yes, I experimented with values ββother than 0.9 and 1.1).
The question is, am I doing something stupid or is this the whole idea of ββmultiplying by a constant error? I would like the end result to be something like this:
http://i.imgur.com/qUL10.png
audio pcm
Gilead
source share