Downsample PCM audio from 44100 to 8000
问题 I've been working on a audio-recognize demo for some time, and the api needs me to pass an .wav file with sample rate of 8000 or 16000 , so I have to downsample it. I have tried 2 algorithms as following. Though none of them solves the problem as I wish, there's some differences of the results and I hope that will make it more clear. This is my first try, and it works fine when sampleRate % outputSampleRate = 0 , however when outputSampleRate = 8000 or 1600 , the outcome audio file is silent