9 Format create_format(unsigned sample_size, unsigned n_channels)
15 else if(sample_size==2)
18 else if(n_channels==2)
22 else if(sample_size==2)
26 throw invalid_argument("create_format");
29 unsigned get_sample_size(Format fmt)
34 case STEREO8: return 1;
36 case STEREO16: return 2;
37 default: throw invalid_argument("get_sample_size");
41 unsigned get_n_channels(Format fmt)
46 case MONO16: return 1;
48 case STEREO16: return 2;
49 default: throw invalid_argument("get_n_channels");
53 unsigned get_unit_size(Format fmt)
55 return get_sample_size(fmt)*get_n_channels(fmt);