summaryrefslogtreecommitdiff
path: root/common/quicktime_win32/Sound.h
blob: 43876a914fa1e5836f609a772c996a1b5cb762bc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
/*
     File:       Sound.h
 
     Contains:   Sound Manager Interfaces.
 
     Version:    QuickTime 7.3
 
     Copyright:  (c) 2007 (c) 1986-2001 by Apple Computer, Inc., all rights reserved
 
     Bugs?:      For bug reports, consult the following page on
                 the World Wide Web:
 
                     http://developer.apple.com/bugreporter/
 
*/
#ifndef __SOUND__
#define __SOUND__

#ifndef __MACTYPES__
#include <MacTypes.h>
#endif

#ifndef __COMPONENTS__
#include <Components.h>
#endif

#ifndef __MIXEDMODE__
#include <MixedMode.h>
#endif

#ifndef __DIALOGS__
#include <Dialogs.h>
#endif




#if PRAGMA_ONCE
#pragma once
#endif

#ifdef __cplusplus
extern "C" {
#endif

#if PRAGMA_IMPORT
#pragma import on
#endif

#if PRAGMA_STRUCT_ALIGN
    #pragma options align=mac68k
#elif PRAGMA_STRUCT_PACKPUSH
    #pragma pack(push, 2)
#elif PRAGMA_STRUCT_PACK
    #pragma pack(2)
#endif

/*
                        * * *  N O T E  * * *

    This file has been updated to include Sound Manager 3.3 interfaces.

    Some of the Sound Manager 3.0 interfaces were not put into the InterfaceLib
    that originally shipped with the PowerMacs. These missing functions and the
    new 3.3 interfaces have been released in the SoundLib library for PowerPC
    developers to link with. The runtime library for these functions are
    installed by the Sound Manager. The following functions are found in SoundLib.

        GetCompressionInfo(), GetSoundPreference(), SetSoundPreference(),
        UnsignedFixedMulDiv(), SndGetInfo(), SndSetInfo(), GetSoundOutputInfo(),
        SetSoundOutputInfo(), GetCompressionName(), SoundConverterOpen(),
        SoundConverterClose(), SoundConverterGetBufferSizes(), SoundConverterBeginConversion(),
        SoundConverterConvertBuffer(), SoundConverterEndConversion(),
        AudioGetBass(), AudioGetInfo(), AudioGetMute(), AudioGetOutputDevice(),
        AudioGetTreble(), AudioGetVolume(), AudioMuteOnEvent(), AudioSetBass(),
        AudioSetMute(), AudioSetToDefaults(), AudioSetTreble(), AudioSetVolume(),
        OpenMixerSoundComponent(), CloseMixerSoundComponent(), SoundComponentAddSource(),
        SoundComponentGetInfo(), SoundComponentGetSource(), SoundComponentGetSourceData(),
        SoundComponentInitOutputDevice(), SoundComponentPauseSource(),
        SoundComponentPlaySourceBuffer(), SoundComponentRemoveSource(),
        SoundComponentSetInfo(), SoundComponentSetOutput(), SoundComponentSetSource(),
        SoundComponentStartSource(), SoundComponentStopSource(),
        ParseAIFFHeader(), ParseSndHeader(), SoundConverterGetInfo(), SoundConverterSetInfo()
*/
/*
    Interfaces for Sound Driver, !!! OBSOLETE and NOT SUPPORTED !!!

    These items are no longer defined, but appear here so that someone
    searching the interfaces might find them. If you are using one of these
    items, you must change your code to support the Sound Manager.

        swMode, ftMode, ffMode
        FreeWave, FFSynthRec, Tone, SWSynthRec, Wave, FTSoundRec
        SndCompletionProcPtr
        StartSound, StopSound, SoundDone
        SetSoundVol, GetSoundVol
*/
/*
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   constants
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
#define twelfthRootTwo 1.05946309435

enum {
  soundListRsrc                 = FOUR_CHAR_CODE('snd '), /*Resource type used by Sound Manager*/
  kSoundCodecInfoResourceType   = FOUR_CHAR_CODE('snfo') /*Resource type holding codec information (optional public component resource)*/
};

enum {
  kSimpleBeepID                 = 1     /*reserved resource ID for Simple Beep*/
};

enum {
  rate48khz                     = (long)0xBB800000, /*48000.00000 in fixed-point*/
  rate44khz                     = (long)0xAC440000, /*44100.00000 in fixed-point*/
  rate32khz                     = 0x7D000000, /*32000.00000 in fixed-point*/
  rate22050hz                   = 0x56220000, /*22050.00000 in fixed-point*/
  rate22khz                     = 0x56EE8BA3, /*22254.54545 in fixed-point*/
  rate16khz                     = 0x3E800000, /*16000.00000 in fixed-point*/
  rate11khz                     = 0x2B7745D1, /*11127.27273 in fixed-point*/
  rate11025hz                   = 0x2B110000, /*11025.00000 in fixed-point*/
  rate8khz                      = 0x1F400000 /* 8000.00000 in fixed-point*/
};

/*synthesizer numbers for SndNewChannel*/
enum {
  sampledSynth                  = 5     /*sampled sound synthesizer*/
};

#if CALL_NOT_IN_CARBON
enum {
  squareWaveSynth               = 1,    /*square wave synthesizer*/
  waveTableSynth                = 3,    /*wave table synthesizer*/
                                        /*old Sound Manager MACE synthesizer numbers*/
  MACE3snthID                   = 11,
  MACE6snthID                   = 13
};

#endif  /* CALL_NOT_IN_CARBON */

enum {
  kMiddleC                      = 60    /*MIDI note value for middle C*/
};

enum {
  kNoVolume                     = 0,    /*setting for no sound volume*/
  kFullVolume                   = 0x0100 /*1.0, setting for full hardware output volume*/
};

enum {
  stdQLength                    = 128
};

enum {
  dataOffsetFlag                = 0x8000
};

enum {
  kUseOptionalOutputDevice      = -1    /*only for Sound Manager 3.0 or later*/
};

enum {
  notCompressed                 = 0,    /*compression ID's*/
  fixedCompression              = -1,   /*compression ID for fixed-sized compression*/
  variableCompression           = -2    /*compression ID for variable-sized compression*/
};

enum {
  twoToOne                      = 1,
  eightToThree                  = 2,
  threeToOne                    = 3,
  sixToOne                      = 4,
  sixToOnePacketSize            = 8,
  threeToOnePacketSize          = 16
};

enum {
  stateBlockSize                = 64,
  leftOverBlockSize             = 32
};

enum {
  firstSoundFormat              = 0x0001, /*general sound format*/
  secondSoundFormat             = 0x0002 /*special sampled sound format (HyperCard)*/
};

#if CALL_NOT_IN_CARBON
enum {
  dbBufferReady                 = 0x00000001, /*double buffer is filled*/
  dbLastBuffer                  = 0x00000004 /*last double buffer to play*/
};

#endif  /* CALL_NOT_IN_CARBON */

enum {
  sysBeepDisable                = 0x0000, /*SysBeep() enable flags*/
  sysBeepEnable                 = (1 << 0),
  sysBeepSynchronous            = (1 << 1) /*if bit set, make alert sounds synchronous*/
};

enum {
  unitTypeNoSelection           = 0xFFFF, /*unitTypes for AudioSelection.unitType*/
  unitTypeSeconds               = 0x0000
};

enum {
  stdSH                         = 0x00, /*Standard sound header encode value*/
  extSH                         = 0xFF, /*Extended sound header encode value*/
  cmpSH                         = 0xFE  /*Compressed sound header encode value*/
};

/*command numbers for SndDoCommand and SndDoImmediate*/
enum {
  nullCmd                       = 0,
  quietCmd                      = 3,
  flushCmd                      = 4,
  reInitCmd                     = 5,
  waitCmd                       = 10,
  pauseCmd                      = 11,
  resumeCmd                     = 12,
  callBackCmd                   = 13,
  syncCmd                       = 14,
  availableCmd                  = 24,
  versionCmd                    = 25,
  volumeCmd                     = 46,   /*sound manager 3.0 or later only*/
  getVolumeCmd                  = 47,   /*sound manager 3.0 or later only*/
  clockComponentCmd             = 50,   /*sound manager 3.2.1 or later only*/
  getClockComponentCmd          = 51,   /*sound manager 3.2.1 or later only*/
  scheduledSoundCmd             = 52,   /*sound manager 3.3 or later only*/
  linkSoundComponentsCmd        = 53,   /*sound manager 3.3 or later only*/
  soundCmd                      = 80,
  bufferCmd                     = 81,
  rateMultiplierCmd             = 86,
  getRateMultiplierCmd          = 87
};

#if CALL_NOT_IN_CARBON
/*command numbers for SndDoCommand and SndDoImmediate that are not available for use in Carbon */
enum {
  initCmd                       = 1,
  freeCmd                       = 2,
  totalLoadCmd                  = 26,
  loadCmd                       = 27,
  freqDurationCmd               = 40,
  restCmd                       = 41,
  freqCmd                       = 42,
  ampCmd                        = 43,
  timbreCmd                     = 44,
  getAmpCmd                     = 45,
  waveTableCmd                  = 60,
  phaseCmd                      = 61,
  rateCmd                       = 82,
  continueCmd                   = 83,
  doubleBufferCmd               = 84,
  getRateCmd                    = 85,
  sizeCmd                       = 90,   /*obsolete command*/
  convertCmd                    = 91    /*obsolete MACE command*/
};

#endif  /* CALL_NOT_IN_CARBON */

#if OLDROUTINENAMES
/*channel initialization parameters*/
enum {
  waveInitChannelMask           = 0x07,
  waveInitChannel0              = 0x04, /*wave table only, Sound Manager 2.0 and earlier*/
  waveInitChannel1              = 0x05, /*wave table only, Sound Manager 2.0 and earlier*/
  waveInitChannel2              = 0x06, /*wave table only, Sound Manager 2.0 and earlier*/
  waveInitChannel3              = 0x07, /*wave table only, Sound Manager 2.0 and earlier*/
  initChan0                     = waveInitChannel0, /*obsolete spelling*/
  initChan1                     = waveInitChannel1, /*obsolete spelling*/
  initChan2                     = waveInitChannel2, /*obsolete spelling*/
  initChan3                     = waveInitChannel3 /*obsolete spelling*/
};

enum {
  outsideCmpSH                  = 0,    /*obsolete MACE constant*/
  insideCmpSH                   = 1,    /*obsolete MACE constant*/
  aceSuccess                    = 0,    /*obsolete MACE constant*/
  aceMemFull                    = 1,    /*obsolete MACE constant*/
  aceNilBlock                   = 2,    /*obsolete MACE constant*/
  aceBadComp                    = 3,    /*obsolete MACE constant*/
  aceBadEncode                  = 4,    /*obsolete MACE constant*/
  aceBadDest                    = 5,    /*obsolete MACE constant*/
  aceBadCmd                     = 6     /*obsolete MACE constant*/
};

#endif  /* OLDROUTINENAMES */

enum {
  initChanLeft                  = 0x0002, /*left stereo channel*/
  initChanRight                 = 0x0003, /*right stereo channel*/
  initNoInterp                  = 0x0004, /*no linear interpolation*/
  initNoDrop                    = 0x0008, /*no drop-sample conversion*/
  initMono                      = 0x0080, /*monophonic channel*/
  initStereo                    = 0x00C0, /*stereo channel*/
  initMACE3                     = 0x0300, /*MACE 3:1*/
  initMACE6                     = 0x0400, /*MACE 6:1*/
  initPanMask                   = 0x0003, /*mask for right/left pan values*/
  initSRateMask                 = 0x0030, /*mask for sample rate values*/
  initStereoMask                = 0x00C0, /*mask for mono/stereo values*/
  initCompMask                  = 0xFF00 /*mask for compression IDs*/
};

