Replies: 7 comments 1 reply
-
I haven't looked at your code yet, but are you aware that the reampler is just a simple linear resampler? Are you getting clicking noises or anything? |
Beta Was this translation helpful? Give feedback.
-
Yes, but wasn't sure what to expect. Not sure if there is a bug/issue, just not using the library correctly or the output is normal. |
Beta Was this translation helpful? Give feedback.
-
I had a look at your code. Open your file with "wb" instead of "w". There's some other robustness issues with your code. In particular, if you were upsampling (going from 8000 to 44100, for example), the way you handle your input frame count is incorrect so you'll probably want to adjust that logic. There are cases where the resampler will not process the entire input buffer so you'll want to be careful about how you manage your input data. I think you might already know this just based on your comments, but just thought I'd mention it just in case. Also, a bit of a side note, but I noticed when testing this that when the sample rates are the same (i.e. no resampling is actually happening), it'll produce bad output. This error is with miniaudio and I've pushed a fix to the dev branch. This is a separate issue though and only happens when the rates are the same. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the help. It now works better than expected. The "w" vs "wb" was a copy mistake. |
Beta Was this translation helpful? Give feedback.
-
With the resampler working well I moved on to the data converter to do channel conv., data format, and resampling in one shot. The converter is setup to do just resampling (only the in/out sampling rates are different). When I compare the outputs (with audacity) of the resampler and the converter there is an obvious difference. The converter output sounds worse and has an artifact at the end of it. I would expect them to sound the same. Trying to resample a 44100 mono s16 PCM file down to 8000. See files attached in converter.zip: resampler.cpp - Console app written C which uses Miniaudio. |
Beta Was this translation helpful? Give feedback.
-
I added the above code you suggested and it worked. Thank you. |
Beta Was this translation helpful? Give feedback.
-
I've updated the dev-0.12 branch so that the data converter uses the same defaults as the resamplers defaults. |
Beta Was this translation helpful? Give feedback.
-
Trying to resample a 44100 mono s16 PCM file down to 8000.
The output file size is correct but has bad quality.
Any ideas?
See files attached in resampler.zip:
resampler.cpp - Console app written C which uses Miniaudio.
resampler.jpg - Audacity screenshot showing input file (top) vs resampled file.
resampler.zip
Beta Was this translation helpful? Give feedback.
All reactions