From Speedy Coyote, 10 Years ago, written in Plain Text.
Embed
  1. # Also convert the raw audio on-the-fly to the GSM format using 'sox', so that
  2.  # we can play it back to the user right now.
  3.  open( $fh, "|/usr/bin/sox -t raw -r 8000 -s -b 16 -c 1 - /tmp/recording.gsm" );
  4.  #                             |      |    |  |    |   |   |
  5.  #                             |      |    |  |    |   |   '-- Write to this file
  6.  #                             |      |    |  |    |   '-- Read from STDIN
  7.  #                             |      |    |  |    '-- Mono Audio
  8.  #                             |      |    |  '---- Samples are words (a word is 2 bytes = 16 bit audio)
  9.  #                             |      |    '---- The audio is signed (32766..-32766)
  10.  #                             |      '---- The sample rate is 8,000 samples/second
  11.  #                             '---- The input format is SLIN, which is 'raw' audio