/*Get&Set Sound Information Selectors*/
enum {
  siActiveChannels              = FOUR_CHAR_CODE('chac'), /*active channels*/
  siActiveLevels                = FOUR_CHAR_CODE('lmac'), /*active meter levels*/
  siAGCOnOff                    = FOUR_CHAR_CODE('agc '), /*automatic gain control state*/
  siAsync                       = FOUR_CHAR_CODE('asyn'), /*asynchronous capability*/
  siAVDisplayBehavior           = FOUR_CHAR_CODE('avdb'),
  siChannelAvailable            = FOUR_CHAR_CODE('chav'), /*number of channels available*/
  siCompressionAvailable        = FOUR_CHAR_CODE('cmav'), /*compression types available*/
  siCompressionFactor           = FOUR_CHAR_CODE('cmfa'), /*current compression factor*/
  siCompressionHeader           = FOUR_CHAR_CODE('cmhd'), /*return compression header*/
  siCompressionNames            = FOUR_CHAR_CODE('cnam'), /*compression type names available*/
  siCompressionParams           = FOUR_CHAR_CODE('evaw'), /*compression parameters*/
  siCompressionSampleRate       = FOUR_CHAR_CODE('cprt'), /* SetInfo only: compressor's sample rate*/
  siCompressionChannels         = FOUR_CHAR_CODE('cpct'), /* SetInfo only: compressor's number of channels*/
  siCompressionOutputSampleRate = FOUR_CHAR_CODE('cort'), /* GetInfo only: only implemented by compressors that have differing in and out rates */
  siCompressionInputRateList    = FOUR_CHAR_CODE('crtl'), /* GetInfo only: only implemented by compressors that only take certain input rates */
  siCompressionType             = FOUR_CHAR_CODE('comp'), /*current compression type*/
  siCompressionConfiguration    = FOUR_CHAR_CODE('ccfg'), /*compression extensions*/
  siContinuous                  = FOUR_CHAR_CODE('cont'), /*continous recording*/
  siDecompressionParams         = FOUR_CHAR_CODE('wave'), /*decompression parameters*/
  siDecompressionConfiguration  = FOUR_CHAR_CODE('dcfg'), /*decompression extensions*/
  siDeviceBufferInfo            = FOUR_CHAR_CODE('dbin'), /*size of interrupt buffer*/
  siDeviceConnected             = FOUR_CHAR_CODE('dcon'), /*input device connection status*/
  siDeviceIcon                  = FOUR_CHAR_CODE('icon'), /*input device icon*/
  siDeviceName                  = FOUR_CHAR_CODE('name'), /*input device name*/
  siEQSpectrumBands             = FOUR_CHAR_CODE('eqsb'), /* number of spectrum bands*/
  siEQSpectrumLevels            = FOUR_CHAR_CODE('eqlv'), /* gets spectum meter levels*/
  siEQSpectrumOnOff             = FOUR_CHAR_CODE('eqlo'), /* turn on/off spectum meter levels*/
  siEQSpectrumResolution        = FOUR_CHAR_CODE('eqrs'), /* set the resolution of the FFT, 0 = low res (<=16 bands), 1 = high res (16-64 bands)*/
  siEQToneControlGain           = FOUR_CHAR_CODE('eqtg'), /* set the bass and treble gain*/
  siEQToneControlOnOff          = FOUR_CHAR_CODE('eqtc'), /* turn on equalizer attenuation*/
  siHardwareBalance             = FOUR_CHAR_CODE('hbal'),
  siHardwareBalanceSteps        = FOUR_CHAR_CODE('hbls'),
  siHardwareBass                = FOUR_CHAR_CODE('hbas'),
  siHardwareBassSteps           = FOUR_CHAR_CODE('hbst'),
  siHardwareBusy                = FOUR_CHAR_CODE('hwbs'), /*sound hardware is in use*/
  siHardwareFormat              = FOUR_CHAR_CODE('hwfm'), /*get hardware format*/
  siHardwareMute                = FOUR_CHAR_CODE('hmut'), /*mute state of all hardware*/
  siHardwareMuteNoPrefs         = FOUR_CHAR_CODE('hmnp'), /*mute state of all hardware, but don't store in prefs */
  siHardwareTreble              = FOUR_CHAR_CODE('htrb'),
  siHardwareTrebleSteps         = FOUR_CHAR_CODE('hwts'),
  siHardwareVolume              = FOUR_CHAR_CODE('hvol'), /*volume level of all hardware*/
  siHardwareVolumeSteps         = FOUR_CHAR_CODE('hstp'), /*number of volume steps for hardware*/
  siHeadphoneMute               = FOUR_CHAR_CODE('pmut'), /*mute state of headphones*/
  siHeadphoneVolume             = FOUR_CHAR_CODE('pvol'), /*volume level of headphones*/
  siHeadphoneVolumeSteps        = FOUR_CHAR_CODE('hdst'), /*number of volume steps for headphones*/
  siInputAvailable              = FOUR_CHAR_CODE('inav'), /*input sources available*/
  siInputGain                   = FOUR_CHAR_CODE('gain'), /*input gain*/
  siInputSource                 = FOUR_CHAR_CODE('sour'), /*input source selector*/
  siInputSourceNames            = FOUR_CHAR_CODE('snam'), /*input source names*/
  siLevelMeterOnOff             = FOUR_CHAR_CODE('lmet'), /*level meter state*/
  siModemGain                   = FOUR_CHAR_CODE('mgai'), /*modem input gain*/
  siMonitorAvailable            = FOUR_CHAR_CODE('mnav'),
  siMonitorSource               = FOUR_CHAR_CODE('mons'),
  siNumberChannels              = FOUR_CHAR_CODE('chan'), /*current number of channels*/
  siOptionsDialog               = FOUR_CHAR_CODE('optd'), /*display options dialog*/
  siOSTypeInputSource           = FOUR_CHAR_CODE('inpt'), /*input source by OSType*/
  siOSTypeInputAvailable        = FOUR_CHAR_CODE('inav'), /*list of available input source OSTypes*/
  siOutputDeviceName            = FOUR_CHAR_CODE('onam'), /*output device name*/
  siPlayThruOnOff               = FOUR_CHAR_CODE('plth'), /*playthrough state*/
  siPostMixerSoundComponent     = FOUR_CHAR_CODE('psmx'), /*install post-mixer effect*/
  siPreMixerSoundComponent      = FOUR_CHAR_CODE('prmx'), /*install pre-mixer effect*/
  siQuality                     = FOUR_CHAR_CODE('qual'), /*quality setting*/
  siRateMultiplier              = FOUR_CHAR_CODE('rmul'), /*throttle rate setting*/
  siRecordingQuality            = FOUR_CHAR_CODE('qual'), /*recording quality*/
  siSampleRate                  = FOUR_CHAR_CODE('srat'), /*current sample rate*/
  siSampleRateAvailable         = FOUR_CHAR_CODE('srav'), /*sample rates available*/
  siSampleSize                  = FOUR_CHAR_CODE('ssiz'), /*current sample size*/
  siSampleSizeAvailable         = FOUR_CHAR_CODE('ssav'), /*sample sizes available*/
  siSetupCDAudio                = FOUR_CHAR_CODE('sucd'), /*setup sound hardware for CD audio*/
  siSetupModemAudio             = FOUR_CHAR_CODE('sumd'), /*setup sound hardware for modem audio*/
  siSlopeAndIntercept           = FOUR_CHAR_CODE('flap'), /*floating point variables for conversion*/
  siSoundClock                  = FOUR_CHAR_CODE('sclk'),
  siUseThisSoundClock           = FOUR_CHAR_CODE('sclc'), /*sdev uses this to tell the mixer to use his sound clock*/
  siSpeakerMute                 = FOUR_CHAR_CODE('smut'), /*mute state of all built-in speaker*/
  siSpeakerVolume               = FOUR_CHAR_CODE('svol'), /*volume level of built-in speaker*/
  siSSpCPULoadLimit             = FOUR_CHAR_CODE('3dll'),
  siSSpLocalization             = FOUR_CHAR_CODE('3dif'),
  siSSpSpeakerSetup             = FOUR_CHAR_CODE('3dst'),
  siStereoInputGain             = FOUR_CHAR_CODE('sgai'), /*stereo input gain*/
  siSubwooferMute               = FOUR_CHAR_CODE('bmut'), /*mute state of sub-woofer*/
  siTerminalType                = FOUR_CHAR_CODE('ttyp'), /* usb terminal type */
  siTwosComplementOnOff         = FOUR_CHAR_CODE('twos'), /*two's complement state*/
  siVendorProduct               = FOUR_CHAR_CODE('vpro'), /* vendor and product ID */
  siVolume                      = FOUR_CHAR_CODE('volu'), /*volume level of source*/
  siVoxRecordInfo               = FOUR_CHAR_CODE('voxr'), /*VOX record parameters*/
  siVoxStopInfo                 = FOUR_CHAR_CODE('voxs'), /*VOX stop parameters*/
  siWideStereo                  = FOUR_CHAR_CODE('wide'), /*wide stereo setting*/
  siSupportedExtendedFlags      = FOUR_CHAR_CODE('exfl'), /*which flags are supported in Extended sound data structures*/
  siRateConverterRollOffSlope   = FOUR_CHAR_CODE('rcdb'), /*the roll-off slope for the rate converter's filter, in whole dB as a long this value is a long whose range is from 20 (worst quality/fastest performance) to 90 (best quality/slowest performance)*/
  siOutputLatency               = FOUR_CHAR_CODE('olte'), /*latency of sound output component*/
  siHALAudioDeviceID            = FOUR_CHAR_CODE('hlid'), /*audio device id*/
  siHALAudioDeviceUniqueID      = FOUR_CHAR_CODE('huid'), /*audio device unique id*/
  siClientAcceptsVBR            = FOUR_CHAR_CODE('cvbr'), /*client handles VBR*/
  siSourceIsExhausted           = FOUR_CHAR_CODE('srcx'), /*the ultimate source of data has run out (keep asking, but when you get nothing, that's it)*/
  siMediaContextID              = FOUR_CHAR_CODE('uuid'), /*media context id -- UUID */
  siCompressionMaxPacketSize    = FOUR_CHAR_CODE('cmxp'), /*maximum compressed packet size for current configuration -- unsigned long */
  siAudioCodecPropertyValue     = FOUR_CHAR_CODE('spva'), /*audio codec property value -- SoundAudioCodecPropertyRequestParams* */
  siAudioCodecPropertyInfo      = FOUR_CHAR_CODE('spin') /*audio codec property info -- SoundAudioCodecPropertyRequestParams* */
};

enum {
  siCloseDriver                 = FOUR_CHAR_CODE('clos'), /*reserved for internal use only*/
  siInitializeDriver            = FOUR_CHAR_CODE('init'), /*reserved for internal use only*/
  siPauseRecording              = FOUR_CHAR_CODE('paus'), /*reserved for internal use only*/
  siUserInterruptProc           = FOUR_CHAR_CODE('user') /*reserved for internal use only*/
};

/* input source Types*/
enum {
  kInvalidSource                = (long)0xFFFFFFFF, /*this source may be returned from GetInfo if no other source is the monitored source*/
  kNoSource                     = FOUR_CHAR_CODE('none'), /*no source selection*/
  kCDSource                     = FOUR_CHAR_CODE('cd  '), /*internal CD player input*/
  kExtMicSource                 = FOUR_CHAR_CODE('emic'), /*external mic input*/
  kSoundInSource                = FOUR_CHAR_CODE('sinj'), /*sound input jack*/
  kRCAInSource                  = FOUR_CHAR_CODE('irca'), /*RCA jack input*/
  kTVFMTunerSource              = FOUR_CHAR_CODE('tvfm'),
  kDAVInSource                  = FOUR_CHAR_CODE('idav'), /*DAV analog input*/
  kIntMicSource                 = FOUR_CHAR_CODE('imic'), /*internal mic input*/
  kMediaBaySource               = FOUR_CHAR_CODE('mbay'), /*media bay input*/
  kModemSource                  = FOUR_CHAR_CODE('modm'), /*modem input (internal modem on desktops, PCI input on PowerBooks)*/
  kPCCardSource                 = FOUR_CHAR_CODE('pcm '), /*PC Card pwm input*/
  kZoomVideoSource              = FOUR_CHAR_CODE('zvpc'), /*zoom video input*/
  kDVDSource                    = FOUR_CHAR_CODE('dvda'), /* DVD audio input*/
  kMicrophoneArray              = FOUR_CHAR_CODE('mica') /* microphone array*/
};

/*Sound Component Types and Subtypes*/
enum {
  kNoSoundComponentType         = FOUR_CHAR_CODE('****'),
  kSoundComponentType           = FOUR_CHAR_CODE('sift'), /*component type*/
  kSoundComponentPPCType        = FOUR_CHAR_CODE('nift'), /*component type for PowerPC code*/
  kRate8SubType                 = FOUR_CHAR_CODE('ratb'), /*8-bit rate converter*/
  kRate16SubType                = FOUR_CHAR_CODE('ratw'), /*16-bit rate converter*/
  kConverterSubType             = FOUR_CHAR_CODE('conv'), /*sample format converter*/
  kSndSourceSubType             = FOUR_CHAR_CODE('sour'), /*generic source component*/
  kMixerType                    = FOUR_CHAR_CODE('mixr'),
  kMixer8SubType                = FOUR_CHAR_CODE('mixb'), /*8-bit mixer*/
  kMixer16SubType               = FOUR_CHAR_CODE('mixw'), /*16-bit mixer*/
  kSoundInputDeviceType         = FOUR_CHAR_CODE('sinp'), /*sound input component*/
  kWaveInSubType                = FOUR_CHAR_CODE('wavi'), /*Windows waveIn*/
  kWaveInSnifferSubType         = FOUR_CHAR_CODE('wisn'), /*Windows waveIn sniffer*/
  kSoundOutputDeviceType        = FOUR_CHAR_CODE('sdev'), /*sound output component*/
  kClassicSubType               = FOUR_CHAR_CODE('clas'), /*classic hardware, i.e. Mac Plus*/
  kASCSubType                   = FOUR_CHAR_CODE('asc '), /*Apple Sound Chip device*/
  kDSPSubType                   = FOUR_CHAR_CODE('dsp '), /*DSP device*/
  kAwacsSubType                 = FOUR_CHAR_CODE('awac'), /*Another of Will's Audio Chips device*/
  kGCAwacsSubType               = FOUR_CHAR_CODE('awgc'), /*Awacs audio with Grand Central DMA*/
  kSingerSubType                = FOUR_CHAR_CODE('sing'), /*Singer (via Whitney) based sound*/
  kSinger2SubType               = FOUR_CHAR_CODE('sng2'), /*Singer 2 (via Whitney) for Acme*/
  kWhitSubType                  = FOUR_CHAR_CODE('whit'), /*Whit sound component for PrimeTime 3*/
  kSoundBlasterSubType          = FOUR_CHAR_CODE('sbls'), /*Sound Blaster for CHRP*/
  kWaveOutSubType               = FOUR_CHAR_CODE('wavo'), /*Windows waveOut*/
  kWaveOutSnifferSubType        = FOUR_CHAR_CODE('wosn'), /*Windows waveOut sniffer*/
  kDirectSoundSubType           = FOUR_CHAR_CODE('dsnd'), /*Windows DirectSound*/
  kDirectSoundSnifferSubType    = FOUR_CHAR_CODE('dssn'), /*Windows DirectSound sniffer*/
  kUNIXsdevSubType              = FOUR_CHAR_CODE('un1x'), /*UNIX base sdev*/
  kUSBSubType                   = FOUR_CHAR_CODE('usb '), /*USB device*/
  kBlueBoxSubType               = FOUR_CHAR_CODE('bsnd'), /*Blue Box sound component*/
  kHALCustomComponentSubType    = FOUR_CHAR_CODE('halx'), /*Registered by the HAL output component ('hal!') for each HAL output device*/
  kSoundCompressor              = FOUR_CHAR_CODE('scom'),
  kSoundDecompressor            = FOUR_CHAR_CODE('sdec'),
  kAudioComponentType           = FOUR_CHAR_CODE('adio'), /*Audio components and sub-types*/
  kAwacsPhoneSubType            = FOUR_CHAR_CODE('hphn'),
  kAudioVisionSpeakerSubType    = FOUR_CHAR_CODE('telc'),
  kAudioVisionHeadphoneSubType  = FOUR_CHAR_CODE('telh'),
  kPhilipsFaderSubType          = FOUR_CHAR_CODE('tvav'),
  kSGSToneSubType               = FOUR_CHAR_CODE('sgs0'),
  kSoundEffectsType             = FOUR_CHAR_CODE('snfx'), /*sound effects type*/
  kEqualizerSubType             = FOUR_CHAR_CODE('eqal'), /*frequency equalizer*/
  kSSpLocalizationSubType       = FOUR_CHAR_CODE('snd3')
};

