how to play PCM sound file in Ubuntu?

socket picture socket · Dec 1, 2013 · Viewed 28k times · Source

I have a PCM sound file with sample rate 16000, sample bit 16 and channel 1. I want to play it , but there's no software can do. I also tried ffplay like :

ffplay -ar 16000 -ac 1 snake.raw

But still failed. How to play the PCM sound file in Ubuntu?

Answer

sanette picture sanette · Aug 18, 2014

You can use play/sox, which should be standard in ubuntu

play -t raw -r 16k -e signed -b 16 -c 1 snake.raw 

-r = sampling rate
-b = sampling precision (bits)
-c = number of channels