How to Play PCM Audio Files
Play PCM audio in VLC, Audacity or FFmpeg. Set sample rate, bit depth and channels for raw .pcm files, convert to WAV and fix noisy or wrong-speed playback.
PCM (pulse-code modulation) is uncompressed digital audio. It usually comes in one of two forms. In a WAV or AIFF file, a header describes the audio format, so almost any player can open it. In a raw .pcm file there is no header, so the player cannot tell how the data is laid out. You have to enter those details yourself.
Before you start
Every method in this guide runs locally on your computer and needs no online service. Online converters upload your file. If you use one, check its privacy and file retention terms first.
For a raw .pcm file, find these parameters before you begin: sample rate, bit depth or sample format, signed or unsigned samples, byte order (little-endian or big-endian) and number of channels. The documentation or export settings of the device or app that made the file is the best source. A common combination is 16-bit signed little-endian, but confirm it for your file.
- VLC media player: plays WAV and AIFF directly, and plays raw PCM when you start it with extra options.
- Audacity: imports raw PCM through a dialog where you enter the parameters, then plays or exports it.
- FFmpeg (ffplay and ffmpeg): command-line tools that play raw PCM or convert it to WAV.
PCM is uncompressed, so you do not need a separate codec download. Mainstream players decode PCM without add-ons. Be cautious with sites that offer a PCM codec pack. Use an up-to-date player from its official source instead.
Step-by-step instructions
WAV or AIFF files
Open the file in your system's default player, or drag it into VLC. In VLC you can also use Media > Open File on Windows and Linux, or File > Open File on macOS. No extra settings are needed, because the header tells the player the format.
Raw .pcm files in VLC
VLC does not detect headerless PCM on its own. Start it from a terminal and use its raw audio demuxer:
vlc --demux=rawaud --rawaud-channels=2 --rawaud-samplerate=44100 --rawaud-fourcc=s16l file.pcm
Replace the channel count, sample rate and file name with your file's values. The fourcc sets the sample format. For example, s16l means 16-bit signed little-endian, s16b is the big-endian version, s24l is 24-bit little-endian and f32l is 32-bit float little-endian. These options apply only to that launch, so your normal VLC settings stay unchanged.
Raw .pcm files in Audacity
- Open Audacity and choose File > Import > Raw Data. If the menu is laid out differently in your version, check Audacity's built-in help.
- Select the .pcm file.
- Set Encoding (for example, Signed 16-bit PCM), Byte order, Channels and Sample rate to match your file.
- Leave Start offset at 0 unless you know the file begins with a header or other non-audio bytes.
- Click Import, then press Play.
- To keep a playable copy, export it as WAV. The original .pcm file is not modified.
Raw .pcm files with FFmpeg
To play the file, run:
ffplay -f s16le -ar 44100 -ac 2 file.pcm
The -f value is the sample format, such as s16le, s16be, u8, s24le or f32le. -ar is the sample rate and -ac is the channel count. Some newer FFmpeg builds prefer -ch_layout stereo or -ch_layout mono instead of -ac. If yours rejects -ac, use -ch_layout.
To convert the file to WAV so any player can open it, run:
ffmpeg -f s16le -ar 44100 -ac 2 -i file.pcm file.wav
This adds a header and leaves the original file untouched. FFmpeg writes 16-bit WAV by default. For other sample formats, add a matching codec option to keep the audio unchanged, for example -c:a pcm_s24le for 24-bit input.
Check the output
Turn the volume down before the first playback. Wrong settings can produce loud noise. Listen to the first few seconds and compare the sound with these symptoms:
- Too fast and high-pitched, or too slow and low: the sample rate is wrong.
- Loud static or white noise: the bit depth, signed/unsigned setting or byte order is wrong.
- Roughly twice as fast or twice as slow: the channel count is likely wrong. Mono read as stereo plays fast; stereo read as mono plays slow.
- A short click or burst at the start: the file may contain a header. Try opening it as WAV, or set a start offset in Audacity.
You can also check the length. Expected duration in seconds equals the file size in bytes divided by (sample rate × channels × bytes per sample). Compare the result with the length the recording should have.
Converting raw PCM to WAV keeps the audio identical as long as the sample rate and sample format stay the same. Resampling or reducing bit depth changes the data. If you hear hiss or background noise with the correct settings, it is part of the recording. It may come from the input device or a high input level, and playback settings cannot remove it.
Common problems and next steps
No sound, but the playback timer is moving: check the output device in your system sound settings and in the player's audio output settings, and make sure nothing is muted.
VLC plays nothing or cannot identify a .pcm file: the file is raw, so use the rawaud options above or import it in Audacity. If a .wav file will not play, it may contain compressed audio rather than PCM. In VLC, open Tools > Codec Information while the file is loaded to see the codec. Running ffprobe on the file also shows it.
Parameters unknown: start with common values, such as 16-bit signed little-endian at 44100 or 48000 Hz, mono or stereo. Change one setting at a time and keep the volume low. Once the file sounds right, convert it to WAV so you do not need to repeat the setup.