/*Format Types*/
enum {
  kSoundNotCompressed           = FOUR_CHAR_CODE('NONE'), /*sound is not compressed*/
  k8BitOffsetBinaryFormat       = FOUR_CHAR_CODE('raw '), /*8-bit offset binary*/
  k16BitBigEndianFormat         = FOUR_CHAR_CODE('twos'), /*16-bit big endian*/
  k16BitLittleEndianFormat      = FOUR_CHAR_CODE('sowt'), /*16-bit little endian*/
  kFloat32Format                = FOUR_CHAR_CODE('fl32'), /*32-bit floating point*/
  kFloat64Format                = FOUR_CHAR_CODE('fl64'), /*64-bit floating point*/
  k24BitFormat                  = FOUR_CHAR_CODE('in24'), /*24-bit integer*/
  k32BitFormat                  = FOUR_CHAR_CODE('in32'), /*32-bit integer*/
  k32BitLittleEndianFormat      = FOUR_CHAR_CODE('23ni'), /*32-bit little endian integer */
  kMACE3Compression             = FOUR_CHAR_CODE('MAC3'), /*MACE 3:1*/
  kMACE6Compression             = FOUR_CHAR_CODE('MAC6'), /*MACE 6:1*/
  kCDXA4Compression             = FOUR_CHAR_CODE('cdx4'), /*CD/XA 4:1*/
  kCDXA2Compression             = FOUR_CHAR_CODE('cdx2'), /*CD/XA 2:1*/
  kIMACompression               = FOUR_CHAR_CODE('ima4'), /*IMA 4:1*/
  kULawCompression              = FOUR_CHAR_CODE('ulaw'), /*.Law 2:1*/
  kALawCompression              = FOUR_CHAR_CODE('alaw'), /*aLaw 2:1*/
  kMicrosoftADPCMFormat         = 0x6D730002, /*Microsoft ADPCM - ACM code 2*/
  kDVIIntelIMAFormat            = 0x6D730011, /*DVI/Intel IMA ADPCM - ACM code 17*/
  kMicrosoftGSMCompression      = 0x6D730031, /*Microsoft GSM 6.10 - ACM code 49*/
  kDVAudioFormat                = FOUR_CHAR_CODE('dvca'), /*DV Audio*/
  kQDesignCompression           = FOUR_CHAR_CODE('QDMC'), /*QDesign music*/
  kQDesign2Compression          = FOUR_CHAR_CODE('QDM2'), /*QDesign2 music*/
  kQUALCOMMCompression          = FOUR_CHAR_CODE('Qclp'), /*QUALCOMM PureVoice*/
  kOffsetBinary                 = k8BitOffsetBinaryFormat, /*for compatibility*/
  kTwosComplement               = k16BitBigEndianFormat, /*for compatibility*/
  kLittleEndianFormat           = k16BitLittleEndianFormat, /*for compatibility*/
  kMPEGLayer3Format             = 0x6D730055, /*MPEG Layer 3, CBR only (pre QT4.1)*/
  kFullMPEGLay3Format           = FOUR_CHAR_CODE('.mp3'), /*MPEG Layer 3, CBR & VBR (QT4.1 and later)*/
  kVariableDurationDVAudioFormat = FOUR_CHAR_CODE('vdva') /*Variable Duration DV Audio*/
};

#if TARGET_RT_LITTLE_ENDIAN
enum {
  k16BitNativeEndianFormat      = k16BitLittleEndianFormat,
  k16BitNonNativeEndianFormat   = k16BitBigEndianFormat
};

#else
enum {
  k16BitNativeEndianFormat      = k16BitBigEndianFormat,
  k16BitNonNativeEndianFormat   = k16BitLittleEndianFormat
};

#endif  /* TARGET_RT_LITTLE_ENDIAN */

/*Features Flags*/
enum {
  k8BitRawIn                    = (1 << 0), /*data description*/
  k8BitTwosIn                   = (1 << 1),
  k16BitIn                      = (1 << 2),
  kStereoIn                     = (1 << 3),
  k8BitRawOut                   = (1 << 8),
  k8BitTwosOut                  = (1 << 9),
  k16BitOut                     = (1 << 10),
  kStereoOut                    = (1 << 11),
  kReverse                      = (1L << 16), /*  function description*/
  kRateConvert                  = (1L << 17),
  kCreateSoundSource            = (1L << 18),
  kVMAwareness                  = (1L << 21), /* component will hold its memory*/
  kHighQuality                  = (1L << 22), /*  performance description*/
  kNonRealTime                  = (1L << 23)
};

/*'snfo' Resource Feature Flags*/
enum {
  kSoundCodecInfoFixedCompression = (1L << 0), /* has fixed compression format*/
  kSoundCodecInfoVariableCompression = (1L << 1), /* has variable compression format*/
  kSoundCodecInfoHasRestrictedInputRates = (1L << 2), /* compressor has restricted set of input sample rates*/
  kSoundCodecInfoCanChangeOutputRate = (1L << 3), /* compressor may output a different sample rate than it receives*/
  kSoundCodecInfoRequiresExternalFraming = (1L << 4), /* format requires external framing information during decode/encode*/
  kSoundCodecInfoVariableDuration = (1L << 5) /* audio packets can vary in duration*/
};

/*SoundComponentPlaySourceBuffer action flags*/
enum {
  kSourcePaused                 = (1 << 0),
  kPassThrough                  = (1L << 16),
  kNoSoundComponentChain        = (1L << 17)
};

/*SoundParamBlock flags, usefull for OpenMixerSoundComponent*/
enum {
  kNoMixing                     = (1 << 0), /*don't mix source*/
  kNoSampleRateConversion       = (1 << 1), /*don't convert sample rate (i.e. 11 kHz -> 22 kHz)*/
  kNoSampleSizeConversion       = (1 << 2), /*don't convert sample size (i.e. 16 -> 8)*/
  kNoSampleFormatConversion     = (1 << 3), /*don't convert sample format (i.e. 'twos' -> 'raw ')*/
  kNoChannelConversion          = (1 << 4), /*don't convert stereo/mono*/
  kNoDecompression              = (1 << 5), /*don't decompress (i.e. 'MAC3' -> 'raw ')*/
  kNoVolumeConversion           = (1 << 6), /*don't apply volume*/
  kNoRealtimeProcessing         = (1 << 7), /*won't run at interrupt time*/
  kScheduledSource              = (1 << 8), /*source is scheduled*/
  kNonInterleavedBuffer         = (1 << 9), /*buffer is not interleaved samples*/
  kNonPagingMixer               = (1 << 10), /*if VM is on, use the non-paging mixer*/
  kSoundConverterMixer          = (1 << 11), /*the mixer is to be used by the SoundConverter*/
  kPagingMixer                  = (1 << 12), /*the mixer is to be used as a paging mixer when VM is on*/
  kVMAwareMixer                 = (1 << 13), /*passed to the output device when the SM is going to deal with VM safety*/
  kExtendedSoundData            = (1 << 14) /*SoundComponentData record is actually an ExtendedSoundComponentData*/
};

/*SoundParamBlock quality settings*/
enum {
  kBestQuality                  = (1 << 0) /*use interpolation in rate conversion*/
};

/*useful bit masks*/
enum {
  kInputMask                    = 0x000000FF, /*masks off input bits*/
  kOutputMask                   = 0x0000FF00, /*masks off output bits*/
  kOutputShift                  = 8,    /*amount output bits are shifted*/
  kActionMask                   = 0x00FF0000, /*masks off action bits*/
  kSoundComponentBits           = 0x00FFFFFF
};

/*audio atom types*/
enum {
  kAudioFormatAtomType          = FOUR_CHAR_CODE('frma'),
  kAudioEndianAtomType          = FOUR_CHAR_CODE('enda'),
  kAudioVBRAtomType             = FOUR_CHAR_CODE('vbra'),
  kAudioTerminatorAtomType      = 0
};

/*siAVDisplayBehavior types*/
enum {
  kAVDisplayHeadphoneRemove     = 0,    /* monitor does not have a headphone attached*/
  kAVDisplayHeadphoneInsert     = 1,    /* monitor has a headphone attached*/
  kAVDisplayPlainTalkRemove     = 2,    /* monitor either sending no input through CPU input port or unable to tell if input is coming in*/
  kAVDisplayPlainTalkInsert     = 3     /* monitor sending PlainTalk level microphone source input through sound input port*/
};

/*Audio Component constants*/
enum {
                                        /*Values for whichChannel parameter*/
  audioAllChannels              = 0,    /*All channels (usually interpreted as both left and right)*/
  audioLeftChannel              = 1,    /*Left channel*/
  audioRightChannel             = 2,    /*Right channel*/
                                        /*Values for mute parameter*/
  audioUnmuted                  = 0,    /*Device is unmuted*/
  audioMuted                    = 1,    /*Device is muted*/
                                        /*Capabilities flags definitions*/
  audioDoesMono                 = (1L << 0), /*Device supports mono output*/
  audioDoesStereo               = (1L << 1), /*Device supports stereo output*/
  audioDoesIndependentChannels  = (1L << 2) /*Device supports independent software control of each channel*/
};

/*Sound Input Qualities*/
enum {
  siCDQuality                   = FOUR_CHAR_CODE('cd  '), /*44.1kHz, stereo, 16 bit*/
  siBestQuality                 = FOUR_CHAR_CODE('best'), /*22kHz, mono, 8 bit*/
  siBetterQuality               = FOUR_CHAR_CODE('betr'), /*22kHz, mono, MACE 3:1*/
  siGoodQuality                 = FOUR_CHAR_CODE('good'), /*22kHz, mono, MACE 6:1*/
  siNoneQuality                 = FOUR_CHAR_CODE('none') /*settings don't match any quality for a get call*/
};

enum {
  siDeviceIsConnected           = 1,    /*input device is connected and ready for input*/
  siDeviceNotConnected          = 0,    /*input device is not connected*/
  siDontKnowIfConnected         = -1,   /*can't tell if input device is connected*/
  siReadPermission              = 0,    /*permission passed to SPBOpenDevice*/
  siWritePermission             = 1     /*permission passed to SPBOpenDevice*/
};

/*flags that SoundConverterFillBuffer will return*/
enum {
  kSoundConverterDidntFillBuffer = (1 << 0), /*set if the converter couldn't completely satisfy a SoundConverterFillBuffer request*/
  kSoundConverterHasLeftOverData = (1 << 1) /*set if the converter had left over data after completely satisfying a SoundConverterFillBuffer call*/
};

/* flags for extendedFlags fields of ExtendedSoundComponentData, ExtendedSoundParamBlock, and ExtendedScheduledSoundHeader*/
enum {
  kExtendedSoundSampleCountNotValid = 1L << 0, /* set if sampleCount of SoundComponentData isn't meaningful; use buffer size instead*/
  kExtendedSoundBufferSizeValid = 1L << 1, /* set if bufferSize field is valid*/
  kExtendedSoundFrameSizesValid = 1L << 2, /* set if frameSizesArray is valid (will be nil if all sizes are common and kExtendedSoundCommonFrameSizeValid is set*/
  kExtendedSoundCommonFrameSizeValid = 1L << 3, /* set if all audio frames have the same size and the commonFrameSize field is valid*/
  kExtendedSoundExtensionsValid = 1L << 4, /* set if pointer to extensions array is valid*/
  kExtendedSoundBufferFlagsValid = 1L << 5 /* set if buffer flags field is valid*/
};

/* flags passed in bufferFlags/bufferFlagsMask extended fields if kExtendedSoundBufferFlagsValid extended flag is set*/
enum {
  kExtendedSoundBufferIsDiscontinuous = 1L << 0, /* buffer is discontinuous with previous buffer*/
  kExtendedSoundBufferIsFirstBuffer = 1L << 1 /* buffer is first buffer*/
};

/*
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   typedefs
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

struct SndCommand {
  unsigned short      cmd;
  short               param1;
  long                param2;
};
typedef struct SndCommand               SndCommand;
typedef struct SndChannel               SndChannel;

typedef SndChannel *                    SndChannelPtr;
typedef CALLBACK_API( void , SndCallBackProcPtr )(SndChannelPtr chan, SndCommand *cmd);
typedef STACK_UPP_TYPE(SndCallBackProcPtr)                      SndCallBackUPP;
struct SndChannel {
  SndChannelPtr       nextChan;
  Ptr                 firstMod;               /* reserved for the Sound Manager */
  SndCallBackUPP      callBack;
  long                userInfo;
  long                wait;                   /* The following is for internal Sound Manager use only.*/
  SndCommand          cmdInProgress;
  short               flags;
  short               qLength;
  short               qHead;
  short               qTail;
  SndCommand          queue[128];
};

/*
 *  NewSndCallBackUPP()
 *  
 *  Availability:
 *    Non-Carbon CFM:   available as macro/inline
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( SndCallBackUPP )
NewSndCallBackUPP(SndCallBackProcPtr userRoutine);
#if !OPAQUE_UPP_TYPES
  enum { uppSndCallBackProcInfo = 0x000003C0 };  /* pascal no_return_value Func(4_bytes, 4_bytes) */
  #ifdef __cplusplus
    inline DEFINE_API_C(SndCallBackUPP) NewSndCallBackUPP(SndCallBackProcPtr userRoutine) { return (SndCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSndCallBackProcInfo, GetCurrentArchitecture()); }
  #else
    #define NewSndCallBackUPP(userRoutine) (SndCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSndCallBackProcInfo, GetCurrentArchitecture())
  #endif
#endif

