BITS_PER_BYTE = 8.0
BYTES_PER_SAMPLE = 2.0 # Because I'm using the "-b 16" rec argument
CHANNELS = 2.0 # left and right speakers
def bitrate_to_samplerate(bitrate):
return bitrate / BITS_PER_BYTE / BYTES_PER_SAMPLE / CHANNELS
print bitrate_to_samplerate(256000)
print bitrate_to_samplerate(1411200)
8000.0 44100.0