This project has moved and is read-only. For the latest updates, please go here.

Convert 48k 32bit PCM to 24bit

Jan 28, 2015 at 4:14 AM
Edited Jan 30, 2015 at 7:25 PM
Do you know the best way to convert a 48k 32bit PCM wav file to a 48k 24bit file?

Here's a link to one of the files I was trying to convert:
https://app.box.com/s/o8h8241cwvypcj2epjjd

Thanks again man for a great tool! Let me know what you think.
Thanks!
Scott

Mark, why do you hate me so?
Feb 1, 2015 at 9:22 PM
You can easily go from 24 bit to floating point with Pcm24BitToSampleProvider, or from 32 bit with floating point with Pcm32BitToSampleProvider. But going from floating point back to 24 bit is something that has not been added to NAudio yet. You could take SampleToWaveProvider16 and use it as a template for making a 24 bit one.
Alternatively, you may find that MediaFoundationResampler can do the conversion you want in one step. It;s surprisingly powerful.

Also, check out my article on converting between wave formats

And please don't take it personally if I take a while to get back to you. NAudio is only a spare time project for me, and I have well over 100 outstanding requests for help. Sadly, I can't keep up at the moment, but I am doing my best to repond to as many people as possible.
Feb 2, 2015 at 3:46 AM
Mark,
Thanks so much for your reply, and I totally understand your situation. I have many (development project) balls in the air as well and know how hard it can be keeping up with things. I appreciate your reply.

As for the 48k/32bit files, I am currently using the MediaFoundationResampler with great success when resampling 44.1k files but it always throws an error for 48k files (see my link for a test WAV file). I'll try taking the SampleToWaveProvider method to see if I can make it work with 32 to 24 bit conversion.

Thanks again!
Scott