/*
 *  DisposeSndCallBackUPP()
 *  
 *  Availability:
 *    Non-Carbon CFM:   available as macro/inline
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( void )
DisposeSndCallBackUPP(SndCallBackUPP userUPP);
#if !OPAQUE_UPP_TYPES
  #ifdef __cplusplus
      inline DEFINE_API_C(void) DisposeSndCallBackUPP(SndCallBackUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  #else
      #define DisposeSndCallBackUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  #endif
#endif

/*
 *  InvokeSndCallBackUPP()
 *  
 *  Availability:
 *    Non-Carbon CFM:   available as macro/inline
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( void )
InvokeSndCallBackUPP(
  SndChannelPtr   chan,
  SndCommand *    cmd,
  SndCallBackUPP  userUPP);
#if !OPAQUE_UPP_TYPES
  #ifdef __cplusplus
      inline DEFINE_API_C(void) InvokeSndCallBackUPP(SndChannelPtr chan, SndCommand * cmd, SndCallBackUPP userUPP) { CALL_TWO_PARAMETER_UPP(userUPP, uppSndCallBackProcInfo, chan, cmd); }
  #else
    #define InvokeSndCallBackUPP(chan, cmd, userUPP) CALL_TWO_PARAMETER_UPP((userUPP), uppSndCallBackProcInfo, (chan), (cmd))
  #endif
#endif

#if CALL_NOT_IN_CARBON || OLDROUTINENAMES
    /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
    #define NewSndCallBackProc(userRoutine)                     NewSndCallBackUPP(userRoutine)
    #define CallSndCallBackProc(userRoutine, chan, cmd)         InvokeSndCallBackUPP(chan, cmd, userRoutine)
#endif /* CALL_NOT_IN_CARBON */

/*MACE structures*/
struct StateBlock {
  short               stateVar[64];
};
typedef struct StateBlock               StateBlock;
typedef StateBlock *                    StateBlockPtr;
struct LeftOverBlock {
  unsigned long       count;
  SInt8               sampleArea[32];
};
typedef struct LeftOverBlock            LeftOverBlock;
typedef LeftOverBlock *                 LeftOverBlockPtr;
struct ModRef {
  unsigned short      modNumber;
  long                modInit;
};
typedef struct ModRef                   ModRef;
struct SndListResource {
  short               format;
  short               numModifiers;
  ModRef              modifierPart[1];
  short               numCommands;
  SndCommand          commandPart[1];
  UInt8               dataPart[1];
};
typedef struct SndListResource          SndListResource;
typedef SndListResource *               SndListPtr;
typedef SndListPtr *                    SndListHandle;
typedef SndListHandle                   SndListHndl;
/*HyperCard sound resource format*/
struct Snd2ListResource {
  short               format;
  short               refCount;
  short               numCommands;
  SndCommand          commandPart[1];
  UInt8               dataPart[1];
};
typedef struct Snd2ListResource         Snd2ListResource;
typedef Snd2ListResource *              Snd2ListPtr;
typedef Snd2ListPtr *                   Snd2ListHandle;
typedef Snd2ListHandle                  Snd2ListHndl;
struct SoundHeader {
  Ptr                 samplePtr;              /*if NIL then samples are in sampleArea*/
  unsigned long       length;                 /*length of sound in bytes*/
  UnsignedFixed       sampleRate;             /*sample rate for this sound*/
  unsigned long       loopStart;              /*start of looping portion*/
  unsigned long       loopEnd;                /*end of looping portion*/
  UInt8               encode;                 /*header encoding*/
  UInt8               baseFrequency;          /*baseFrequency value*/
  UInt8               sampleArea[1];          /*space for when samples follow directly*/
};
typedef struct SoundHeader              SoundHeader;
typedef SoundHeader *                   SoundHeaderPtr;
struct CmpSoundHeader {
  Ptr                 samplePtr;              /*if nil then samples are in sample area*/
  unsigned long       numChannels;            /*number of channels i.e. mono = 1*/
  UnsignedFixed       sampleRate;             /*sample rate in Apples Fixed point representation*/
  unsigned long       loopStart;              /*loopStart of sound before compression*/
  unsigned long       loopEnd;                /*loopEnd of sound before compression*/
  UInt8               encode;                 /*data structure used , stdSH, extSH, or cmpSH*/
  UInt8               baseFrequency;          /*same meaning as regular SoundHeader*/
  unsigned long       numFrames;              /*length in frames ( packetFrames or sampleFrames )*/
  extended80          AIFFSampleRate;         /*IEEE sample rate*/
  Ptr                 markerChunk;            /*sync track*/
  OSType              format;                 /*data format type, was futureUse1*/
  unsigned long       futureUse2;             /*reserved by Apple*/
  StateBlockPtr       stateVars;              /*pointer to State Block*/
  LeftOverBlockPtr    leftOverSamples;        /*used to save truncated samples between compression calls*/
  short               compressionID;          /*0 means no compression, non zero means compressionID*/
  unsigned short      packetSize;             /*number of bits in compressed sample packet*/
  unsigned short      snthID;                 /*resource ID of Sound Manager snth that contains NRT C/E*/
  unsigned short      sampleSize;             /*number of bits in non-compressed sample*/
  UInt8               sampleArea[1];          /*space for when samples follow directly*/
};
typedef struct CmpSoundHeader           CmpSoundHeader;
typedef CmpSoundHeader *                CmpSoundHeaderPtr;
struct ExtSoundHeader {
  Ptr                 samplePtr;              /*if nil then samples are in sample area*/
  unsigned long       numChannels;            /*number of channels,  ie mono = 1*/
  UnsignedFixed       sampleRate;             /*sample rate in Apples Fixed point representation*/
  unsigned long       loopStart;              /*same meaning as regular SoundHeader*/
  unsigned long       loopEnd;                /*same meaning as regular SoundHeader*/
  UInt8               encode;                 /*data structure used , stdSH, extSH, or cmpSH*/
  UInt8               baseFrequency;          /*same meaning as regular SoundHeader*/
  unsigned long       numFrames;              /*length in total number of frames*/
  extended80          AIFFSampleRate;         /*IEEE sample rate*/
  Ptr                 markerChunk;            /*sync track*/
  Ptr                 instrumentChunks;       /*AIFF instrument chunks*/
  Ptr                 AESRecording;
  unsigned short      sampleSize;             /*number of bits in sample*/
  unsigned short      futureUse1;             /*reserved by Apple*/
  unsigned long       futureUse2;             /*reserved by Apple*/
  unsigned long       futureUse3;             /*reserved by Apple*/
  unsigned long       futureUse4;             /*reserved by Apple*/
  UInt8               sampleArea[1];          /*space for when samples follow directly*/
};
typedef struct ExtSoundHeader           ExtSoundHeader;
typedef ExtSoundHeader *                ExtSoundHeaderPtr;
union SoundHeaderUnion {
  SoundHeader         stdHeader;
  CmpSoundHeader      cmpHeader;
  ExtSoundHeader      extHeader;
};
typedef union SoundHeaderUnion          SoundHeaderUnion;
struct ConversionBlock {
  short               destination;
  short               unused;
  CmpSoundHeaderPtr   inputPtr;
  CmpSoundHeaderPtr   outputPtr;
};
typedef struct ConversionBlock          ConversionBlock;
typedef ConversionBlock *               ConversionBlockPtr;
/* ScheduledSoundHeader flags*/
enum {
  kScheduledSoundDoScheduled    = 1 << 0,
  kScheduledSoundDoCallBack     = 1 << 1,
  kScheduledSoundExtendedHdr    = 1 << 2
};

struct ScheduledSoundHeader {
  SoundHeaderUnion    u;
  long                flags;
  short               reserved;
  short               callBackParam1;
  long                callBackParam2;
  TimeRecord          startTime;
};
typedef struct ScheduledSoundHeader     ScheduledSoundHeader;
typedef ScheduledSoundHeader *          ScheduledSoundHeaderPtr;
struct ExtendedScheduledSoundHeader {
  SoundHeaderUnion    u;
  long                flags;
  short               reserved;
  short               callBackParam1;
  long                callBackParam2;
  TimeRecord          startTime;
  long                recordSize;
  long                extendedFlags;
  long                bufferSize;
  long                frameCount;             /* number of audio frames*/
  long *              frameSizesArray;        /* pointer to array of longs with frame sizes in bytes*/
  long                commonFrameSize;        /* size of each frame if common*/
  void *              extensionsPtr;          /*pointer to set of classic atoms (size,type,data,...)*/
  long                extensionsSize;         /*size of extensions data (extensionsPtr)*/
  unsigned long       bufferFlags;            /*set or cleared flags*/
  unsigned long       bufferFlagsMask;        /*which flags are valid*/
};
typedef struct ExtendedScheduledSoundHeader ExtendedScheduledSoundHeader;
typedef ExtendedScheduledSoundHeader *  ExtendedScheduledSoundHeaderPtr;
struct SMStatus {
  short               smMaxCPULoad;
  short               smNumChannels;
  short               smCurCPULoad;
};
typedef struct SMStatus                 SMStatus;
typedef SMStatus *                      SMStatusPtr;
struct SCStatus {
  UnsignedFixed       scStartTime;
  UnsignedFixed       scEndTime;
  UnsignedFixed       scCurrentTime;
  Boolean             scChannelBusy;
  Boolean             scChannelDisposed;
  Boolean             scChannelPaused;
  Boolean             scUnused;
  unsigned long       scChannelAttributes;
  long                scCPULoad;
};
typedef struct SCStatus                 SCStatus;
typedef SCStatus *                      SCStatusPtr;
struct AudioSelection {
  long                unitType;
  UnsignedFixed       selStart;
  UnsignedFixed       selEnd;
};
typedef struct AudioSelection           AudioSelection;
typedef AudioSelection *                AudioSelectionPtr;
#if CALL_NOT_IN_CARBON
struct SndDoubleBuffer {
  long                dbNumFrames;
  long                dbFlags;
  long                dbUserInfo[2];
  SInt8               dbSoundData[1];
};
typedef struct SndDoubleBuffer          SndDoubleBuffer;
typedef SndDoubleBuffer *               SndDoubleBufferPtr;


typedef CALLBACK_API( void , SndDoubleBackProcPtr )(SndChannelPtr channel, SndDoubleBufferPtr doubleBufferPtr);
typedef STACK_UPP_TYPE(SndDoubleBackProcPtr)                    SndDoubleBackUPP;
#if CALL_NOT_IN_CARBON
/*
 *  NewSndDoubleBackUPP()
 *  
 *  Availability:
 *    Non-Carbon CFM:   available as macro/inline
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API_C( SndDoubleBackUPP )
NewSndDoubleBackUPP(SndDoubleBackProcPtr userRoutine);
#if !OPAQUE_UPP_TYPES
  enum { uppSndDoubleBackProcInfo = 0x000003C0 };  /* pascal no_return_value Func(4_bytes, 4_bytes) */
  #ifdef __cplusplus
    inline DEFINE_API_C(SndDoubleBackUPP) NewSndDoubleBackUPP(SndDoubleBackProcPtr userRoutine) { return (SndDoubleBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSndDoubleBackProcInfo, GetCurrentArchitecture()); }
  #else
    #define NewSndDoubleBackUPP(userRoutine) (SndDoubleBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSndDoubleBackProcInfo, GetCurrentArchitecture())
  #endif
#endif

/*
 *  DisposeSndDoubleBackUPP()
 *  
 *  Availability:
 *    Non-Carbon CFM:   available as macro/inline
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API_C( void )
DisposeSndDoubleBackUPP(SndDoubleBackUPP userUPP);
#if !OPAQUE_UPP_TYPES
  #ifdef __cplusplus
      inline DEFINE_API_C(void) DisposeSndDoubleBackUPP(SndDoubleBackUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  #else
      #define DisposeSndDoubleBackUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  #endif
#endif

/*
 *  InvokeSndDoubleBackUPP()
 *  
 *  Availability:
 *    Non-Carbon CFM:   available as macro/inline
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API_C( void )
InvokeSndDoubleBackUPP(
  SndChannelPtr       channel,
  SndDoubleBufferPtr  doubleBufferPtr,
  SndDoubleBackUPP    userUPP);
#if !OPAQUE_UPP_TYPES
  #ifdef __cplusplus
      inline DEFINE_API_C(void) InvokeSndDoubleBackUPP(SndChannelPtr channel, SndDoubleBufferPtr doubleBufferPtr, SndDoubleBackUPP userUPP) { CALL_TWO_PARAMETER_UPP(userUPP, uppSndDoubleBackProcInfo, channel, doubleBufferPtr); }
  #else
    #define InvokeSndDoubleBackUPP(channel, doubleBufferPtr, userUPP) CALL_TWO_PARAMETER_UPP((userUPP), uppSndDoubleBackProcInfo, (channel), (doubleBufferPtr))
  #endif
#endif

#endif  /* CALL_NOT_IN_CARBON */

#if CALL_NOT_IN_CARBON || OLDROUTINENAMES
    /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
    #define NewSndDoubleBackProc(userRoutine)                   NewSndDoubleBackUPP(userRoutine)
    #define CallSndDoubleBackProc(userRoutine, channel, doubleBufferPtr) InvokeSndDoubleBackUPP(channel, doubleBufferPtr, userRoutine)
#endif /* CALL_NOT_IN_CARBON */

struct SndDoubleBufferHeader {
  short               dbhNumChannels;
  short               dbhSampleSize;
  short               dbhCompressionID;
  short               dbhPacketSize;
  UnsignedFixed       dbhSampleRate;
  SndDoubleBufferPtr  dbhBufferPtr[2];
  SndDoubleBackUPP    dbhDoubleBack;
};
typedef struct SndDoubleBufferHeader    SndDoubleBufferHeader;
typedef SndDoubleBufferHeader *         SndDoubleBufferHeaderPtr;
struct SndDoubleBufferHeader2 {
  short               dbhNumChannels;
  short               dbhSampleSize;
  short               dbhCompressionID;
  short               dbhPacketSize;
  UnsignedFixed       dbhSampleRate;
  SndDoubleBufferPtr  dbhBufferPtr[2];
  SndDoubleBackUPP    dbhDoubleBack;
  OSType              dbhFormat;
};
typedef struct SndDoubleBufferHeader2   SndDoubleBufferHeader2;
typedef SndDoubleBufferHeader2 *        SndDoubleBufferHeader2Ptr;
#endif  /* CALL_NOT_IN_CARBON */

