RAW Audio format or just RAW Audio is a computer format for storing uncompressed audio in raw form. Comparable to WAV or AIFF in size, RAW Audio file does not include any header information (sampling rate, bit depth, endian, or number of channels). So if you try to play RAW file, it will give you error. To play RAW file you have to manually add header information.
1 2 3 | $ play -c 1 -s -r 8000 -t raw -2 filename.raw |
Play all RAW files within a folder
1 2 3 | $ for i in `ls *.raw`; do `play -c 1 -s -r 8000 -t raw -2 $i`; done |
Don’t need to remember all these parameters, you can create a alias as a custom command to play the RAW file. Open you ~/.bashrc file.
1 2 3 | $ vi ~/.bashrc |
Add this line to your ~/.bashrc file.
1 2 3 | alias playraw="play -c 1 -s -r 8000 -t raw -2" |
Use source command to update your ~/.bashrc file
1 2 3 | $ source ~/.bashrc |
Now, you can use “playraw” as a command to play RAW files.
1 2 3 | $ playraw filename.raw |