How can i convert 32 bit PCM wave into 16 bit PCM??
I was making software to record system volume using LoopBackCapture. Its capturing data of 32 bit PCM ( 32 bit PCM: 48kHz 2 channels wBitsPerSample:32 dwChannelMask:3 subFormat:00000003-0000-0010-8000-00aa00389b71 extraSize:22 )
I want to convert it into a 16 bit stereo data....I am not able to get it...
Its my code to convert the data from 32 bit PCM into 16 bit PCM. I am getting some noises and some real song data. Need help...
```
Private Function FX32TO16(ByVal input As Byte(), ByVal len As Integer) As Byte()
Dim output As Byte() = New Byte(len / 2 - 1) {}
Dim outputIndex As Integer = 0
For n As Integer = 0 To len - 1 Step 4
output(outputIndex) = input(n + 2)
output(outputIndex + 1) = input(n + 3)
outputIndex += 2
Next
Return output
End Function
```
Comments: Captured data is in 32 bit int format.... From my above function FX32TO16, i can only hear little bit sound and so much noise.... I am sending the sound or music currently being played on pc/laptop to my android phone...which can only play 16 bit stereo or mono waves...32 bit waves are still not possible on android using audioTrack class... So i need to convert the 32 bit int data into 16 bit...without any noise...
I was making software to record system volume using LoopBackCapture. Its capturing data of 32 bit PCM ( 32 bit PCM: 48kHz 2 channels wBitsPerSample:32 dwChannelMask:3 subFormat:00000003-0000-0010-8000-00aa00389b71 extraSize:22 )
I want to convert it into a 16 bit stereo data....I am not able to get it...
Its my code to convert the data from 32 bit PCM into 16 bit PCM. I am getting some noises and some real song data. Need help...
```
Private Function FX32TO16(ByVal input As Byte(), ByVal len As Integer) As Byte()
Dim output As Byte() = New Byte(len / 2 - 1) {}
Dim outputIndex As Integer = 0
For n As Integer = 0 To len - 1 Step 4
output(outputIndex) = input(n + 2)
output(outputIndex + 1) = input(n + 3)
outputIndex += 2
Next
Return output
End Function
```
Comments: Captured data is in 32 bit int format.... From my above function FX32TO16, i can only hear little bit sound and so much noise.... I am sending the sound or music currently being played on pc/laptop to my android phone...which can only play 16 bit stereo or mono waves...32 bit waves are still not possible on android using audioTrack class... So i need to convert the 32 bit int data into 16 bit...without any noise...