struct SoundInfoList {
  short               count;
  Handle              infoHandle;
};
typedef struct SoundInfoList            SoundInfoList;
typedef SoundInfoList *                 SoundInfoListPtr;
struct SoundComponentData {
  long                flags;
  OSType              format;
  short               numChannels;
  short               sampleSize;
  UnsignedFixed       sampleRate;
  long                sampleCount;
  Byte *              buffer;
  long                reserved;
};
typedef struct SoundComponentData       SoundComponentData;
typedef SoundComponentData *            SoundComponentDataPtr;
struct ExtendedSoundComponentData {
  SoundComponentData  desc;                   /*description of sound buffer*/
  long                recordSize;             /*size of this record in bytes*/
  long                extendedFlags;          /*flags for extended record*/
  long                bufferSize;             /*size of buffer in bytes*/
  long                frameCount;             /*number of audio frames*/
  long *              frameSizesArray;        /*pointer to array of longs with frame sizes in bytes*/
  long                commonFrameSize;        /*size of each frame if common*/
  void *              extensionsPtr;          /*pointer to set of classic atoms (size,type,data,...)*/
  long                extensionsSize;         /*size of extensions data (extensionsPtr)*/
  unsigned long       bufferFlags;            /*set or cleared flags*/
  unsigned long       bufferFlagsMask;        /*which flags are valid*/
};
typedef struct ExtendedSoundComponentData ExtendedSoundComponentData;
typedef ExtendedSoundComponentData *    ExtendedSoundComponentDataPtr;
typedef struct SoundParamBlock          SoundParamBlock;
typedef SoundParamBlock *               SoundParamBlockPtr;
typedef CALLBACK_API( Boolean , SoundParamProcPtr )(SoundParamBlockPtr * pb);
typedef STACK_UPP_TYPE(SoundParamProcPtr)                       SoundParamUPP;
struct SoundParamBlock {
  long                recordSize;             /*size of this record in bytes*/
  SoundComponentData  desc;                   /*description of sound buffer*/
  UnsignedFixed       rateMultiplier;         /*rate multiplier to apply to sound*/
  short               leftVolume;             /*volumes to apply to sound*/
  short               rightVolume;
  long                quality;                /*quality to apply to sound*/
  ComponentInstance   filter;                 /*filter to apply to sound*/
  SoundParamUPP       moreRtn;                /*routine to call to get more data*/
  SoundParamUPP       completionRtn;          /*routine to call when buffer is complete*/
  long                refCon;                 /*user refcon*/
  short               result;                 /*result*/
};

struct ExtendedSoundParamBlock {
  SoundParamBlock     pb;                     /*classic SoundParamBlock except recordSize == sizeof(ExtendedSoundParamBlock)*/
  short               reserved;
  long                extendedFlags;          /*flags*/
  long                bufferSize;             /*size of buffer in bytes*/
  long                frameCount;             /*number of audio frames*/
  long *              frameSizesArray;        /*pointer to array of longs with frame sizes in bytes*/
  long                commonFrameSize;        /*size of each frame if common*/
  void *              extensionsPtr;          /*pointer to set of classic atoms (size,type,data,...)*/
  long                extensionsSize;         /*size of extensions data (extensionsPtr)*/
  unsigned long       bufferFlags;            /*set or cleared flags*/
  unsigned long       bufferFlagsMask;        /*which flags are valid*/
};
typedef struct ExtendedSoundParamBlock  ExtendedSoundParamBlock;
typedef ExtendedSoundParamBlock *       ExtendedSoundParamBlockPtr;
struct CompressionInfo {
  long                recordSize;
  OSType              format;
  short               compressionID;
  unsigned short      samplesPerPacket;
  unsigned short      bytesPerPacket;
  unsigned short      bytesPerFrame;
  unsigned short      bytesPerSample;
  unsigned short      futureUse1;
};
typedef struct CompressionInfo          CompressionInfo;
typedef CompressionInfo *               CompressionInfoPtr;
typedef CompressionInfoPtr *            CompressionInfoHandle;
/*variables for floating point conversion*/
struct SoundSlopeAndInterceptRecord {
  Float64             slope;
  Float64             intercept;
  Float64             minClip;
  Float64             maxClip;
};
typedef struct SoundSlopeAndInterceptRecord SoundSlopeAndInterceptRecord;
typedef SoundSlopeAndInterceptRecord *  SoundSlopeAndInterceptPtr;
/*private thing to use as a reference to a Sound Converter*/
typedef struct OpaqueSoundConverter*    SoundConverter;
/*callback routine to provide data to the Sound Converter*/
typedef CALLBACK_API( Boolean , SoundConverterFillBufferDataProcPtr )(SoundComponentDataPtr *data, void *refCon);
typedef STACK_UPP_TYPE(SoundConverterFillBufferDataProcPtr)     SoundConverterFillBufferDataUPP;
/*private thing to use as a reference to a Sound Source*/
typedef struct OpaqueSoundSource*       SoundSource;
typedef SoundSource *                   SoundSourcePtr;


struct SoundComponentLink {
  ComponentDescription  description;          /*Describes the sound component*/
  SoundSource         mixerID;                /*Reserved by Apple*/
  SoundSource *       linkID;                 /*Reserved by Apple*/
};
typedef struct SoundComponentLink       SoundComponentLink;
typedef SoundComponentLink *            SoundComponentLinkPtr;
struct AudioInfo {
  long                capabilitiesFlags;      /*Describes device capabilities*/
  long                reserved;               /*Reserved by Apple*/
  unsigned short      numVolumeSteps;         /*Number of significant increments between min and max volume*/
};
typedef struct AudioInfo                AudioInfo;
typedef AudioInfo *                     AudioInfoPtr;
struct AudioFormatAtom {
  long                size;                   /* = sizeof(AudioFormatAtom)*/
  OSType              atomType;               /* = kAudioFormatAtomType*/
  OSType              format;
};
typedef struct AudioFormatAtom          AudioFormatAtom;
typedef AudioFormatAtom *               AudioFormatAtomPtr;
struct AudioEndianAtom {
  long                size;                   /* = sizeof(AudioEndianAtom)*/
  OSType              atomType;               /* = kAudioEndianAtomType*/
  short               littleEndian;
};
typedef struct AudioEndianAtom          AudioEndianAtom;
typedef AudioEndianAtom *               AudioEndianAtomPtr;
struct AudioTerminatorAtom {
  long                size;                   /* = sizeof(AudioTerminatorAtom)*/
  OSType              atomType;               /* = kAudioTerminatorAtomType*/
};
typedef struct AudioTerminatorAtom      AudioTerminatorAtom;
typedef AudioTerminatorAtom *           AudioTerminatorAtomPtr;
struct LevelMeterInfo {
  short               numChannels;            /* mono or stereo source*/
  UInt8               leftMeter;              /* 0-255 range*/
  UInt8               rightMeter;             /* 0-255 range*/
};
typedef struct LevelMeterInfo           LevelMeterInfo;
typedef LevelMeterInfo *                LevelMeterInfoPtr;
struct EQSpectrumBandsRecord {
  short               count;
  UnsignedFixedPtr    frequency;              /* pointer to array of frequencies*/
};
typedef struct EQSpectrumBandsRecord    EQSpectrumBandsRecord;
typedef EQSpectrumBandsRecord *         EQSpectrumBandsRecordPtr;
enum {
  kSoundAudioCodecPropertyWritableFlag = 1L << 0
};

struct SoundAudioCodecPropertyRequestParams {
  UInt32              propertyClass;
  UInt32              propertyID;
  UInt32              propertyDataSize;       /* out -- GetPropertyInfo, in/out -- GetProperty, in -- SetProperty*/
  void *              propertyData;           /* in -- GetPropertyInfo, GetProperty, SetProperty*/
  UInt32              propertyRequestFlags;   /* out -- GetPropertyInfo*/
  UInt32              propertyDataType;       /* out -- GetPropertyInfo, often 0*/
  ComponentResult     propertyRequestResult;  /* out -- GetPropertyInfo, GetProperty, SetProperty*/
};
typedef struct SoundAudioCodecPropertyRequestParams SoundAudioCodecPropertyRequestParams;


/* Sound Input Structures*/
typedef struct SPB                      SPB;

typedef SPB *                           SPBPtr;


/*user procedures called by sound input routines*/
typedef CALLBACK_API_REGISTER68K( void , SIInterruptProcPtr, (SPBPtr inParamPtr, Ptr dataBuffer, short peakAmplitude, long sampleSize) );
typedef CALLBACK_API( void , SICompletionProcPtr )(SPBPtr inParamPtr);
typedef REGISTER_UPP_TYPE(SIInterruptProcPtr)                   SIInterruptUPP;
typedef STACK_UPP_TYPE(SICompletionProcPtr)                     SICompletionUPP;


/*Sound Input Parameter Block*/
struct SPB {
  long                inRefNum;               /*reference number of sound input device*/
  unsigned long       count;                  /*number of bytes to record*/
  unsigned long       milliseconds;           /*number of milliseconds to record*/
  unsigned long       bufferLength;           /*length of buffer in bytes*/
  Ptr                 bufferPtr;              /*buffer to store sound data in*/
  SICompletionUPP     completionRoutine;      /*completion routine*/
  SIInterruptUPP      interruptRoutine;       /*interrupt routine*/
  long                userLong;               /*user-defined field*/
  OSErr               error;                  /*error*/
  long                unused1;                /*reserved - must be zero*/
};

/*
 *  NewSoundParamUPP()
 *  
 *  Availability:
 *    Non-Carbon CFM:   available as macro/inline
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( SoundParamUPP )
NewSoundParamUPP(SoundParamProcPtr userRoutine);
#if !OPAQUE_UPP_TYPES
  enum { uppSoundParamProcInfo = 0x000000D0 };  /* pascal 1_byte Func(4_bytes) */
  #ifdef __cplusplus
    inline DEFINE_API_C(SoundParamUPP) NewSoundParamUPP(SoundParamProcPtr userRoutine) { return (SoundParamUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSoundParamProcInfo, GetCurrentArchitecture()); }
  #else
    #define NewSoundParamUPP(userRoutine) (SoundParamUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSoundParamProcInfo, GetCurrentArchitecture())
  #endif
#endif

/*
 *  NewSoundConverterFillBufferDataUPP()
 *  
 *  Availability:
 *    Non-Carbon CFM:   available as macro/inline
 *    CarbonLib:        in CarbonLib 1.1 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( SoundConverterFillBufferDataUPP )
NewSoundConverterFillBufferDataUPP(SoundConverterFillBufferDataProcPtr userRoutine);
#if !OPAQUE_UPP_TYPES
  enum { uppSoundConverterFillBufferDataProcInfo = 0x000003D0 };  /* pascal 1_byte Func(4_bytes, 4_bytes) */
  #ifdef __cplusplus
    inline DEFINE_API_C(SoundConverterFillBufferDataUPP) NewSoundConverterFillBufferDataUPP(SoundConverterFillBufferDataProcPtr userRoutine) { return (SoundConverterFillBufferDataUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSoundConverterFillBufferDataProcInfo, GetCurrentArchitecture()); }
  #else
    #define NewSoundConverterFillBufferDataUPP(userRoutine) (SoundConverterFillBufferDataUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSoundConverterFillBufferDataProcInfo, GetCurrentArchitecture())
  #endif
#endif

/*
 *  NewSIInterruptUPP()
 *  
 *  Availability:
 *    Non-Carbon CFM:   available as macro/inline
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( SIInterruptUPP )
NewSIInterruptUPP(SIInterruptProcPtr userRoutine);
#if !OPAQUE_UPP_TYPES
  enum { uppSIInterruptProcInfo = 0x1C579802 };  /* register no_return_value Func(4_bytes:A0, 4_bytes:A1, 2_bytes:D0, 4_bytes:D1) */
  #ifdef __cplusplus
    inline DEFINE_API_C(SIInterruptUPP) NewSIInterruptUPP(SIInterruptProcPtr userRoutine) { return (SIInterruptUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSIInterruptProcInfo, GetCurrentArchitecture()); }
  #else
    #define NewSIInterruptUPP(userRoutine) (SIInterruptUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSIInterruptProcInfo, GetCurrentArchitecture())
  #endif
#endif

/*
 *  NewSICompletionUPP()
 *  
 *  Availability:
 *    Non-Carbon CFM:   available as macro/inline
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( SICompletionUPP )
NewSICompletionUPP(SICompletionProcPtr userRoutine);
#if !OPAQUE_UPP_TYPES
  enum { uppSICompletionProcInfo = 0x000000C0 };  /* pascal no_return_value Func(4_bytes) */
  #ifdef __cplusplus
    inline DEFINE_API_C(SICompletionUPP) NewSICompletionUPP(SICompletionProcPtr userRoutine) { return (SICompletionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSICompletionProcInfo, GetCurrentArchitecture()); }
  #else
    #define NewSICompletionUPP(userRoutine) (SICompletionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSICompletionProcInfo, GetCurrentArchitecture())
  #endif
#endif

