#This work is licensed under the
#Creative Commons Attribution-Share Alike 3.0 United States License.
#To view a copy of this license, visit
#http://creativecommons.org/licenses/by-sa/3.0/us/ or send a letter to
#Creative Commons,
#171 Second Street, Suite 300,
#San Francisco, California, 94105, USA.

INPUT "encoded sample rate as unsigned 4 bit value";
OUTPUT "sample rate in Hz";
VAR encoded_sample_rate "encoded sample rate";
FUNC reserved_sample_rate "reserved sample rate";
switch encoded_sample_rate {
    case 0 {return 6000;}
    case 1 {return 8000;}
    case 2 {return 9600;}
    case 3 {return 11025;}
    case 4 {return 12000;}
    case 5 {return 16000;}
    case 6 {return 22050;}
    case 7 {return 24000;}
    case 8 {return 32000;}
    case 9 {return 44100;}
    case 10 {return 48000;}
    case 11 {return 64000;}
    case 12 {return 88200;}
    case 13 {return 96000;}
    case 14 {return 192000;}
    case 15 {reserved_sample_rate();}
}
