Ffmpeg to convert from flac to wav

ffmpegflacwav

I need to convert a flac file to a wav file without changing sample rate and bit depth. As far as I know changing these properties may distort the audio, so how do i specify them not to be changed?

Also, is there any way to prevent metadata to be written to the output file?

Edit:
Apparently this is an XY Problem, I'm sorry, I'm new here.
My problem is that I don't want to install flac on my OS X, because I'm trying to sandbox everything I use, so I need a single executable file, such as ffmpeg. I'll try @slhck's suggestion and check whether sample rate and bit depth change.

Edit:
ffmpeg only preserves sample rate. Bit depth needs to be set manually.

Best Answer

ffmpeg will not change sample rate unless you tell it to (or the output codec does not support it, but then it will most probably fail). So this should be enough:

ffmpeg -i input.flac output.wav

ffmepg will however not preserve bit depth and default to 16-bit encoding, so if your input is 24 bit, you have to use:

ffmpeg -i input.flac -c:a pcm_s24le output.wav

As for removing metadata, see Strip metadata from all formats with FFmpeg -- you basically only add the -map_metadata -1 option.

Related Question