/*
 *  DisposeSoundParamUPP()
 *  
 *  Availability:
 *    Non-Carbon CFM:   available as macro/inline
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( void )
DisposeSoundParamUPP(SoundParamUPP userUPP);
#if !OPAQUE_UPP_TYPES
  #ifdef __cplusplus
      inline DEFINE_API_C(void) DisposeSoundParamUPP(SoundParamUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  #else
      #define DisposeSoundParamUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  #endif
#endif

/*
 *  DisposeSoundConverterFillBufferDataUPP()
 *  
 *  Availability:
 *    Non-Carbon CFM:   available as macro/inline
 *    CarbonLib:        in CarbonLib 1.1 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( void )
DisposeSoundConverterFillBufferDataUPP(SoundConverterFillBufferDataUPP userUPP);
#if !OPAQUE_UPP_TYPES
  #ifdef __cplusplus
      inline DEFINE_API_C(void) DisposeSoundConverterFillBufferDataUPP(SoundConverterFillBufferDataUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  #else
      #define DisposeSoundConverterFillBufferDataUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  #endif
#endif

/*
 *  DisposeSIInterruptUPP()
 *  
 *  Availability:
 *    Non-Carbon CFM:   available as macro/inline
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( void )
DisposeSIInterruptUPP(SIInterruptUPP userUPP);
#if !OPAQUE_UPP_TYPES
  #ifdef __cplusplus
      inline DEFINE_API_C(void) DisposeSIInterruptUPP(SIInterruptUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  #else
      #define DisposeSIInterruptUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  #endif
#endif

/*
 *  DisposeSICompletionUPP()
 *  
 *  Availability:
 *    Non-Carbon CFM:   available as macro/inline
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( void )
DisposeSICompletionUPP(SICompletionUPP userUPP);
#if !OPAQUE_UPP_TYPES
  #ifdef __cplusplus
      inline DEFINE_API_C(void) DisposeSICompletionUPP(SICompletionUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  #else
      #define DisposeSICompletionUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  #endif
#endif

/*
 *  InvokeSoundParamUPP()
 *  
 *  Availability:
 *    Non-Carbon CFM:   available as macro/inline
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( Boolean )
InvokeSoundParamUPP(
  SoundParamBlockPtr *  pb,
  SoundParamUPP         userUPP);
#if !OPAQUE_UPP_TYPES
  #ifdef __cplusplus
      inline DEFINE_API_C(Boolean) InvokeSoundParamUPP(SoundParamBlockPtr * pb, SoundParamUPP userUPP) { return (Boolean)CALL_ONE_PARAMETER_UPP(userUPP, uppSoundParamProcInfo, pb); }
  #else
    #define InvokeSoundParamUPP(pb, userUPP) (Boolean)CALL_ONE_PARAMETER_UPP((userUPP), uppSoundParamProcInfo, (pb))
  #endif
#endif

/*
 *  InvokeSoundConverterFillBufferDataUPP()
 *  
 *  Availability:
 *    Non-Carbon CFM:   available as macro/inline
 *    CarbonLib:        in CarbonLib 1.1 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( Boolean )
InvokeSoundConverterFillBufferDataUPP(
  SoundComponentDataPtr *          data,
  void *                           refCon,
  SoundConverterFillBufferDataUPP  userUPP);
#if !OPAQUE_UPP_TYPES
  #ifdef __cplusplus
      inline DEFINE_API_C(Boolean) InvokeSoundConverterFillBufferDataUPP(SoundComponentDataPtr * data, void * refCon, SoundConverterFillBufferDataUPP userUPP) { return (Boolean)CALL_TWO_PARAMETER_UPP(userUPP, uppSoundConverterFillBufferDataProcInfo, data, refCon); }
  #else
    #define InvokeSoundConverterFillBufferDataUPP(data, refCon, userUPP) (Boolean)CALL_TWO_PARAMETER_UPP((userUPP), uppSoundConverterFillBufferDataProcInfo, (data), (refCon))
  #endif
#endif

/*
 *  InvokeSIInterruptUPP()
 *  
 *  Availability:
 *    Non-Carbon CFM:   available as macro/inline
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( void )
InvokeSIInterruptUPP(
  SPBPtr          inParamPtr,
  Ptr             dataBuffer,
  short           peakAmplitude,
  long            sampleSize,
  SIInterruptUPP  userUPP);
#if !OPAQUE_UPP_TYPES && (!TARGET_OS_MAC || !TARGET_CPU_68K || TARGET_RT_MAC_CFM)
  #ifdef __cplusplus
      inline DEFINE_API_C(void) InvokeSIInterruptUPP(SPBPtr inParamPtr, Ptr dataBuffer, short peakAmplitude, long sampleSize, SIInterruptUPP userUPP) { CALL_FOUR_PARAMETER_UPP(userUPP, uppSIInterruptProcInfo, inParamPtr, dataBuffer, peakAmplitude, sampleSize); }
  #else
    #define InvokeSIInterruptUPP(inParamPtr, dataBuffer, peakAmplitude, sampleSize, userUPP) CALL_FOUR_PARAMETER_UPP((userUPP), uppSIInterruptProcInfo, (inParamPtr), (dataBuffer), (peakAmplitude), (sampleSize))
  #endif
#endif

/*
 *  InvokeSICompletionUPP()
 *  
 *  Availability:
 *    Non-Carbon CFM:   available as macro/inline
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API_C( void )
InvokeSICompletionUPP(
  SPBPtr           inParamPtr,
  SICompletionUPP  userUPP);
#if !OPAQUE_UPP_TYPES
  #ifdef __cplusplus
      inline DEFINE_API_C(void) InvokeSICompletionUPP(SPBPtr inParamPtr, SICompletionUPP userUPP) { CALL_ONE_PARAMETER_UPP(userUPP, uppSICompletionProcInfo, inParamPtr); }
  #else
    #define InvokeSICompletionUPP(inParamPtr, userUPP) CALL_ONE_PARAMETER_UPP((userUPP), uppSICompletionProcInfo, (inParamPtr))
  #endif
#endif

#if CALL_NOT_IN_CARBON || OLDROUTINENAMES
    /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
    #define NewSoundParamProc(userRoutine)                      NewSoundParamUPP(userRoutine)
    #define NewSoundConverterFillBufferDataProc(userRoutine)    NewSoundConverterFillBufferDataUPP(userRoutine)
    #define NewSIInterruptProc(userRoutine)                     NewSIInterruptUPP(userRoutine)
    #define NewSICompletionProc(userRoutine)                    NewSICompletionUPP(userRoutine)
    #define CallSoundParamProc(userRoutine, pb)                 InvokeSoundParamUPP(pb, userRoutine)
    #define CallSoundConverterFillBufferDataProc(userRoutine, data, refCon) InvokeSoundConverterFillBufferDataUPP(data, refCon, userRoutine)
    #define CallSIInterruptProc(userRoutine, inParamPtr, dataBuffer, peakAmplitude, sampleSize) InvokeSIInterruptUPP(inParamPtr, dataBuffer, peakAmplitude, sampleSize, userRoutine)
    #define CallSICompletionProc(userRoutine, inParamPtr)       InvokeSICompletionUPP(inParamPtr, userRoutine)
#endif /* CALL_NOT_IN_CARBON */

typedef CALLBACK_API( void , FilePlayCompletionProcPtr )(SndChannelPtr chan);
typedef STACK_UPP_TYPE(FilePlayCompletionProcPtr)               FilePlayCompletionUPP;
#if CALL_NOT_IN_CARBON
/*
 *  NewFilePlayCompletionUPP()
 *  
 *  Availability:
 *    Non-Carbon CFM:   available as macro/inline
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API_C( FilePlayCompletionUPP )
NewFilePlayCompletionUPP(FilePlayCompletionProcPtr userRoutine);
#if !OPAQUE_UPP_TYPES
  enum { uppFilePlayCompletionProcInfo = 0x000000C0 };  /* pascal no_return_value Func(4_bytes) */
  #ifdef __cplusplus
    inline DEFINE_API_C(FilePlayCompletionUPP) NewFilePlayCompletionUPP(FilePlayCompletionProcPtr userRoutine) { return (FilePlayCompletionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppFilePlayCompletionProcInfo, GetCurrentArchitecture()); }
  #else
    #define NewFilePlayCompletionUPP(userRoutine) (FilePlayCompletionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppFilePlayCompletionProcInfo, GetCurrentArchitecture())
  #endif
#endif

/*
 *  DisposeFilePlayCompletionUPP()
 *  
 *  Availability:
 *    Non-Carbon CFM:   available as macro/inline
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API_C( void )
DisposeFilePlayCompletionUPP(FilePlayCompletionUPP userUPP);
#if !OPAQUE_UPP_TYPES
  #ifdef __cplusplus
      inline DEFINE_API_C(void) DisposeFilePlayCompletionUPP(FilePlayCompletionUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  #else
      #define DisposeFilePlayCompletionUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  #endif
#endif

/*
 *  InvokeFilePlayCompletionUPP()
 *  
 *  Availability:
 *    Non-Carbon CFM:   available as macro/inline
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API_C( void )
InvokeFilePlayCompletionUPP(
  SndChannelPtr          chan,
  FilePlayCompletionUPP  userUPP);
#if !OPAQUE_UPP_TYPES
  #ifdef __cplusplus
      inline DEFINE_API_C(void) InvokeFilePlayCompletionUPP(SndChannelPtr chan, FilePlayCompletionUPP userUPP) { CALL_ONE_PARAMETER_UPP(userUPP, uppFilePlayCompletionProcInfo, chan); }
  #else
    #define InvokeFilePlayCompletionUPP(chan, userUPP) CALL_ONE_PARAMETER_UPP((userUPP), uppFilePlayCompletionProcInfo, (chan))
  #endif
#endif

#endif  /* CALL_NOT_IN_CARBON */

#if CALL_NOT_IN_CARBON || OLDROUTINENAMES
    /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
    #define NewFilePlayCompletionProc(userRoutine)              NewFilePlayCompletionUPP(userRoutine)
    #define CallFilePlayCompletionProc(userRoutine, chan)       InvokeFilePlayCompletionUPP(chan, userRoutine)
#endif /* CALL_NOT_IN_CARBON */

/*
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   prototypes
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/


/* Sound Manager routines */
/*
 *  SysBeep()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( void )
SysBeep(short duration)                                       ONEWORDINLINE(0xA9C8);


/*
 *  SndDoCommand()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SndDoCommand(
  SndChannelPtr       chan,
  const SndCommand *  cmd,
  Boolean             noWait)                                 ONEWORDINLINE(0xA803);


/*
 *  SndDoImmediate()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SndDoImmediate(
  SndChannelPtr       chan,
  const SndCommand *  cmd)                                    ONEWORDINLINE(0xA804);


/*
 *  SndNewChannel()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SndNewChannel(
  SndChannelPtr *  chan,
  short            synth,
  long             init,
  SndCallBackUPP   userRoutine)                               ONEWORDINLINE(0xA807);


/*
 *  SndDisposeChannel()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SndDisposeChannel(
  SndChannelPtr   chan,
  Boolean         quietNow)                                   ONEWORDINLINE(0xA801);


/*
 *  SndPlay()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SndPlay(
  SndChannelPtr   chan,
  SndListHandle   sndHandle,
  Boolean         async)                                      ONEWORDINLINE(0xA805);


#if OLDROUTINENAMES
#if CALL_NOT_IN_CARBON
/*
 *  SndAddModifier()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API( OSErr )
SndAddModifier(
  SndChannelPtr   chan,
  Ptr             modifier,
  short           id,
  long            init)                                       ONEWORDINLINE(0xA802);


#endif  /* CALL_NOT_IN_CARBON */

#endif  /* OLDROUTINENAMES */

#if CALL_NOT_IN_CARBON
/*
 *  SndControl()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API( OSErr )
SndControl(
  short         id,
  SndCommand *  cmd)                                          ONEWORDINLINE(0xA806);


/* Sound Manager 2.0 and later, uses _SoundDispatch */
#endif  /* CALL_NOT_IN_CARBON */

/*
 *  SndSoundManagerVersion()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( NumVersion )
SndSoundManagerVersion(void)                                  FOURWORDINLINE(0x203C, 0x000C, 0x0008, 0xA800);


#if CALL_NOT_IN_CARBON
/*
 *  SndStartFilePlay()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API( OSErr )
SndStartFilePlay(
  SndChannelPtr           chan,
  short                   fRefNum,
  short                   resNum,
  long                    bufferSize,
  void *                  theBuffer,
  AudioSelectionPtr       theSelection,
  FilePlayCompletionUPP   theCompletion,
  Boolean                 async)                              FOURWORDINLINE(0x203C, 0x0D00, 0x0008, 0xA800);


/*
 *  SndPauseFilePlay()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API( OSErr )
SndPauseFilePlay(SndChannelPtr chan)                          FOURWORDINLINE(0x203C, 0x0204, 0x0008, 0xA800);


/*
 *  SndStopFilePlay()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API( OSErr )
SndStopFilePlay(
  SndChannelPtr   chan,
  Boolean         quietNow)                                   FOURWORDINLINE(0x203C, 0x0308, 0x0008, 0xA800);


#endif  /* CALL_NOT_IN_CARBON */

/*
 *  SndChannelStatus()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SndChannelStatus(
  SndChannelPtr   chan,
  short           theLength,
  SCStatusPtr     theStatus)                                  FOURWORDINLINE(0x203C, 0x0510, 0x0008, 0xA800);


/*
 *  SndManagerStatus()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SndManagerStatus(
  short         theLength,
  SMStatusPtr   theStatus)                                    FOURWORDINLINE(0x203C, 0x0314, 0x0008, 0xA800);


/*
 *  SndGetSysBeepState()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( void )
SndGetSysBeepState(short * sysBeepState)                      FOURWORDINLINE(0x203C, 0x0218, 0x0008, 0xA800);


/*
 *  SndSetSysBeepState()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SndSetSysBeepState(short sysBeepState)                        FOURWORDINLINE(0x203C, 0x011C, 0x0008, 0xA800);


#if CALL_NOT_IN_CARBON
/*
 *  SndPlayDoubleBuffer()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API( OSErr )
SndPlayDoubleBuffer(
  SndChannelPtr              chan,
  SndDoubleBufferHeaderPtr   theParams)                       FOURWORDINLINE(0x203C, 0x0420, 0x0008, 0xA800);


/* MACE compression routines, uses _SoundDispatch */
/*
 *  MACEVersion()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API( NumVersion )
MACEVersion(void)                                             FOURWORDINLINE(0x203C, 0x0000, 0x0010, 0xA800);


/*
 *  Comp3to1()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API( void )
Comp3to1(
  const void *    inBuffer,
  void *          outBuffer,
  unsigned long   cnt,
  StateBlockPtr   inState,
  StateBlockPtr   outState,
  unsigned long   numChannels,
  unsigned long   whichChannel)                               FOURWORDINLINE(0x203C, 0x0004, 0x0010, 0xA800);


/*
 *  Exp1to3()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API( void )
Exp1to3(
  const void *    inBuffer,
  void *          outBuffer,
  unsigned long   cnt,
  StateBlockPtr   inState,
  StateBlockPtr   outState,
  unsigned long   numChannels,
  unsigned long   whichChannel)                               FOURWORDINLINE(0x203C, 0x0008, 0x0010, 0xA800);


/*
 *  Comp6to1()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API( void )
Comp6to1(
  const void *    inBuffer,
  void *          outBuffer,
  unsigned long   cnt,
  StateBlockPtr   inState,
  StateBlockPtr   outState,
  unsigned long   numChannels,
  unsigned long   whichChannel)                               FOURWORDINLINE(0x203C, 0x000C, 0x0010, 0xA800);


/*
 *  Exp1to6()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API( void )
Exp1to6(
  const void *    inBuffer,
  void *          outBuffer,
  unsigned long   cnt,
  StateBlockPtr   inState,
  StateBlockPtr   outState,
  unsigned long   numChannels,
  unsigned long   whichChannel)                               FOURWORDINLINE(0x203C, 0x0010, 0x0010, 0xA800);


/* Sound Manager 3.0 and later calls, uses _SoundDispatch */
#endif  /* CALL_NOT_IN_CARBON */

/*
 *  GetSysBeepVolume()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
GetSysBeepVolume(long * level)                                FOURWORDINLINE(0x203C, 0x0224, 0x0018, 0xA800);


/*
 *  SetSysBeepVolume()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SetSysBeepVolume(long level)                                  FOURWORDINLINE(0x203C, 0x0228, 0x0018, 0xA800);


/*
 *  GetDefaultOutputVolume()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
GetDefaultOutputVolume(long * level)                          FOURWORDINLINE(0x203C, 0x022C, 0x0018, 0xA800);


/*
 *  SetDefaultOutputVolume()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SetDefaultOutputVolume(long level)                            FOURWORDINLINE(0x203C, 0x0230, 0x0018, 0xA800);


/*
 *  GetSoundHeaderOffset()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
GetSoundHeaderOffset(
  SndListHandle   sndHandle,
  long *          offset)                                     FOURWORDINLINE(0x203C, 0x0404, 0x0018, 0xA800);


/*
 *  UnsignedFixedMulDiv()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         not available
 */
EXTERN_API( UnsignedFixed )
UnsignedFixedMulDiv(
  UnsignedFixed   value,
  UnsignedFixed   multiplier,
  UnsignedFixed   divisor)                                    FOURWORDINLINE(0x203C, 0x060C, 0x0018, 0xA800);


/*
 *  GetCompressionInfo()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
GetCompressionInfo(
  short                compressionID,
  OSType               format,
  short                numChannels,
  short                sampleSize,
  CompressionInfoPtr   cp)                                    FOURWORDINLINE(0x203C, 0x0710, 0x0018, 0xA800);


/*
 *  SetSoundPreference()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SetSoundPreference(
  OSType   theType,
  Str255   name,
  Handle   settings)                                          FOURWORDINLINE(0x203C, 0x0634, 0x0018, 0xA800);


/*
 *  GetSoundPreference()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
GetSoundPreference(
  OSType   theType,
  Str255   name,
  Handle   settings)                                          FOURWORDINLINE(0x203C, 0x0638, 0x0018, 0xA800);


/*
 *  OpenMixerSoundComponent()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
OpenMixerSoundComponent(
  SoundComponentDataPtr   outputDescription,
  long                    outputFlags,
  ComponentInstance *     mixerComponent)                     FOURWORDINLINE(0x203C, 0x0614, 0x0018, 0xA800);


/*
 *  CloseMixerSoundComponent()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
CloseMixerSoundComponent(ComponentInstance ci)                FOURWORDINLINE(0x203C, 0x0218, 0x0018, 0xA800);


/* Sound Manager 3.1 and later calls, uses _SoundDispatch */
/*
 *  SndGetInfo()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SndGetInfo(
  SndChannelPtr   chan,
  OSType          selector,
  void *          infoPtr)                                    FOURWORDINLINE(0x203C, 0x063C, 0x0018, 0xA800);


/*
 *  SndSetInfo()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SndSetInfo(
  SndChannelPtr   chan,
  OSType          selector,
  const void *    infoPtr)                                    FOURWORDINLINE(0x203C, 0x0640, 0x0018, 0xA800);


/*
 *  GetSoundOutputInfo()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
GetSoundOutputInfo(
  Component   outputDevice,
  OSType      selector,
  void *      infoPtr)                                        FOURWORDINLINE(0x203C, 0x0644, 0x0018, 0xA800);


/*
 *  SetSoundOutputInfo()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SetSoundOutputInfo(
  Component     outputDevice,
  OSType        selector,
  const void *  infoPtr)                                      FOURWORDINLINE(0x203C, 0x0648, 0x0018, 0xA800);


/* Sound Manager 3.2 and later calls, uses _SoundDispatch */
/*
 *  GetCompressionName()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.2 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
GetCompressionName(
  OSType   compressionType,
  Str255   compressionName)                                   FOURWORDINLINE(0x203C, 0x044C, 0x0018, 0xA800);


/*
 *  SoundConverterOpen()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.2 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SoundConverterOpen(
  const SoundComponentData *  inputFormat,
  const SoundComponentData *  outputFormat,
  SoundConverter *            sc)                             FOURWORDINLINE(0x203C, 0x0650, 0x0018, 0xA800);


/*
 *  SoundConverterClose()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.2 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SoundConverterClose(SoundConverter sc)                        FOURWORDINLINE(0x203C, 0x0254, 0x0018, 0xA800);


/*
 *  SoundConverterGetBufferSizes()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.2 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SoundConverterGetBufferSizes(
  SoundConverter   sc,
  unsigned long    inputBytesTarget,
  unsigned long *  inputFrames,
  unsigned long *  inputBytes,
  unsigned long *  outputBytes)                               FOURWORDINLINE(0x203C, 0x0A58, 0x0018, 0xA800);


/*
 *  SoundConverterBeginConversion()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.2 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SoundConverterBeginConversion(SoundConverter sc)              FOURWORDINLINE(0x203C, 0x025C, 0x0018, 0xA800);


/*
 *  SoundConverterConvertBuffer()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.2 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SoundConverterConvertBuffer(
  SoundConverter   sc,
  const void *     inputPtr,
  unsigned long    inputFrames,
  void *           outputPtr,
  unsigned long *  outputFrames,
  unsigned long *  outputBytes)                               FOURWORDINLINE(0x203C, 0x0C60, 0x0018, 0xA800);


/*
 *  SoundConverterEndConversion()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.2 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SoundConverterEndConversion(
  SoundConverter   sc,
  void *           outputPtr,
  unsigned long *  outputFrames,
  unsigned long *  outputBytes)                               FOURWORDINLINE(0x203C, 0x0864, 0x0018, 0xA800);


/* Sound Manager 3.3 and later calls, uses _SoundDispatch */
/*
 *  SoundConverterGetInfo()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.3 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SoundConverterGetInfo(
  SoundConverter   sc,
  OSType           selector,
  void *           infoPtr)                                   FOURWORDINLINE(0x203C, 0x0668, 0x0018, 0xA800);


/*
 *  SoundConverterSetInfo()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.3 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SoundConverterSetInfo(
  SoundConverter   sc,
  OSType           selector,
  void *           infoPtr)                                   FOURWORDINLINE(0x203C, 0x066C, 0x0018, 0xA800);


/* Sound Manager 3.6 and later calls, uses _SoundDispatch */
/*
 *  SoundConverterFillBuffer()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.6 and later
 *    CarbonLib:        in CarbonLib 1.1 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SoundConverterFillBuffer(
  SoundConverter                    sc,
  SoundConverterFillBufferDataUPP   fillBufferDataUPP,
  void *                            fillBufferDataRefCon,
  void *                            outputBuffer,
  unsigned long                     outputBufferByteSize,
  unsigned long *                   bytesWritten,
  unsigned long *                   framesWritten,
  unsigned long *                   outputFlags)              FOURWORDINLINE(0x203C, 0x1078, 0x0018, 0xA800);


/*
 *  SoundManagerGetInfo()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.6 and later
 *    CarbonLib:        in CarbonLib 1.1 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SoundManagerGetInfo(
  OSType   selector,
  void *   infoPtr)                                           FOURWORDINLINE(0x203C, 0x047C, 0x0018, 0xA800);


/*
 *  SoundManagerSetInfo()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.6 and later
 *    CarbonLib:        in CarbonLib 1.1 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SoundManagerSetInfo(
  OSType        selector,
  const void *  infoPtr)                                      FOURWORDINLINE(0x203C, 0x0480, 0x0018, 0xA800);


/*
  Sound Component Functions
   basic sound component functions
*/

/*
 *  SoundComponentInitOutputDevice()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( ComponentResult )
SoundComponentInitOutputDevice(
  ComponentInstance   ti,
  long                actions)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0001, 0x7000, 0xA82A);


/*
 *  SoundComponentSetSource()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( ComponentResult )
SoundComponentSetSource(
  ComponentInstance   ti,
  SoundSource         sourceID,
  ComponentInstance   source)                                 FIVEWORDINLINE(0x2F3C, 0x0008, 0x0002, 0x7000, 0xA82A);


/*
 *  SoundComponentGetSource()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( ComponentResult )
SoundComponentGetSource(
  ComponentInstance    ti,
  SoundSource          sourceID,
  ComponentInstance *  source)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0003, 0x7000, 0xA82A);


/*
 *  SoundComponentGetSourceData()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( ComponentResult )
SoundComponentGetSourceData(
  ComponentInstance        ti,
  SoundComponentDataPtr *  sourceData)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x0004, 0x7000, 0xA82A);


/*
 *  SoundComponentSetOutput()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( ComponentResult )
SoundComponentSetOutput(
  ComponentInstance        ti,
  SoundComponentDataPtr    requested,
  SoundComponentDataPtr *  actual)                            FIVEWORDINLINE(0x2F3C, 0x0008, 0x0005, 0x7000, 0xA82A);


/* junction methods for the mixer, must be called at non-interrupt level*/
/*
 *  SoundComponentAddSource()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( ComponentResult )
SoundComponentAddSource(
  ComponentInstance   ti,
  SoundSource *       sourceID)                               FIVEWORDINLINE(0x2F3C, 0x0004, 0x0101, 0x7000, 0xA82A);


/*
 *  SoundComponentRemoveSource()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( ComponentResult )
SoundComponentRemoveSource(
  ComponentInstance   ti,
  SoundSource         sourceID)                               FIVEWORDINLINE(0x2F3C, 0x0004, 0x0102, 0x7000, 0xA82A);


/* info methods*/
/*
 *  SoundComponentGetInfo()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( ComponentResult )
SoundComponentGetInfo(
  ComponentInstance   ti,
  SoundSource         sourceID,
  OSType              selector,
  void *              infoPtr)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0103, 0x7000, 0xA82A);


/*
 *  SoundComponentSetInfo()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( ComponentResult )
SoundComponentSetInfo(
  ComponentInstance   ti,
  SoundSource         sourceID,
  OSType              selector,
  void *              infoPtr)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0104, 0x7000, 0xA82A);


/* control methods*/
/*
 *  SoundComponentStartSource()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( ComponentResult )
SoundComponentStartSource(
  ComponentInstance   ti,
  short               count,
  SoundSource *       sources)                                FIVEWORDINLINE(0x2F3C, 0x0006, 0x0105, 0x7000, 0xA82A);


/*
 *  SoundComponentStopSource()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( ComponentResult )
SoundComponentStopSource(
  ComponentInstance   ti,
  short               count,
  SoundSource *       sources)                                FIVEWORDINLINE(0x2F3C, 0x0006, 0x0106, 0x7000, 0xA82A);


/*
 *  SoundComponentPauseSource()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( ComponentResult )
SoundComponentPauseSource(
  ComponentInstance   ti,
  short               count,
  SoundSource *       sources)                                FIVEWORDINLINE(0x2F3C, 0x0006, 0x0107, 0x7000, 0xA82A);


/*
 *  SoundComponentPlaySourceBuffer()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( ComponentResult )
SoundComponentPlaySourceBuffer(
  ComponentInstance    ti,
  SoundSource          sourceID,
  SoundParamBlockPtr   pb,
  long                 actions)                               FIVEWORDINLINE(0x2F3C, 0x000C, 0x0108, 0x7000, 0xA82A);



/* selectors for component calls */
enum {
    kSoundComponentInitOutputDeviceSelect      = 0x0001,
    kSoundComponentSetSourceSelect             = 0x0002,
    kSoundComponentGetSourceSelect             = 0x0003,
    kSoundComponentGetSourceDataSelect         = 0x0004,
    kSoundComponentSetOutputSelect             = 0x0005,
    kSoundComponentAddSourceSelect             = 0x0101,
    kSoundComponentRemoveSourceSelect          = 0x0102,
    kSoundComponentGetInfoSelect               = 0x0103,
    kSoundComponentSetInfoSelect               = 0x0104,
    kSoundComponentStartSourceSelect           = 0x0105,
    kSoundComponentStopSourceSelect            = 0x0106,
    kSoundComponentPauseSourceSelect           = 0x0107,
    kSoundComponentPlaySourceBufferSelect      = 0x0108
};
/*Audio Components*/
/*Volume is described as a value between 0 and 1, with 0 indicating minimum
  volume and 1 indicating maximum volume; if the device doesn't support
  software control of volume, then a value of unimpErr is returned, indicating
  that these functions are not supported by the device
*/
#if CALL_NOT_IN_CARBON
/*
 *  AudioGetVolume()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API( ComponentResult )
AudioGetVolume(
  ComponentInstance   ac,
  short               whichChannel,
  ShortFixed *        volume)                                 FIVEWORDINLINE(0x2F3C, 0x0006, 0x0000, 0x7000, 0xA82A);


/*
 *  AudioSetVolume()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API( ComponentResult )
AudioSetVolume(
  ComponentInstance   ac,
  short               whichChannel,
  ShortFixed          volume)                                 FIVEWORDINLINE(0x2F3C, 0x0004, 0x0001, 0x7000, 0xA82A);


/*If the device doesn't support software control of mute, then a value of unimpErr is
returned, indicating that these functions are not supported by the device.*/
/*
 *  AudioGetMute()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API( ComponentResult )
AudioGetMute(
  ComponentInstance   ac,
  short               whichChannel,
  short *             mute)                                   FIVEWORDINLINE(0x2F3C, 0x0006, 0x0002, 0x7000, 0xA82A);


/*
 *  AudioSetMute()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API( ComponentResult )
AudioSetMute(
  ComponentInstance   ac,
  short               whichChannel,
  short               mute)                                   FIVEWORDINLINE(0x2F3C, 0x0004, 0x0003, 0x7000, 0xA82A);


/*AudioSetToDefaults causes the associated device to reset its volume and mute values
(and perhaps other characteristics, e.g. attenuation) to "factory default" settings*/
/*
 *  AudioSetToDefaults()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API( ComponentResult )
AudioSetToDefaults(ComponentInstance ac)                      FIVEWORDINLINE(0x2F3C, 0x0000, 0x0004, 0x7000, 0xA82A);


/*This routine is required; it must be implemented by all audio components*/

/*
 *  AudioGetInfo()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API( ComponentResult )
AudioGetInfo(
  ComponentInstance   ac,
  AudioInfoPtr        info)                                   FIVEWORDINLINE(0x2F3C, 0x0004, 0x0005, 0x7000, 0xA82A);


/*
 *  AudioGetBass()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API( ComponentResult )
AudioGetBass(
  ComponentInstance   ac,
  short               whichChannel,
  short *             bass)                                   FIVEWORDINLINE(0x2F3C, 0x0006, 0x0006, 0x7000, 0xA82A);


/*
 *  AudioSetBass()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API( ComponentResult )
AudioSetBass(
  ComponentInstance   ac,
  short               whichChannel,
  short               bass)                                   FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);


/*
 *  AudioGetTreble()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API( ComponentResult )
AudioGetTreble(
  ComponentInstance   ac,
  short               whichChannel,
  short *             Treble)                                 FIVEWORDINLINE(0x2F3C, 0x0006, 0x0008, 0x7000, 0xA82A);


/*
 *  AudioSetTreble()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API( ComponentResult )
AudioSetTreble(
  ComponentInstance   ac,
  short               whichChannel,
  short               Treble)                                 FIVEWORDINLINE(0x2F3C, 0x0004, 0x0009, 0x7000, 0xA82A);


/*
 *  AudioGetOutputDevice()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API( ComponentResult )
AudioGetOutputDevice(
  ComponentInstance   ac,
  Component *         outputDevice)                           FIVEWORDINLINE(0x2F3C, 0x0004, 0x000A, 0x7000, 0xA82A);


/*This is routine is private to the AudioVision component.  It enables the watching of the mute key.*/
/*
 *  AudioMuteOnEvent()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API( ComponentResult )
AudioMuteOnEvent(
  ComponentInstance   ac,
  short               muteOnEvent)                            FIVEWORDINLINE(0x2F3C, 0x0002, 0x0081, 0x7000, 0xA82A);



/* selectors for component calls */
enum {
    kAudioGetVolumeSelect                      = 0x0000,
    kAudioSetVolumeSelect                      = 0x0001,
    kAudioGetMuteSelect                        = 0x0002,
    kAudioSetMuteSelect                        = 0x0003,
    kAudioSetToDefaultsSelect                  = 0x0004,
    kAudioGetInfoSelect                        = 0x0005,
    kAudioGetBassSelect                        = 0x0006,
    kAudioSetBassSelect                        = 0x0007,
    kAudioGetTrebleSelect                      = 0x0008,
    kAudioSetTrebleSelect                      = 0x0009,
    kAudioGetOutputDeviceSelect                = 0x000A,
    kAudioMuteOnEventSelect                    = 0x0081
};
#endif  /* CALL_NOT_IN_CARBON */


enum {
  kDelegatedSoundComponentSelectors = 0x0100
};



/* Sound Input Manager routines, uses _SoundDispatch */
/*
 *  SPBVersion()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( NumVersion )
SPBVersion(void)                                              FOURWORDINLINE(0x203C, 0x0000, 0x0014, 0xA800);


/*
 *  SndRecord()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SndRecord(
  ModalFilterUPP   filterProc,
  Point            corner,
  OSType           quality,
  SndListHandle *  sndHandle)                                 FOURWORDINLINE(0x203C, 0x0804, 0x0014, 0xA800);


#if CALL_NOT_IN_CARBON
/*
 *  SndRecordToFile()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API( OSErr )
SndRecordToFile(
  ModalFilterUPP   filterProc,
  Point            corner,
  OSType           quality,
  short            fRefNum)                                   FOURWORDINLINE(0x203C, 0x0708, 0x0014, 0xA800);


#endif  /* CALL_NOT_IN_CARBON */

/*
 *  SPBSignInDevice()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SPBSignInDevice(
  short              deviceRefNum,
  ConstStr255Param   deviceName)                              FOURWORDINLINE(0x203C, 0x030C, 0x0014, 0xA800);


/*
 *  SPBSignOutDevice()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SPBSignOutDevice(short deviceRefNum)                          FOURWORDINLINE(0x203C, 0x0110, 0x0014, 0xA800);


/*
 *  SPBGetIndexedDevice()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SPBGetIndexedDevice(
  short     count,
  Str255    deviceName,
  Handle *  deviceIconHandle)                                 FOURWORDINLINE(0x203C, 0x0514, 0x0014, 0xA800);


/*
 *  SPBOpenDevice()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SPBOpenDevice(
  ConstStr255Param   deviceName,
  short              permission,
  long *             inRefNum)                                FOURWORDINLINE(0x203C, 0x0518, 0x0014, 0xA800);


/*
 *  SPBCloseDevice()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SPBCloseDevice(long inRefNum)                                 FOURWORDINLINE(0x203C, 0x021C, 0x0014, 0xA800);


/*
 *  SPBRecord()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SPBRecord(
  SPBPtr    inParamPtr,
  Boolean   asynchFlag)                                       FOURWORDINLINE(0x203C, 0x0320, 0x0014, 0xA800);


#if CALL_NOT_IN_CARBON
/*
 *  SPBRecordToFile()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API( OSErr )
SPBRecordToFile(
  short     fRefNum,
  SPBPtr    inParamPtr,
  Boolean   asynchFlag)                                       FOURWORDINLINE(0x203C, 0x0424, 0x0014, 0xA800);


#endif  /* CALL_NOT_IN_CARBON */

/*
 *  SPBPauseRecording()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SPBPauseRecording(long inRefNum)                              FOURWORDINLINE(0x203C, 0x0228, 0x0014, 0xA800);


/*
 *  SPBResumeRecording()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SPBResumeRecording(long inRefNum)                             FOURWORDINLINE(0x203C, 0x022C, 0x0014, 0xA800);


/*
 *  SPBStopRecording()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SPBStopRecording(long inRefNum)                               FOURWORDINLINE(0x203C, 0x0230, 0x0014, 0xA800);


/*
 *  SPBGetRecordingStatus()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SPBGetRecordingStatus(
  long             inRefNum,
  short *          recordingStatus,
  short *          meterLevel,
  unsigned long *  totalSamplesToRecord,
  unsigned long *  numberOfSamplesRecorded,
  unsigned long *  totalMsecsToRecord,
  unsigned long *  numberOfMsecsRecorded)                     FOURWORDINLINE(0x203C, 0x0E34, 0x0014, 0xA800);


/*
 *  SPBGetDeviceInfo()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SPBGetDeviceInfo(
  long     inRefNum,
  OSType   infoType,
  void *   infoData)                                          FOURWORDINLINE(0x203C, 0x0638, 0x0014, 0xA800);


/*
 *  SPBSetDeviceInfo()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SPBSetDeviceInfo(
  long     inRefNum,
  OSType   infoType,
  void *   infoData)                                          FOURWORDINLINE(0x203C, 0x063C, 0x0014, 0xA800);


/*
 *  SPBMillisecondsToBytes()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SPBMillisecondsToBytes(
  long    inRefNum,
  long *  milliseconds)                                       FOURWORDINLINE(0x203C, 0x0440, 0x0014, 0xA800);


/*
 *  SPBBytesToMilliseconds()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SPBBytesToMilliseconds(
  long    inRefNum,
  long *  byteCount)                                          FOURWORDINLINE(0x203C, 0x0444, 0x0014, 0xA800);


/*
 *  SetupSndHeader()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SetupSndHeader(
  SndListHandle   sndHandle,
  short           numChannels,
  UnsignedFixed   sampleRate,
  short           sampleSize,
  OSType          compressionType,
  short           baseNote,
  unsigned long   numBytes,
  short *         headerLen)                                  FOURWORDINLINE(0x203C, 0x0D48, 0x0014, 0xA800);


/*
 *  SetupAIFFHeader()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
SetupAIFFHeader(
  short           fRefNum,
  short           numChannels,
  UnsignedFixed   sampleRate,
  short           sampleSize,
  OSType          compressionType,
  unsigned long   numBytes,
  unsigned long   numFrames)                                  FOURWORDINLINE(0x203C, 0x0B4C, 0x0014, 0xA800);


/* Sound Input Manager 1.1 and later calls, uses _SoundDispatch */
/*
 *  ParseAIFFHeader()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
ParseAIFFHeader(
  short                 fRefNum,
  SoundComponentData *  sndInfo,
  unsigned long *       numFrames,
  unsigned long *       dataOffset)                           FOURWORDINLINE(0x203C, 0x0758, 0x0014, 0xA800);


/*
 *  ParseSndHeader()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in SoundLib 3.0 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( OSErr )
ParseSndHeader(
  SndListHandle         sndHandle,
  SoundComponentData *  sndInfo,
  unsigned long *       numFrames,
  unsigned long *       dataOffset)                           FOURWORDINLINE(0x203C, 0x085C, 0x0014, 0xA800);






#if !TARGET_OS_MAC || TARGET_API_MAC_CARBON
/*  Only to be used if you are writing a sound input component; this */
/*  is the param block for a read request from the SoundMgr to the   */
/*  sound input component.  Not to be confused with the SPB struct   */
/*  above, which is the param block for a read request from an app   */
/*  to the SoundMgr.                                                 */
typedef struct SndInputCmpParam         SndInputCmpParam;
typedef SndInputCmpParam *              SndInputCmpParamPtr;
typedef CALLBACK_API( void , SICCompletionProcPtr )(SndInputCmpParamPtr SICParmPtr);
struct SndInputCmpParam {
  SICCompletionProcPtr  ioCompletion;         /* completion routine [pointer]*/
  SIInterruptProcPtr  ioInterrupt;            /* interrupt routine [pointer]*/
  OSErr               ioResult;               /* I/O result code [word]*/
  short               pad;
  unsigned long       ioReqCount;
  unsigned long       ioActCount;
  Ptr                 ioBuffer;
  Ptr                 ioMisc;
};

/*
 *  SndInputReadAsync()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( ComponentResult )
SndInputReadAsync(
  ComponentInstance     self,
  SndInputCmpParamPtr   SICParmPtr)                           FIVEWORDINLINE(0x2F3C, 0x0004, 0x0001, 0x7000, 0xA82A);


/*
 *  SndInputReadSync()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( ComponentResult )
SndInputReadSync(
  ComponentInstance     self,
  SndInputCmpParamPtr   SICParmPtr)                           FIVEWORDINLINE(0x2F3C, 0x0004, 0x0002, 0x7000, 0xA82A);


/*
 *  SndInputPauseRecording()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( ComponentResult )
SndInputPauseRecording(ComponentInstance self)                FIVEWORDINLINE(0x2F3C, 0x0000, 0x0003, 0x7000, 0xA82A);


/*
 *  SndInputResumeRecording()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( ComponentResult )
SndInputResumeRecording(ComponentInstance self)               FIVEWORDINLINE(0x2F3C, 0x0000, 0x0004, 0x7000, 0xA82A);


/*
 *  SndInputStopRecording()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( ComponentResult )
SndInputStopRecording(ComponentInstance self)                 FIVEWORDINLINE(0x2F3C, 0x0000, 0x0005, 0x7000, 0xA82A);


/*
 *  SndInputGetStatus()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( ComponentResult )
SndInputGetStatus(
  ComponentInstance   self,
  short *             recordingStatus,
  unsigned long *     totalSamplesToRecord,
  unsigned long *     numberOfSamplesRecorded)                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0006, 0x7000, 0xA82A);


/*
 *  SndInputGetDeviceInfo()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( ComponentResult )
SndInputGetDeviceInfo(
  ComponentInstance   self,
  OSType              infoType,
  void *              infoData)                               FIVEWORDINLINE(0x2F3C, 0x0008, 0x0007, 0x7000, 0xA82A);


/*
 *  SndInputSetDeviceInfo()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( ComponentResult )
SndInputSetDeviceInfo(
  ComponentInstance   self,
  OSType              infoType,
  void *              infoData)                               FIVEWORDINLINE(0x2F3C, 0x0008, 0x0008, 0x7000, 0xA82A);


/*
 *  SndInputInitHardware()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.0 and later
 */
EXTERN_API( ComponentResult )
SndInputInitHardware(ComponentInstance self)                  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0009, 0x7000, 0xA82A);



/* selectors for component calls */
enum {
    kSndInputReadAsyncSelect                   = 0x0001,
    kSndInputReadSyncSelect                    = 0x0002,
    kSndInputPauseRecordingSelect              = 0x0003,
    kSndInputResumeRecordingSelect             = 0x0004,
    kSndInputStopRecordingSelect               = 0x0005,
    kSndInputGetStatusSelect                   = 0x0006,
    kSndInputGetDeviceInfoSelect               = 0x0007,
    kSndInputSetDeviceInfoSelect               = 0x0008,
    kSndInputInitHardwareSelect                = 0x0009
};
#endif  /* !TARGET_OS_MAC || TARGET_API_MAC_CARBON */



#if PRAGMA_STRUCT_ALIGN
    #pragma options align=reset
#elif PRAGMA_STRUCT_PACKPUSH
    #pragma pack(pop)
#elif PRAGMA_STRUCT_PACK
    #pragma pack()
#endif

#ifdef PRAGMA_IMPORT_OFF
#pragma import off
#elif PRAGMA_IMPORT
#pragma import reset
#endif

#ifdef __cplusplus
}
#endif

#endif /* __SOUND__ */