Sound.pas 106 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815
  1. {
  2. File: CarbonSound/Sound.h
  3. Contains: Sound Manager Interfaces.
  4. Version: CarbonSound-115~164
  5. Copyright: © 1986-2008 by Apple Computer, Inc., all rights reserved
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://bugs.freepascal.org
  9. }
  10. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2009 }
  11. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2012 }
  12. {
  13. Modified for use with Free Pascal
  14. Version 308
  15. Please report any bugs to <[email protected]>
  16. }
  17. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  18. {$mode macpas}
  19. {$modeswitch cblocks}
  20. {$packenum 1}
  21. {$macro on}
  22. {$inline on}
  23. {$calling mwpascal}
  24. unit Sound;
  25. interface
  26. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  27. {$setc GAP_INTERFACES_VERSION := $0308}
  28. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  29. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  30. {$endc}
  31. {$ifc defined CPUPOWERPC and defined CPUI386}
  32. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  33. {$endc}
  34. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  35. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  36. {$endc}
  37. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  38. {$setc __ppc__ := 1}
  39. {$elsec}
  40. {$setc __ppc__ := 0}
  41. {$endc}
  42. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  43. {$setc __ppc64__ := 1}
  44. {$elsec}
  45. {$setc __ppc64__ := 0}
  46. {$endc}
  47. {$ifc not defined __i386__ and defined CPUI386}
  48. {$setc __i386__ := 1}
  49. {$elsec}
  50. {$setc __i386__ := 0}
  51. {$endc}
  52. {$ifc not defined __x86_64__ and defined CPUX86_64}
  53. {$setc __x86_64__ := 1}
  54. {$elsec}
  55. {$setc __x86_64__ := 0}
  56. {$endc}
  57. {$ifc not defined __arm__ and defined CPUARM}
  58. {$setc __arm__ := 1}
  59. {$elsec}
  60. {$setc __arm__ := 0}
  61. {$endc}
  62. {$ifc not defined __arm64__ and defined CPUAARCH64}
  63. {$setc __arm64__ := 1}
  64. {$elsec}
  65. {$setc __arm64__ := 0}
  66. {$endc}
  67. {$ifc defined cpu64}
  68. {$setc __LP64__ := 1}
  69. {$elsec}
  70. {$setc __LP64__ := 0}
  71. {$endc}
  72. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  73. {$error Conflicting definitions for __ppc__ and __i386__}
  74. {$endc}
  75. {$ifc defined __ppc__ and __ppc__}
  76. {$setc TARGET_CPU_PPC := TRUE}
  77. {$setc TARGET_CPU_PPC64 := FALSE}
  78. {$setc TARGET_CPU_X86 := FALSE}
  79. {$setc TARGET_CPU_X86_64 := FALSE}
  80. {$setc TARGET_CPU_ARM := FALSE}
  81. {$setc TARGET_CPU_ARM64 := FALSE}
  82. {$setc TARGET_OS_MAC := TRUE}
  83. {$setc TARGET_OS_IPHONE := FALSE}
  84. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  85. {$setc TARGET_OS_EMBEDDED := FALSE}
  86. {$elifc defined __ppc64__ and __ppc64__}
  87. {$setc TARGET_CPU_PPC := FALSE}
  88. {$setc TARGET_CPU_PPC64 := TRUE}
  89. {$setc TARGET_CPU_X86 := FALSE}
  90. {$setc TARGET_CPU_X86_64 := FALSE}
  91. {$setc TARGET_CPU_ARM := FALSE}
  92. {$setc TARGET_CPU_ARM64 := FALSE}
  93. {$setc TARGET_OS_MAC := TRUE}
  94. {$setc TARGET_OS_IPHONE := FALSE}
  95. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  96. {$setc TARGET_OS_EMBEDDED := FALSE}
  97. {$elifc defined __i386__ and __i386__}
  98. {$setc TARGET_CPU_PPC := FALSE}
  99. {$setc TARGET_CPU_PPC64 := FALSE}
  100. {$setc TARGET_CPU_X86 := TRUE}
  101. {$setc TARGET_CPU_X86_64 := FALSE}
  102. {$setc TARGET_CPU_ARM := FALSE}
  103. {$setc TARGET_CPU_ARM64 := FALSE}
  104. {$ifc defined(iphonesim)}
  105. {$setc TARGET_OS_MAC := FALSE}
  106. {$setc TARGET_OS_IPHONE := TRUE}
  107. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  108. {$elsec}
  109. {$setc TARGET_OS_MAC := TRUE}
  110. {$setc TARGET_OS_IPHONE := FALSE}
  111. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  112. {$endc}
  113. {$setc TARGET_OS_EMBEDDED := FALSE}
  114. {$elifc defined __x86_64__ and __x86_64__}
  115. {$setc TARGET_CPU_PPC := FALSE}
  116. {$setc TARGET_CPU_PPC64 := FALSE}
  117. {$setc TARGET_CPU_X86 := FALSE}
  118. {$setc TARGET_CPU_X86_64 := TRUE}
  119. {$setc TARGET_CPU_ARM := FALSE}
  120. {$setc TARGET_CPU_ARM64 := FALSE}
  121. {$ifc defined(iphonesim)}
  122. {$setc TARGET_OS_MAC := FALSE}
  123. {$setc TARGET_OS_IPHONE := TRUE}
  124. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  125. {$elsec}
  126. {$setc TARGET_OS_MAC := TRUE}
  127. {$setc TARGET_OS_IPHONE := FALSE}
  128. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  129. {$endc}
  130. {$setc TARGET_OS_EMBEDDED := FALSE}
  131. {$elifc defined __arm__ and __arm__}
  132. {$setc TARGET_CPU_PPC := FALSE}
  133. {$setc TARGET_CPU_PPC64 := FALSE}
  134. {$setc TARGET_CPU_X86 := FALSE}
  135. {$setc TARGET_CPU_X86_64 := FALSE}
  136. {$setc TARGET_CPU_ARM := TRUE}
  137. {$setc TARGET_CPU_ARM64 := FALSE}
  138. { will require compiler define when/if other Apple devices with ARM cpus ship }
  139. {$setc TARGET_OS_MAC := FALSE}
  140. {$setc TARGET_OS_IPHONE := TRUE}
  141. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  142. {$setc TARGET_OS_EMBEDDED := TRUE}
  143. {$elifc defined __arm64__ and __arm64__}
  144. {$setc TARGET_CPU_PPC := FALSE}
  145. {$setc TARGET_CPU_PPC64 := FALSE}
  146. {$setc TARGET_CPU_X86 := FALSE}
  147. {$setc TARGET_CPU_X86_64 := FALSE}
  148. {$setc TARGET_CPU_ARM := FALSE}
  149. {$setc TARGET_CPU_ARM64 := TRUE}
  150. { will require compiler define when/if other Apple devices with ARM cpus ship }
  151. {$setc TARGET_OS_MAC := FALSE}
  152. {$setc TARGET_OS_IPHONE := TRUE}
  153. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  154. {$setc TARGET_OS_EMBEDDED := TRUE}
  155. {$elsec}
  156. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  157. {$endc}
  158. {$ifc defined __LP64__ and __LP64__ }
  159. {$setc TARGET_CPU_64 := TRUE}
  160. {$elsec}
  161. {$setc TARGET_CPU_64 := FALSE}
  162. {$endc}
  163. {$ifc defined FPC_BIG_ENDIAN}
  164. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  165. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  166. {$elifc defined FPC_LITTLE_ENDIAN}
  167. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  168. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  169. {$elsec}
  170. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  171. {$endc}
  172. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  173. {$setc CALL_NOT_IN_CARBON := FALSE}
  174. {$setc OLDROUTINENAMES := FALSE}
  175. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  176. {$setc OPAQUE_UPP_TYPES := TRUE}
  177. {$setc OTCARBONAPPLICATION := TRUE}
  178. {$setc OTKERNEL := FALSE}
  179. {$setc PM_USE_SESSION_APIS := TRUE}
  180. {$setc TARGET_API_MAC_CARBON := TRUE}
  181. {$setc TARGET_API_MAC_OS8 := FALSE}
  182. {$setc TARGET_API_MAC_OSX := TRUE}
  183. {$setc TARGET_CARBON := TRUE}
  184. {$setc TARGET_CPU_68K := FALSE}
  185. {$setc TARGET_CPU_MIPS := FALSE}
  186. {$setc TARGET_CPU_SPARC := FALSE}
  187. {$setc TARGET_OS_UNIX := FALSE}
  188. {$setc TARGET_OS_WIN32 := FALSE}
  189. {$setc TARGET_RT_MAC_68881 := FALSE}
  190. {$setc TARGET_RT_MAC_CFM := FALSE}
  191. {$setc TARGET_RT_MAC_MACHO := TRUE}
  192. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  193. {$setc TYPE_BOOL := FALSE}
  194. {$setc TYPE_EXTENDED := FALSE}
  195. {$setc TYPE_LONGLONG := TRUE}
  196. uses MacTypes,Components,MixedMode,Dialogs;
  197. {$endc} {not MACOSALLINCLUDE}
  198. {$ifc TARGET_OS_MAC}
  199. {$ALIGN MAC68K}
  200. {$ifc not TARGET_CPU_64}
  201. {
  202. * * * N O T E * * *
  203. This file has been updated to include Sound Manager 3.3 interfaces.
  204. Some of the Sound Manager 3.0 interfaces were not put into the InterfaceLib
  205. that originally shipped with the PowerMacs. These missing functions and the
  206. new 3.3 interfaces have been released in the SoundLib library for PowerPC
  207. developers to link with. The runtime library for these functions are
  208. installed by the Sound Manager. The following functions are found in SoundLib.
  209. GetCompressionInfo(), GetSoundPreference(), SetSoundPreference(),
  210. UnsignedFixedMulDiv(), SndGetInfo(), SndSetInfo(), GetSoundOutputInfo(),
  211. SetSoundOutputInfo(), GetCompressionName(), SoundConverterOpen(),
  212. SoundConverterClose(), SoundConverterGetBufferSizes(), SoundConverterBeginConversion(),
  213. SoundConverterConvertBuffer(), SoundConverterEndConversion(),
  214. AudioGetBass(), AudioGetInfo(), AudioGetMute(), AudioGetOutputDevice(),
  215. AudioGetTreble(), AudioGetVolume(), AudioMuteOnEvent(), AudioSetBass(),
  216. AudioSetMute(), AudioSetToDefaults(), AudioSetTreble(), AudioSetVolume(),
  217. OpenMixerSoundComponent(), CloseMixerSoundComponent(), SoundComponentAddSource(),
  218. SoundComponentGetInfo(), SoundComponentGetSource(), SoundComponentGetSourceData(),
  219. SoundComponentInitOutputDevice(), SoundComponentPauseSource(),
  220. SoundComponentPlaySourceBuffer(), SoundComponentRemoveSource(),
  221. SoundComponentSetInfo(), SoundComponentSetOutput(), SoundComponentSetSource(),
  222. SoundComponentStartSource(), SoundComponentStopSource(),
  223. ParseAIFFHeader(), ParseSndHeader(), SoundConverterGetInfo(), SoundConverterSetInfo()
  224. }
  225. {
  226. Interfaces for Sound Driver, !!! OBSOLETE and NOT SUPPORTED !!!
  227. These items are no longer defined, but appear here so that someone
  228. searching the interfaces might find them. If you are using one of these
  229. items, you must change your code to support the Sound Manager.
  230. swMode, ftMode, ffMode
  231. FreeWave, FFSynthRec, Tone, SWSynthRec, Wave, FTSoundRec
  232. SndCompletionProcPtr
  233. StartSound, StopSound, SoundDone
  234. SetSoundVol, GetSoundVol
  235. }
  236. {
  237. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  238. constants
  239. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  240. }
  241. const
  242. twelfthRootTwo = 1.05946309435;
  243. const
  244. soundListRsrc = FourCharCode('snd '); {Resource type used by Sound Manager}
  245. kSoundCodecInfoResourceType = FourCharCode('snfo'); {Resource type holding codec information (optional public component resource)}
  246. const
  247. kSimpleBeepID = 1; {reserved resource ID for Simple Beep}
  248. const
  249. rate48khz = $BB800000; {48000.00000 in fixed-point}
  250. rate44khz = $AC440000; {44100.00000 in fixed-point}
  251. rate32khz = $7D000000; {32000.00000 in fixed-point}
  252. rate22050hz = $56220000; {22050.00000 in fixed-point}
  253. rate22khz = $56EE8BA3; {22254.54545 in fixed-point}
  254. rate16khz = $3E800000; {16000.00000 in fixed-point}
  255. rate11khz = $2B7745D1; {11127.27273 in fixed-point}
  256. rate11025hz = $2B110000; {11025.00000 in fixed-point}
  257. rate8khz = $1F400000; { 8000.00000 in fixed-point}
  258. {synthesizer numbers for SndNewChannel}
  259. const
  260. sampledSynth = 5; {sampled sound synthesizer}
  261. {$ifc CALL_NOT_IN_CARBON}
  262. const
  263. squareWaveSynth = 1; {square wave synthesizer}
  264. waveTableSynth = 3; {wave table synthesizer}
  265. {old Sound Manager MACE synthesizer numbers}
  266. MACE3snthID = 11;
  267. MACE6snthID = 13;
  268. {$endc} {CALL_NOT_IN_CARBON}
  269. const
  270. kMiddleC = 60; {MIDI note value for middle C}
  271. const
  272. kNoVolume = 0; {setting for no sound volume}
  273. kFullVolume = $0100; {1.0, setting for full hardware output volume}
  274. const
  275. stdQLength = 128;
  276. const
  277. dataOffsetFlag = $8000;
  278. const
  279. kUseOptionalOutputDevice = -1; {only for Sound Manager 3.0 or later}
  280. const
  281. notCompressed = 0; {compression ID's}
  282. fixedCompression = -1; {compression ID for fixed-sized compression}
  283. variableCompression = -2; {compression ID for variable-sized compression}
  284. const
  285. twoToOne = 1;
  286. eightToThree = 2;
  287. threeToOne = 3;
  288. sixToOne = 4;
  289. sixToOnePacketSize = 8;
  290. threeToOnePacketSize = 16;
  291. const
  292. stateBlockSize = 64;
  293. leftOverBlockSize = 32;
  294. const
  295. firstSoundFormat = $0001; {general sound format}
  296. secondSoundFormat = $0002; {special sampled sound format (HyperCard)}
  297. {$ifc CALL_NOT_IN_CARBON}
  298. const
  299. dbBufferReady = $00000001; {double buffer is filled}
  300. dbLastBuffer = $00000004; {last double buffer to play}
  301. {$endc} {CALL_NOT_IN_CARBON}
  302. const
  303. sysBeepDisable = $0000; {SysBeep() enable flags}
  304. sysBeepEnable = 1 shl 0;
  305. sysBeepSynchronous = 1 shl 1; {if bit set, make alert sounds synchronous}
  306. const
  307. unitTypeNoSelection = $FFFF; {unitTypes for AudioSelection.unitType}
  308. unitTypeSeconds = $0000;
  309. const
  310. stdSH = $00; {Standard sound header encode value}
  311. extSH = $FF; {Extended sound header encode value}
  312. cmpSH = $FE; {Compressed sound header encode value}
  313. {command numbers for SndDoCommand and SndDoImmediate}
  314. const
  315. nullCmd = 0;
  316. quietCmd = 3;
  317. flushCmd = 4;
  318. reInitCmd = 5;
  319. waitCmd = 10;
  320. pauseCmd = 11;
  321. resumeCmd = 12;
  322. callBackCmd = 13;
  323. syncCmd = 14;
  324. availableCmd = 24;
  325. versionCmd = 25;
  326. volumeCmd = 46; {sound manager 3.0 or later only}
  327. getVolumeCmd = 47; {sound manager 3.0 or later only}
  328. clockComponentCmd = 50; {sound manager 3.2.1 or later only}
  329. getClockComponentCmd = 51; {sound manager 3.2.1 or later only}
  330. scheduledSoundCmd = 52; {sound manager 3.3 or later only}
  331. linkSoundComponentsCmd = 53; {sound manager 3.3 or later only}
  332. soundCmd = 80;
  333. bufferCmd = 81;
  334. rateMultiplierCmd = 86;
  335. getRateMultiplierCmd = 87;
  336. {$ifc CALL_NOT_IN_CARBON}
  337. {command numbers for SndDoCommand and SndDoImmediate that are not available for use in Carbon }
  338. const
  339. initCmd = 1;
  340. freeCmd = 2;
  341. totalLoadCmd = 26;
  342. loadCmd = 27;
  343. freqDurationCmd = 40;
  344. restCmd = 41;
  345. freqCmd = 42;
  346. ampCmd = 43;
  347. timbreCmd = 44;
  348. getAmpCmd = 45;
  349. waveTableCmd = 60;
  350. phaseCmd = 61;
  351. rateCmd = 82;
  352. continueCmd = 83;
  353. doubleBufferCmd = 84;
  354. getRateCmd = 85;
  355. sizeCmd = 90; {obsolete command}
  356. convertCmd = 91; {obsolete MACE command}
  357. {$endc} {CALL_NOT_IN_CARBON}
  358. {$ifc OLDROUTINENAMES}
  359. {channel initialization parameters}
  360. const
  361. waveInitChannelMask = $07;
  362. waveInitChannel0 = $04; {wave table only, Sound Manager 2.0 and earlier}
  363. waveInitChannel1 = $05; {wave table only, Sound Manager 2.0 and earlier}
  364. waveInitChannel2 = $06; {wave table only, Sound Manager 2.0 and earlier}
  365. waveInitChannel3 = $07; {wave table only, Sound Manager 2.0 and earlier}
  366. initChan0 = waveInitChannel0; {obsolete spelling}
  367. initChan1 = waveInitChannel1; {obsolete spelling}
  368. initChan2 = waveInitChannel2; {obsolete spelling}
  369. initChan3 = waveInitChannel3; {obsolete spelling}
  370. const
  371. outsideCmpSH = 0; {obsolete MACE constant}
  372. insideCmpSH = 1; {obsolete MACE constant}
  373. aceSuccess = 0; {obsolete MACE constant}
  374. aceMemFull = 1; {obsolete MACE constant}
  375. aceNilBlock = 2; {obsolete MACE constant}
  376. aceBadComp = 3; {obsolete MACE constant}
  377. aceBadEncode = 4; {obsolete MACE constant}
  378. aceBadDest = 5; {obsolete MACE constant}
  379. aceBadCmd = 6; {obsolete MACE constant}
  380. {$endc} {OLDROUTINENAMES}
  381. const
  382. initChanLeft = $0002; {left stereo channel}
  383. initChanRight = $0003; {right stereo channel}
  384. initNoInterp = $0004; {no linear interpolation}
  385. initNoDrop = $0008; {no drop-sample conversion}
  386. initMono = $0080; {monophonic channel}
  387. initStereo = $00C0; {stereo channel}
  388. initMACE3 = $0300; {MACE 3:1}
  389. initMACE6 = $0400; {MACE 6:1}
  390. initPanMask = $0003; {mask for right/left pan values}
  391. initSRateMask = $0030; {mask for sample rate values}
  392. initStereoMask = $00C0; {mask for mono/stereo values}
  393. initCompMask = $FF00; {mask for compression IDs}
  394. {Get&Set Sound Information Selectors}
  395. const
  396. siActiveChannels = FourCharCode('chac'); {active channels}
  397. siActiveLevels = FourCharCode('lmac'); {active meter levels}
  398. siAGCOnOff = FourCharCode('agc '); {automatic gain control state}
  399. siAsync = FourCharCode('asyn'); {asynchronous capability}
  400. siAVDisplayBehavior = FourCharCode('avdb');
  401. siChannelAvailable = FourCharCode('chav'); {number of channels available}
  402. siCompressionAvailable = FourCharCode('cmav'); {compression types available}
  403. siCompressionFactor = FourCharCode('cmfa'); {current compression factor}
  404. siCompressionHeader = FourCharCode('cmhd'); {return compression header}
  405. siCompressionNames = FourCharCode('cnam'); {compression type names available}
  406. siCompressionParams = FourCharCode('evaw'); {compression parameters}
  407. siCompressionSampleRate = FourCharCode('cprt'); { SetInfo only: compressor's sample rate}
  408. siCompressionChannels = FourCharCode('cpct'); { SetInfo only: compressor's number of channels}
  409. siCompressionOutputSampleRate = FourCharCode('cort'); { GetInfo only: only implemented by compressors that have differing in and out rates }
  410. siCompressionInputRateList = FourCharCode('crtl'); { GetInfo only: only implemented by compressors that only take certain input rates }
  411. siCompressionType = FourCharCode('comp'); {current compression type}
  412. siCompressionConfiguration = FourCharCode('ccfg'); {compression extensions}
  413. siContinuous = FourCharCode('cont'); {continous recording}
  414. siDecompressionParams = FourCharCode('wave'); {decompression parameters}
  415. siDecompressionConfiguration = FourCharCode('dcfg'); {decompression extensions}
  416. siDeviceBufferInfo = FourCharCode('dbin'); {size of interrupt buffer}
  417. siDeviceConnected = FourCharCode('dcon'); {input device connection status}
  418. siDeviceIcon = FourCharCode('icon'); {input device icon}
  419. siDeviceName = FourCharCode('name'); {input device name}
  420. siEQSpectrumBands = FourCharCode('eqsb'); { number of spectrum bands}
  421. siEQSpectrumLevels = FourCharCode('eqlv'); { gets spectum meter levels}
  422. siEQSpectrumOnOff = FourCharCode('eqlo'); { turn on/off spectum meter levels}
  423. siEQSpectrumResolution = FourCharCode('eqrs'); { set the resolution of the FFT, 0 = low res (<=16 bands), 1 = high res (16-64 bands)}
  424. siEQToneControlGain = FourCharCode('eqtg'); { set the bass and treble gain}
  425. siEQToneControlOnOff = FourCharCode('eqtc'); { turn on equalizer attenuation}
  426. siHardwareBalance = FourCharCode('hbal');
  427. siHardwareBalanceSteps = FourCharCode('hbls');
  428. siHardwareBass = FourCharCode('hbas');
  429. siHardwareBassSteps = FourCharCode('hbst');
  430. siHardwareBusy = FourCharCode('hwbs'); {sound hardware is in use}
  431. siHardwareFormat = FourCharCode('hwfm'); {get hardware format}
  432. siHardwareMute = FourCharCode('hmut'); {mute state of all hardware}
  433. siHardwareMuteNoPrefs = FourCharCode('hmnp'); {mute state of all hardware, but don't store in prefs }
  434. siHardwareTreble = FourCharCode('htrb');
  435. siHardwareTrebleSteps = FourCharCode('hwts');
  436. siHardwareVolume = FourCharCode('hvol'); {volume level of all hardware}
  437. siHardwareVolumeSteps = FourCharCode('hstp'); {number of volume steps for hardware}
  438. siHeadphoneMute = FourCharCode('pmut'); {mute state of headphones}
  439. siHeadphoneVolume = FourCharCode('pvol'); {volume level of headphones}
  440. siHeadphoneVolumeSteps = FourCharCode('hdst'); {number of volume steps for headphones}
  441. siInputAvailable = FourCharCode('inav'); {input sources available}
  442. siInputGain = FourCharCode('gain'); {input gain}
  443. siInputSource = FourCharCode('sour'); {input source selector}
  444. siInputSourceNames = FourCharCode('snam'); {input source names}
  445. siLevelMeterOnOff = FourCharCode('lmet'); {level meter state}
  446. siModemGain = FourCharCode('mgai'); {modem input gain}
  447. siMonitorAvailable = FourCharCode('mnav');
  448. siMonitorSource = FourCharCode('mons');
  449. siNumberChannels = FourCharCode('chan'); {current number of channels}
  450. siOptionsDialog = FourCharCode('optd'); {display options dialog}
  451. siOSTypeInputSource = FourCharCode('inpt'); {input source by OSType}
  452. siOSTypeInputAvailable = FourCharCode('inav'); {list of available input source OSTypes}
  453. siOutputDeviceName = FourCharCode('onam'); {output device name}
  454. siPlayThruOnOff = FourCharCode('plth'); {playthrough state}
  455. siPostMixerSoundComponent = FourCharCode('psmx'); {install post-mixer effect}
  456. siPreMixerSoundComponent = FourCharCode('prmx'); {install pre-mixer effect}
  457. siQuality = FourCharCode('qual'); {quality setting}
  458. siRateMultiplier = FourCharCode('rmul'); {throttle rate setting}
  459. siRecordingQuality = FourCharCode('qual'); {recording quality}
  460. siSampleRate = FourCharCode('srat'); {current sample rate}
  461. siSampleRateAvailable = FourCharCode('srav'); {sample rates available}
  462. siSampleSize = FourCharCode('ssiz'); {current sample size}
  463. siSampleSizeAvailable = FourCharCode('ssav'); {sample sizes available}
  464. siSetupCDAudio = FourCharCode('sucd'); {setup sound hardware for CD audio}
  465. siSetupModemAudio = FourCharCode('sumd'); {setup sound hardware for modem audio}
  466. siSlopeAndIntercept = FourCharCode('flap'); {floating point variables for conversion}
  467. siSoundClock = FourCharCode('sclk');
  468. siUseThisSoundClock = FourCharCode('sclc'); {sdev uses this to tell the mixer to use his sound clock}
  469. siSpeakerMute = FourCharCode('smut'); {mute state of all built-in speaker}
  470. siSpeakerVolume = FourCharCode('svol'); {volume level of built-in speaker}
  471. siSSpCPULoadLimit = FourCharCode('3dll');
  472. siSSpLocalization = FourCharCode('3dif');
  473. siSSpSpeakerSetup = FourCharCode('3dst');
  474. siStereoInputGain = FourCharCode('sgai'); {stereo input gain}
  475. siSubwooferMute = FourCharCode('bmut'); {mute state of sub-woofer}
  476. siTerminalType = FourCharCode('ttyp'); { usb terminal type }
  477. siTwosComplementOnOff = FourCharCode('twos'); {two's complement state}
  478. siVendorProduct = FourCharCode('vpro'); { vendor and product ID }
  479. siVolume = FourCharCode('volu'); {volume level of source}
  480. siVoxRecordInfo = FourCharCode('voxr'); {VOX record parameters}
  481. siVoxStopInfo = FourCharCode('voxs'); {VOX stop parameters}
  482. siWideStereo = FourCharCode('wide'); {wide stereo setting}
  483. siSupportedExtendedFlags = FourCharCode('exfl'); {which flags are supported in Extended sound data structures}
  484. siRateConverterRollOffSlope = FourCharCode('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)}
  485. siOutputLatency = FourCharCode('olte'); {latency of sound output component}
  486. siHALAudioDeviceID = FourCharCode('hlid'); {audio device id}
  487. siHALAudioDeviceUniqueID = FourCharCode('huid'); {audio device unique id}
  488. siClientAcceptsVBR = FourCharCode('cvbr'); {client handles VBR}
  489. siSourceIsExhausted = FourCharCode('srcx'); {the ultimate source of data has run out (keep asking, but when you get nothing, that's it)}
  490. siMediaContextID = FourCharCode('uuid'); {media context id -- UUID }
  491. siCompressionMaxPacketSize = FourCharCode('cmxp'); {maximum compressed packet size for current configuration -- unsigned long }
  492. siAudioCodecPropertyValue = FourCharCode('spva'); {audio codec property value -- SoundAudioCodecPropertyRequestParams* }
  493. siAudioCodecPropertyInfo = FourCharCode('spin'); {audio codec property info -- SoundAudioCodecPropertyRequestParams* }
  494. const
  495. siCloseDriver = FourCharCode('clos'); {reserved for internal use only}
  496. siInitializeDriver = FourCharCode('init'); {reserved for internal use only}
  497. siPauseRecording = FourCharCode('paus'); {reserved for internal use only}
  498. siUserInterruptProc = FourCharCode('user'); {reserved for internal use only}
  499. { input source Types}
  500. const
  501. kInvalidSource = -1; {this source may be returned from GetInfo if no other source is the monitored source}
  502. kNoSource = FourCharCode('none'); {no source selection}
  503. kCDSource = FourCharCode('cd '); {internal CD player input}
  504. kExtMicSource = FourCharCode('emic'); {external mic input}
  505. kSoundInSource = FourCharCode('sinj'); {sound input jack}
  506. kRCAInSource = FourCharCode('irca'); {RCA jack input}
  507. kTVFMTunerSource = FourCharCode('tvfm');
  508. kDAVInSource = FourCharCode('idav'); {DAV analog input}
  509. kIntMicSource = FourCharCode('imic'); {internal mic input}
  510. kMediaBaySource = FourCharCode('mbay'); {media bay input}
  511. kModemSource = FourCharCode('modm'); {modem input (internal modem on desktops, PCI input on PowerBooks)}
  512. kPCCardSource = FourCharCode('pcm '); {PC Card pwm input}
  513. kZoomVideoSource = FourCharCode('zvpc'); {zoom video input}
  514. kDVDSource = FourCharCode('dvda'); { DVD audio input}
  515. kMicrophoneArray = FourCharCode('mica'); { microphone array}
  516. {Sound Component Types and Subtypes}
  517. const
  518. kNoSoundComponentType = FourCharCode('****');
  519. kSoundComponentType = FourCharCode('sift'); {component type}
  520. kSoundComponentPPCType = FourCharCode('nift'); {component type for PowerPC code}
  521. kRate8SubType = FourCharCode('ratb'); {8-bit rate converter}
  522. kRate16SubType = FourCharCode('ratw'); {16-bit rate converter}
  523. kConverterSubType = FourCharCode('conv'); {sample format converter}
  524. kSndSourceSubType = FourCharCode('sour'); {generic source component}
  525. kMixerType = FourCharCode('mixr');
  526. kMixer8SubType = FourCharCode('mixb'); {8-bit mixer}
  527. kMixer16SubType = FourCharCode('mixw'); {16-bit mixer}
  528. kSoundInputDeviceType = FourCharCode('sinp'); {sound input component}
  529. kWaveInSubType = FourCharCode('wavi'); {Windows waveIn}
  530. kWaveInSnifferSubType = FourCharCode('wisn'); {Windows waveIn sniffer}
  531. kSoundOutputDeviceType = FourCharCode('sdev'); {sound output component}
  532. kClassicSubType = FourCharCode('clas'); {classic hardware, i.e. Mac Plus}
  533. kASCSubType = FourCharCode('asc '); {Apple Sound Chip device}
  534. kDSPSubType = FourCharCode('dsp '); {DSP device}
  535. kAwacsSubType = FourCharCode('awac'); {Another of Will's Audio Chips device}
  536. kGCAwacsSubType = FourCharCode('awgc'); {Awacs audio with Grand Central DMA}
  537. kSingerSubType = FourCharCode('sing'); {Singer (via Whitney) based sound}
  538. kSinger2SubType = FourCharCode('sng2'); {Singer 2 (via Whitney) for Acme}
  539. kWhitSubType = FourCharCode('whit'); {Whit sound component for PrimeTime 3}
  540. kSoundBlasterSubType = FourCharCode('sbls'); {Sound Blaster for CHRP}
  541. kWaveOutSubType = FourCharCode('wavo'); {Windows waveOut}
  542. kWaveOutSnifferSubType = FourCharCode('wosn'); {Windows waveOut sniffer}
  543. kDirectSoundSubType = FourCharCode('dsnd'); {Windows DirectSound}
  544. kDirectSoundSnifferSubType = FourCharCode('dssn'); {Windows DirectSound sniffer}
  545. kUNIXsdevSubType = FourCharCode('un1x'); {UNIX base sdev}
  546. kUSBSubType = FourCharCode('usb '); {USB device}
  547. kBlueBoxSubType = FourCharCode('bsnd'); {Blue Box sound component}
  548. kHALCustomComponentSubType = FourCharCode('halx'); {Registered by the HAL output component ('hal!') for each HAL output device}
  549. kSoundCompressor = FourCharCode('scom');
  550. kSoundDecompressor = FourCharCode('sdec');
  551. kAudioComponentType = FourCharCode('adio'); {Audio components and sub-types}
  552. kAwacsPhoneSubType = FourCharCode('hphn');
  553. kAudioVisionSpeakerSubType = FourCharCode('telc');
  554. kAudioVisionHeadphoneSubType = FourCharCode('telh');
  555. kPhilipsFaderSubType = FourCharCode('tvav');
  556. kSGSToneSubType = FourCharCode('sgs0');
  557. kSoundEffectsType = FourCharCode('snfx'); {sound effects type}
  558. kEqualizerSubType = FourCharCode('eqal'); {frequency equalizer}
  559. kSSpLocalizationSubType = FourCharCode('snd3');
  560. {Format Types}
  561. const
  562. kSoundNotCompressed = FourCharCode('NONE'); {sound is not compressed}
  563. k8BitOffsetBinaryFormat = FourCharCode('raw '); {8-bit offset binary}
  564. k16BitBigEndianFormat = FourCharCode('twos'); {16-bit big endian}
  565. k16BitLittleEndianFormat = FourCharCode('sowt'); {16-bit little endian}
  566. kFloat32Format = FourCharCode('fl32'); {32-bit floating point}
  567. kFloat64Format = FourCharCode('fl64'); {64-bit floating point}
  568. k24BitFormat = FourCharCode('in24'); {24-bit integer}
  569. k32BitFormat = FourCharCode('in32'); {32-bit integer}
  570. k32BitLittleEndianFormat = FourCharCode('23ni'); {32-bit little endian integer }
  571. kMACE3Compression = FourCharCode('MAC3'); {MACE 3:1}
  572. kMACE6Compression = FourCharCode('MAC6'); {MACE 6:1}
  573. kCDXA4Compression = FourCharCode('cdx4'); {CD/XA 4:1}
  574. kCDXA2Compression = FourCharCode('cdx2'); {CD/XA 2:1}
  575. kIMACompression = FourCharCode('ima4'); {IMA 4:1}
  576. kULawCompression = FourCharCode('ulaw'); {µLaw 2:1}
  577. kALawCompression = FourCharCode('alaw'); {aLaw 2:1}
  578. kMicrosoftADPCMFormat = $6D730002; {Microsoft ADPCM - ACM code 2}
  579. kDVIIntelIMAFormat = $6D730011; {DVI/Intel IMA ADPCM - ACM code 17}
  580. kMicrosoftGSMCompression = $6D730031; {Microsoft GSM 6.10 - ACM code 49}
  581. kDVAudioFormat = FourCharCode('dvca'); {DV Audio}
  582. kQDesignCompression = FourCharCode('QDMC'); {QDesign music}
  583. kQDesign2Compression = FourCharCode('QDM2'); {QDesign2 music}
  584. kQUALCOMMCompression = FourCharCode('Qclp'); {QUALCOMM PureVoice}
  585. kOffsetBinary = k8BitOffsetBinaryFormat; {for compatibility}
  586. kTwosComplement = k16BitBigEndianFormat; {for compatibility}
  587. kLittleEndianFormat = k16BitLittleEndianFormat; {for compatibility}
  588. kMPEGLayer3Format = $6D730055; {MPEG Layer 3, CBR only (pre QT4.1)}
  589. kFullMPEGLay3Format = FourCharCode('.mp3'); {MPEG Layer 3, CBR & VBR (QT4.1 and later)}
  590. kVariableDurationDVAudioFormat = FourCharCode('vdva'); {Variable Duration DV Audio}
  591. kMPEG4AudioFormat = FourCharCode('mp4a');
  592. {$ifc TARGET_RT_LITTLE_ENDIAN}
  593. const
  594. k16BitNativeEndianFormat = k16BitLittleEndianFormat;
  595. k16BitNonNativeEndianFormat = k16BitBigEndianFormat;
  596. {$elsec}
  597. const
  598. k16BitNativeEndianFormat = k16BitBigEndianFormat;
  599. k16BitNonNativeEndianFormat = k16BitLittleEndianFormat;
  600. {$endc} {TARGET_RT_LITTLE_ENDIAN}
  601. {Features Flags}
  602. const
  603. k8BitRawIn = 1 shl 0; {data description}
  604. k8BitTwosIn = 1 shl 1;
  605. k16BitIn = 1 shl 2;
  606. kStereoIn = 1 shl 3;
  607. k8BitRawOut = 1 shl 8;
  608. k8BitTwosOut = 1 shl 9;
  609. k16BitOut = 1 shl 10;
  610. kStereoOut = 1 shl 11;
  611. kReverse = 1 shl 16; { function description}
  612. kRateConvert = 1 shl 17;
  613. kCreateSoundSource = 1 shl 18;
  614. kVMAwareness = 1 shl 21; { component will hold its memory}
  615. kHighQuality = 1 shl 22; { performance description}
  616. kNonRealTime = 1 shl 23;
  617. {'snfo' Resource Feature Flags}
  618. const
  619. kSoundCodecInfoFixedCompression = 1 shl 0; { has fixed compression format}
  620. kSoundCodecInfoVariableCompression = 1 shl 1; { has variable compression format}
  621. kSoundCodecInfoHasRestrictedInputRates = 1 shl 2; { compressor has restricted set of input sample rates}
  622. kSoundCodecInfoCanChangeOutputRate = 1 shl 3; { compressor may output a different sample rate than it receives}
  623. kSoundCodecInfoRequiresExternalFraming = 1 shl 4; { format requires external framing information during decode/encode}
  624. kSoundCodecInfoVariableDuration = 1 shl 5; { audio packets can vary in duration}
  625. {SoundComponentPlaySourceBuffer action flags}
  626. const
  627. kSourcePaused = 1 shl 0;
  628. kPassThrough = 1 shl 16;
  629. kNoSoundComponentChain = 1 shl 17;
  630. {SoundParamBlock flags, usefull for OpenMixerSoundComponent}
  631. const
  632. kNoMixing = 1 shl 0; {don't mix source}
  633. kNoSampleRateConversion = 1 shl 1; {don't convert sample rate (i.e. 11 kHz -> 22 kHz)}
  634. kNoSampleSizeConversion = 1 shl 2; {don't convert sample size (i.e. 16 -> 8)}
  635. kNoSampleFormatConversion = 1 shl 3; {don't convert sample format (i.e. 'twos' -> 'raw ')}
  636. kNoChannelConversion = 1 shl 4; {don't convert stereo/mono}
  637. kNoDecompression = 1 shl 5; {don't decompress (i.e. 'MAC3' -> 'raw ')}
  638. kNoVolumeConversion = 1 shl 6; {don't apply volume}
  639. kNoRealtimeProcessing = 1 shl 7; {won't run at interrupt time}
  640. kScheduledSource = 1 shl 8; {source is scheduled}
  641. kNonInterleavedBuffer = 1 shl 9; {buffer is not interleaved samples}
  642. kNonPagingMixer = 1 shl 10; {if VM is on, use the non-paging mixer}
  643. kSoundConverterMixer = 1 shl 11; {the mixer is to be used by the SoundConverter}
  644. kPagingMixer = 1 shl 12; {the mixer is to be used as a paging mixer when VM is on}
  645. kVMAwareMixer = 1 shl 13; {passed to the output device when the SM is going to deal with VM safety}
  646. kExtendedSoundData = 1 shl 14; {SoundComponentData record is actually an ExtendedSoundComponentData}
  647. {SoundParamBlock quality settings}
  648. const
  649. kBestQuality = 1 shl 0; {use interpolation in rate conversion}
  650. {useful bit masks}
  651. const
  652. kInputMask = $000000FF; {masks off input bits}
  653. kOutputMask = $0000FF00; {masks off output bits}
  654. kOutputShift = 8; {amount output bits are shifted}
  655. kActionMask = $00FF0000; {masks off action bits}
  656. kSoundComponentBits = $00FFFFFF;
  657. {audio atom types}
  658. const
  659. kAudioFormatAtomType = FourCharCode('frma');
  660. kAudioEndianAtomType = FourCharCode('enda');
  661. kAudioVBRAtomType = FourCharCode('vbra');
  662. kAudioTerminatorAtomType = 0;
  663. {siAVDisplayBehavior types}
  664. const
  665. kAVDisplayHeadphoneRemove = 0; { monitor does not have a headphone attached}
  666. kAVDisplayHeadphoneInsert = 1; { monitor has a headphone attached}
  667. kAVDisplayPlainTalkRemove = 2; { monitor either sending no input through CPU input port or unable to tell if input is coming in}
  668. kAVDisplayPlainTalkInsert = 3; { monitor sending PlainTalk level microphone source input through sound input port}
  669. {Audio Component constants}
  670. const
  671. {Values for whichChannel parameter}
  672. audioAllChannels = 0; {All channels (usually interpreted as both left and right)}
  673. audioLeftChannel = 1; {Left channel}
  674. audioRightChannel = 2; {Right channel}
  675. {Values for mute parameter}
  676. audioUnmuted = 0; {Device is unmuted}
  677. audioMuted = 1; {Device is muted}
  678. {Capabilities flags definitions}
  679. audioDoesMono = 1 shl 0; {Device supports mono output}
  680. audioDoesStereo = 1 shl 1; {Device supports stereo output}
  681. audioDoesIndependentChannels = 1 shl 2; {Device supports independent software control of each channel}
  682. {Sound Input Qualities}
  683. const
  684. siCDQuality = FourCharCode('cd '); {44.1kHz, stereo, 16 bit}
  685. siBestQuality = FourCharCode('best'); {22kHz, mono, 8 bit}
  686. siBetterQuality = FourCharCode('betr'); {22kHz, mono, MACE 3:1}
  687. siGoodQuality = FourCharCode('good'); {22kHz, mono, MACE 6:1}
  688. siNoneQuality = FourCharCode('none'); {settings don't match any quality for a get call}
  689. const
  690. siDeviceIsConnected = 1; {input device is connected and ready for input}
  691. siDeviceNotConnected = 0; {input device is not connected}
  692. siDontKnowIfConnected = -1; {can't tell if input device is connected}
  693. siReadPermission = 0; {permission passed to SPBOpenDevice}
  694. siWritePermission = 1; {permission passed to SPBOpenDevice}
  695. {flags that SoundConverterFillBuffer will return}
  696. const
  697. kSoundConverterDidntFillBuffer = 1 shl 0; {set if the converter couldn't completely satisfy a SoundConverterFillBuffer request}
  698. kSoundConverterHasLeftOverData = 1 shl 1; {set if the converter had left over data after completely satisfying a SoundConverterFillBuffer call}
  699. { flags for extendedFlags fields of ExtendedSoundComponentData, ExtendedSoundParamBlock, and ExtendedScheduledSoundHeader}
  700. const
  701. kExtendedSoundSampleCountNotValid = 1 shl 0; { set if sampleCount of SoundComponentData isn't meaningful; use buffer size instead}
  702. kExtendedSoundBufferSizeValid = 1 shl 1; { set if bufferSize field is valid}
  703. kExtendedSoundFrameSizesValid = 1 shl 2; { set if frameSizesArray is valid (will be nil if all sizes are common and kExtendedSoundCommonFrameSizeValid is set}
  704. kExtendedSoundCommonFrameSizeValid = 1 shl 3; { set if all audio frames have the same size and the commonFrameSize field is valid}
  705. kExtendedSoundExtensionsValid = 1 shl 4; { set if pointer to extensions array is valid}
  706. kExtendedSoundBufferFlagsValid = 1 shl 5; { set if buffer flags field is valid}
  707. { flags passed in bufferFlags/bufferFlagsMask extended fields if kExtendedSoundBufferFlagsValid extended flag is set}
  708. const
  709. kExtendedSoundBufferIsDiscontinuous = 1 shl 0; { buffer is discontinuous with previous buffer}
  710. kExtendedSoundBufferIsFirstBuffer = 1 shl 1; { buffer is first buffer}
  711. {
  712. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  713. typedefs
  714. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  715. }
  716. type
  717. SndCommandPtr = ^SndCommand;
  718. SndCommand = record
  719. cmd: UInt16;
  720. param1: SInt16;
  721. param2: SIGNEDLONG;
  722. end;
  723. type
  724. SndChannelPtr = ^SndChannel;
  725. SndCallBackProcPtr = procedure( chan: SndChannelPtr; var cmd: SndCommand );
  726. SndCallBackUPP = SndCallBackProcPtr;
  727. SndChannel = record
  728. nextChan: SndChannelPtr;
  729. firstMod: Ptr; { reserved for the Sound Manager }
  730. callBack: SndCallBackUPP;
  731. userInfo: SIGNEDLONG;
  732. wait: SIGNEDLONG; { The following is for internal Sound Manager use only.}
  733. cmdInProgress: SndCommand;
  734. flags: SInt16;
  735. qLength: SInt16;
  736. qHead: SInt16;
  737. qTail: SInt16;
  738. queue: array [0..127] of SndCommand;
  739. end;
  740. {
  741. * NewSndCallBackUPP()
  742. *
  743. * Availability:
  744. * Mac OS X: in version 10.0 and later in Carbon.framework
  745. * CarbonLib: in CarbonLib 1.0 and later
  746. * Non-Carbon CFM: available as macro/inline
  747. }
  748. function NewSndCallBackUPP( userRoutine: SndCallBackProcPtr ): SndCallBackUPP; external name '_NewSndCallBackUPP';
  749. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  750. {
  751. * DisposeSndCallBackUPP()
  752. *
  753. * Availability:
  754. * Mac OS X: in version 10.0 and later in Carbon.framework
  755. * CarbonLib: in CarbonLib 1.0 and later
  756. * Non-Carbon CFM: available as macro/inline
  757. }
  758. procedure DisposeSndCallBackUPP( userUPP: SndCallBackUPP ); external name '_DisposeSndCallBackUPP';
  759. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  760. {
  761. * InvokeSndCallBackUPP()
  762. *
  763. * Availability:
  764. * Mac OS X: in version 10.0 and later in Carbon.framework
  765. * CarbonLib: in CarbonLib 1.0 and later
  766. * Non-Carbon CFM: available as macro/inline
  767. }
  768. procedure InvokeSndCallBackUPP( chan: SndChannelPtr; var cmd: SndCommand; userUPP: SndCallBackUPP ); external name '_InvokeSndCallBackUPP';
  769. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  770. {MACE structures}
  771. type
  772. StateBlock = record
  773. stateVar: array [0..63] of SInt16;
  774. end;
  775. StateBlockPtr = ^StateBlock;
  776. type
  777. LeftOverBlock = record
  778. count: UNSIGNEDLONG;
  779. sampleArea: array [0..31] of SInt8;
  780. end;
  781. LeftOverBlockPtr = ^LeftOverBlock;
  782. type
  783. ModRef = record
  784. modNumber: UInt16;
  785. modInit: SIGNEDLONG;
  786. end;
  787. type
  788. SndListResourcePtr = ^SndListResource;
  789. SndListResource = record
  790. format: SInt16;
  791. numModifiers: SInt16;
  792. modifierPart: array [0..0] of ModRef;
  793. numCommands: SInt16;
  794. commandPart: array [0..0] of SndCommand;
  795. dataPart: UInt8;
  796. end;
  797. type
  798. SndListPtr = SndListResourcePtr;
  799. SndListHandle = ^SndListPtr;
  800. SndListHndl = SndListHandle;
  801. {HyperCard sound resource format}
  802. type
  803. Snd2ListResourcePtr = ^Snd2ListResource;
  804. Snd2ListResource = record
  805. format: SInt16;
  806. refCount: SInt16;
  807. numCommands: SInt16;
  808. commandPart: array [0..0] of SndCommand;
  809. dataPart: UInt8;
  810. end;
  811. type
  812. Snd2ListPtr = Snd2ListResourcePtr;
  813. Snd2ListHandle = ^Snd2ListPtr;
  814. Snd2ListHndl = Snd2ListHandle;
  815. SoundHeader = record
  816. samplePtr: Ptr; {if NIL then samples are in sampleArea}
  817. length: UNSIGNEDLONG; {length of sound in bytes}
  818. sampleRate: UnsignedFixed; {sample rate for this sound}
  819. loopStart: UNSIGNEDLONG; {start of looping portion}
  820. loopEnd: UNSIGNEDLONG; {end of looping portion}
  821. encode: UInt8; {header encoding}
  822. baseFrequency: UInt8; {baseFrequency value}
  823. sampleArea: array [0..0] of UInt8; {space for when samples follow directly}
  824. pad: UInt8;
  825. end;
  826. SoundHeaderPtr = ^SoundHeader;
  827. type
  828. CmpSoundHeader = record
  829. samplePtr: Ptr; {if nil then samples are in sample area}
  830. numChannels: UNSIGNEDLONG; {number of channels i.e. mono = 1}
  831. sampleRate: UnsignedFixed; {sample rate in Apples Fixed point representation}
  832. loopStart: UNSIGNEDLONG; {loopStart of sound before compression}
  833. loopEnd: UNSIGNEDLONG; {loopEnd of sound before compression}
  834. encode: UInt8; {data structure used , stdSH, extSH, or cmpSH}
  835. baseFrequency: UInt8; {same meaning as regular SoundHeader}
  836. numFrames: UNSIGNEDLONG; {length in frames ( packetFrames or sampleFrames )}
  837. AIFFSampleRate: extended80; {IEEE sample rate}
  838. markerChunk: Ptr; {sync track}
  839. format: OSType; {data format type, was futureUse1}
  840. futureUse2: UNSIGNEDLONG; {reserved by Apple}
  841. stateVars: StateBlockPtr; {pointer to State Block}
  842. leftOverSamples: LeftOverBlockPtr; {used to save truncated samples between compression calls}
  843. compressionID: SInt16; {0 means no compression, non zero means compressionID}
  844. packetSize: UInt16; {number of bits in compressed sample packet}
  845. snthID: UInt16; {resource ID of Sound Manager snth that contains NRT C/E}
  846. sampleSize: UInt16; {number of bits in non-compressed sample}
  847. sampleArea: array [0..0] of UInt8; {space for when samples follow directly}
  848. pad: UInt8;
  849. end;
  850. CmpSoundHeaderPtr = ^CmpSoundHeader;
  851. type
  852. ExtSoundHeader = record
  853. samplePtr: Ptr; {if nil then samples are in sample area}
  854. numChannels: UNSIGNEDLONG; {number of channels, ie mono = 1}
  855. sampleRate: UnsignedFixed; {sample rate in Apples Fixed point representation}
  856. loopStart: UNSIGNEDLONG; {same meaning as regular SoundHeader}
  857. loopEnd: UNSIGNEDLONG; {same meaning as regular SoundHeader}
  858. encode: UInt8; {data structure used , stdSH, extSH, or cmpSH}
  859. baseFrequency: UInt8; {same meaning as regular SoundHeader}
  860. numFrames: UNSIGNEDLONG; {length in total number of frames}
  861. AIFFSampleRate: extended80; {IEEE sample rate}
  862. markerChunk: Ptr; {sync track}
  863. instrumentChunks: Ptr; {AIFF instrument chunks}
  864. AESRecording: Ptr;
  865. sampleSize: UInt16; {number of bits in sample}
  866. futureUse1: UInt16; {reserved by Apple}
  867. futureUse2: UNSIGNEDLONG; {reserved by Apple}
  868. futureUse3: UNSIGNEDLONG; {reserved by Apple}
  869. futureUse4: UNSIGNEDLONG; {reserved by Apple}
  870. sampleArea: array [0..0] of UInt8; {space for when samples follow directly}
  871. pad: UInt8;
  872. end;
  873. ExtSoundHeaderPtr = ^ExtSoundHeader;
  874. type
  875. SoundHeaderUnionPtr = ^SoundHeaderUnion;
  876. SoundHeaderUnion = record
  877. case SInt16 of
  878. 0: (
  879. stdHeader: SoundHeader;
  880. );
  881. 1: (
  882. cmpHeader: CmpSoundHeader;
  883. );
  884. 2: (
  885. extHeader: ExtSoundHeader;
  886. );
  887. end;
  888. ConversionBlock = record
  889. destination: SInt16;
  890. unused: SInt16;
  891. inputPtr: CmpSoundHeaderPtr;
  892. outputPtr: CmpSoundHeaderPtr;
  893. end;
  894. ConversionBlockPtr = ^ConversionBlock;
  895. { ScheduledSoundHeader flags}
  896. const
  897. kScheduledSoundDoScheduled = 1 shl 0;
  898. kScheduledSoundDoCallBack = 1 shl 1;
  899. kScheduledSoundExtendedHdr = 1 shl 2;
  900. type
  901. ScheduledSoundHeader = record
  902. u: SoundHeaderUnion;
  903. flags: SIGNEDLONG;
  904. reserved: SInt16;
  905. callBackParam1: SInt16;
  906. callBackParam2: SIGNEDLONG;
  907. startTime: TimeRecord;
  908. end;
  909. ScheduledSoundHeaderPtr = ^ScheduledSoundHeader;
  910. type
  911. ExtendedScheduledSoundHeader = record
  912. u: SoundHeaderUnion;
  913. flags: SIGNEDLONG;
  914. reserved: SInt16;
  915. callBackParam1: SInt16;
  916. callBackParam2: SIGNEDLONG;
  917. startTime: TimeRecord;
  918. recordSize: SIGNEDLONG;
  919. extendedFlags: SIGNEDLONG;
  920. bufferSize: SIGNEDLONG;
  921. frameCount: SIGNEDLONG; { number of audio frames}
  922. frameSizesArray: SIGNEDLONGPtr; { pointer to array of longs with frame sizes in bytes}
  923. commonFrameSize: SIGNEDLONG; { size of each frame if common}
  924. extensionsPtr: UnivPtr; {pointer to set of classic atoms (size,type,data,...)}
  925. extensionsSize: SIGNEDLONG; {size of extensions data (extensionsPtr)}
  926. bufferFlags: UNSIGNEDLONG; {set or cleared flags}
  927. bufferFlagsMask: UNSIGNEDLONG; {which flags are valid}
  928. end;
  929. ExtendedScheduledSoundHeaderPtr = ^ExtendedScheduledSoundHeader;
  930. type
  931. SMStatus = record
  932. smMaxCPULoad: SInt16;
  933. smNumChannels: SInt16;
  934. smCurCPULoad: SInt16;
  935. end;
  936. SMStatusPtr = ^SMStatus;
  937. type
  938. SCStatus = record
  939. scStartTime: UnsignedFixed;
  940. scEndTime: UnsignedFixed;
  941. scCurrentTime: UnsignedFixed;
  942. scChannelBusy: Boolean;
  943. scChannelDisposed: Boolean;
  944. scChannelPaused: Boolean;
  945. scUnused: Boolean;
  946. scChannelAttributes: UNSIGNEDLONG;
  947. scCPULoad: SIGNEDLONG;
  948. end;
  949. SCStatusPtr = ^SCStatus;
  950. type
  951. AudioSelection = record
  952. unitType: SIGNEDLONG;
  953. selStart: UnsignedFixed;
  954. selEnd: UnsignedFixed;
  955. end;
  956. AudioSelectionPtr = ^AudioSelection;
  957. {$ifc CALL_NOT_IN_CARBON}
  958. type
  959. SndDoubleBuffer = record
  960. dbNumFrames: SIGNEDLONG;
  961. dbFlags: SIGNEDLONG;
  962. dbUserInfo: array [0..1] of SInt32;
  963. dbSoundData: array [0..0] of SInt8;
  964. end;
  965. SndDoubleBufferPtr = ^SndDoubleBuffer;
  966. type
  967. SndDoubleBackProcPtr = procedure( channel: SndChannelPtr; doubleBufferPtr: SndDoubleBufferPtr );
  968. SndDoubleBackUPP = SndDoubleBackProcPtr;
  969. {
  970. * NewSndDoubleBackUPP()
  971. *
  972. * Availability:
  973. * Mac OS X: not available
  974. * CarbonLib: not available
  975. * Non-Carbon CFM: available as macro/inline
  976. }
  977. {
  978. * DisposeSndDoubleBackUPP()
  979. *
  980. * Availability:
  981. * Mac OS X: not available
  982. * CarbonLib: not available
  983. * Non-Carbon CFM: available as macro/inline
  984. }
  985. {
  986. * InvokeSndDoubleBackUPP()
  987. *
  988. * Availability:
  989. * Mac OS X: not available
  990. * CarbonLib: not available
  991. * Non-Carbon CFM: available as macro/inline
  992. }
  993. type
  994. SndDoubleBufferHeader = record
  995. dbhNumChannels: SInt16;
  996. dbhSampleSize: SInt16;
  997. dbhCompressionID: SInt16;
  998. dbhPacketSize: SInt16;
  999. dbhSampleRate: UnsignedFixed;
  1000. dbhBufferPtr: array [0..1] of SndDoubleBufferPtr;
  1001. dbhDoubleBack: SndDoubleBackUPP;
  1002. end;
  1003. SndDoubleBufferHeaderPtr = ^SndDoubleBufferHeader;
  1004. type
  1005. SndDoubleBufferHeader2 = record
  1006. dbhNumChannels: SInt16;
  1007. dbhSampleSize: SInt16;
  1008. dbhCompressionID: SInt16;
  1009. dbhPacketSize: SInt16;
  1010. dbhSampleRate: UnsignedFixed;
  1011. dbhBufferPtr: array [0..1] of SndDoubleBufferPtr;
  1012. dbhDoubleBack: SndDoubleBackUPP;
  1013. dbhFormat: OSType;
  1014. end;
  1015. SndDoubleBufferHeader2Ptr = ^SndDoubleBufferHeader2;
  1016. {$endc} {CALL_NOT_IN_CARBON}
  1017. type
  1018. SoundInfoList = record
  1019. count: SInt16;
  1020. infoHandle: Handle;
  1021. end;
  1022. SoundInfoListPtr = ^SoundInfoList;
  1023. type
  1024. SoundComponentData = record
  1025. flags: SIGNEDLONG;
  1026. format: OSType;
  1027. numChannels: SInt16;
  1028. sampleSize: SInt16;
  1029. sampleRate: UnsignedFixed;
  1030. sampleCount: SIGNEDLONG;
  1031. buffer: BytePtr;
  1032. reserved: SIGNEDLONG;
  1033. end;
  1034. SoundComponentDataPtr = ^SoundComponentData;
  1035. type
  1036. ExtendedSoundComponentData = record
  1037. desc: SoundComponentData; {description of sound buffer}
  1038. recordSize: SIGNEDLONG; {size of this record in bytes}
  1039. extendedFlags: SIGNEDLONG; {flags for extended record}
  1040. bufferSize: SIGNEDLONG; {size of buffer in bytes}
  1041. frameCount: SIGNEDLONG; {number of audio frames}
  1042. frameSizesArray: SIGNEDLONGPtr; {pointer to array of longs with frame sizes in bytes}
  1043. commonFrameSize: SIGNEDLONG; {size of each frame if common}
  1044. extensionsPtr: UnivPtr; {pointer to set of classic atoms (size,type,data,...)}
  1045. extensionsSize: SIGNEDLONG; {size of extensions data (extensionsPtr)}
  1046. bufferFlags: UNSIGNEDLONG; {set or cleared flags}
  1047. bufferFlagsMask: UNSIGNEDLONG; {which flags are valid}
  1048. end;
  1049. ExtendedSoundComponentDataPtr = ^ExtendedSoundComponentData;
  1050. type
  1051. SoundParamBlockPtr = ^SoundParamBlock;
  1052. SoundParamProcPtr = function( var pb: SoundParamBlockPtr ): Boolean;
  1053. SoundParamUPP = SoundParamProcPtr;
  1054. SoundParamBlock = record
  1055. recordSize: SIGNEDLONG; {size of this record in bytes}
  1056. desc: SoundComponentData; {description of sound buffer}
  1057. rateMultiplier: UnsignedFixed; {rate multiplier to apply to sound}
  1058. leftVolume: SInt16; {volumes to apply to sound}
  1059. rightVolume: SInt16;
  1060. quality: SIGNEDLONG; {quality to apply to sound}
  1061. filter: ComponentInstance; {filter to apply to sound}
  1062. moreRtn: SoundParamUPP; {routine to call to get more data}
  1063. completionRtn: SoundParamUPP; {routine to call when buffer is complete}
  1064. refCon: SIGNEDLONG; {user refcon}
  1065. result: SInt16; {result}
  1066. end;
  1067. type
  1068. ExtendedSoundParamBlock = record
  1069. pb: SoundParamBlock; {classic SoundParamBlock except recordSize == sizeof(ExtendedSoundParamBlock)}
  1070. reserved: SInt16;
  1071. extendedFlags: SIGNEDLONG; {flags}
  1072. bufferSize: SIGNEDLONG; {size of buffer in bytes}
  1073. frameCount: SIGNEDLONG; {number of audio frames}
  1074. frameSizesArray: SIGNEDLONGPtr; {pointer to array of longs with frame sizes in bytes}
  1075. commonFrameSize: SIGNEDLONG; {size of each frame if common}
  1076. extensionsPtr: UnivPtr; {pointer to set of classic atoms (size,type,data,...)}
  1077. extensionsSize: SIGNEDLONG; {size of extensions data (extensionsPtr)}
  1078. bufferFlags: UNSIGNEDLONG; {set or cleared flags}
  1079. bufferFlagsMask: UNSIGNEDLONG; {which flags are valid}
  1080. end;
  1081. ExtendedSoundParamBlockPtr = ^ExtendedSoundParamBlock;
  1082. type
  1083. CompressionInfo = record
  1084. recordSize: SIGNEDLONG;
  1085. format: OSType;
  1086. compressionID: SInt16;
  1087. samplesPerPacket: UInt16;
  1088. bytesPerPacket: UInt16;
  1089. bytesPerFrame: UInt16;
  1090. bytesPerSample: UInt16;
  1091. futureUse1: UInt16;
  1092. end;
  1093. CompressionInfoPtr = ^CompressionInfo;
  1094. type
  1095. CompressionInfoHandle = ^CompressionInfoPtr;
  1096. {variables for floating point conversion}
  1097. type
  1098. SoundSlopeAndInterceptRecordPtr = ^SoundSlopeAndInterceptRecord;
  1099. SoundSlopeAndInterceptRecord = record
  1100. slope: Float64;
  1101. intercept: Float64;
  1102. minClip: Float64;
  1103. maxClip: Float64;
  1104. end;
  1105. type
  1106. SoundSlopeAndInterceptPtr = SoundSlopeAndInterceptRecordPtr;
  1107. {private thing to use as a reference to a Sound Converter}
  1108. type
  1109. SoundConverter = ^OpaqueSoundConverter; { an opaque type }
  1110. OpaqueSoundConverter = record end;
  1111. SoundConverterPtr = ^SoundConverter; { when a var xx:SoundConverter parameter can be nil, it is changed to xx: SoundConverterPtr }
  1112. {callback routine to provide data to the Sound Converter}
  1113. type
  1114. SoundConverterFillBufferDataProcPtr = function( var data: SoundComponentDataPtr; refCon: UnivPtr ): Boolean;
  1115. SoundConverterFillBufferDataUPP = SoundConverterFillBufferDataProcPtr;
  1116. {private thing to use as a reference to a Sound Source}
  1117. type
  1118. SoundSource = ^OpaqueSoundSource; { an opaque type }
  1119. OpaqueSoundSource = record end;
  1120. SoundSourcePtr = ^SoundSource;
  1121. type
  1122. SoundComponentLink = record
  1123. description: ComponentDescription; {Describes the sound component}
  1124. mixerID: SoundSource; {Reserved by Apple}
  1125. linkID: SoundSourcePtr; {Reserved by Apple}
  1126. end;
  1127. SoundComponentLinkPtr = ^SoundComponentLink;
  1128. type
  1129. AudioInfo = record
  1130. capabilitiesFlags: SIGNEDLONG; {Describes device capabilities}
  1131. reserved: SIGNEDLONG; {Reserved by Apple}
  1132. numVolumeSteps: UInt16; {Number of significant increments between min and max volume}
  1133. end;
  1134. AudioInfoPtr = ^AudioInfo;
  1135. type
  1136. AudioFormatAtom = record
  1137. size: SIGNEDLONG; { = sizeof(AudioFormatAtom)}
  1138. atomType: OSType; { = kAudioFormatAtomType}
  1139. format: OSType;
  1140. end;
  1141. AudioFormatAtomPtr = ^AudioFormatAtom;
  1142. type
  1143. AudioEndianAtom = record
  1144. size: SIGNEDLONG; { = sizeof(AudioEndianAtom)}
  1145. atomType: OSType; { = kAudioEndianAtomType}
  1146. littleEndian: SInt16;
  1147. end;
  1148. AudioEndianAtomPtr = ^AudioEndianAtom;
  1149. type
  1150. AudioTerminatorAtom = record
  1151. size: SIGNEDLONG; { = sizeof(AudioTerminatorAtom)}
  1152. atomType: OSType; { = kAudioTerminatorAtomType}
  1153. end;
  1154. AudioTerminatorAtomPtr = ^AudioTerminatorAtom;
  1155. type
  1156. LevelMeterInfo = record
  1157. numChannels: SInt16; { mono or stereo source}
  1158. leftMeter: UInt8; { 0-255 range}
  1159. rightMeter: UInt8; { 0-255 range}
  1160. end;
  1161. LevelMeterInfoPtr = ^LevelMeterInfo;
  1162. type
  1163. EQSpectrumBandsRecord = record
  1164. count: SInt16;
  1165. frequency: UnsignedFixedPtr; { pointer to array of frequencies}
  1166. end;
  1167. EQSpectrumBandsRecordPtr = ^EQSpectrumBandsRecord;
  1168. const
  1169. kSoundAudioCodecPropertyWritableFlag = 1 shl 0;
  1170. type
  1171. SoundAudioCodecPropertyRequestParams = record
  1172. propertyClass: UInt32;
  1173. propertyID: UInt32;
  1174. propertyDataSize: UInt32; { out -- GetPropertyInfo, in/out -- GetProperty, in -- SetProperty}
  1175. propertyData: UnivPtr; { in -- GetPropertyInfo, GetProperty, SetProperty}
  1176. propertyRequestFlags: UInt32; { out -- GetPropertyInfo}
  1177. propertyDataType: UInt32; { out -- GetPropertyInfo, often 0}
  1178. propertyRequestResult: ComponentResult; { out -- GetPropertyInfo, GetProperty, SetProperty}
  1179. end;
  1180. { Sound Input Structures}
  1181. type
  1182. SPBPtr = ^SPB;
  1183. {user procedures called by sound input routines}
  1184. SIInterruptProcPtr = procedure( inParamPtr: SPBPtr; dataBuffer: Ptr; peakAmplitude: SInt16; sampleSize: SIGNEDLONG );
  1185. SICompletionProcPtr = procedure( inParamPtr: SPBPtr );
  1186. SIInterruptUPP = SIInterruptProcPtr;
  1187. SICompletionUPP = SICompletionProcPtr;
  1188. {Sound Input Parameter Block}
  1189. SPB = record
  1190. inRefNum: SIGNEDLONG; {reference number of sound input device}
  1191. count: UNSIGNEDLONG; {number of bytes to record}
  1192. milliseconds: UNSIGNEDLONG; {number of milliseconds to record}
  1193. bufferLength: UNSIGNEDLONG; {length of buffer in bytes}
  1194. bufferPtr: Ptr; {buffer to store sound data in}
  1195. completionRoutine: SICompletionUPP; {completion routine}
  1196. interruptRoutine: SIInterruptUPP; {interrupt routine}
  1197. userLong: SIGNEDLONG; {user-defined field}
  1198. error: OSErr; {error}
  1199. unused1: SIGNEDLONG; {reserved - must be zero}
  1200. end;
  1201. {
  1202. * NewSoundParamUPP()
  1203. *
  1204. * Availability:
  1205. * Mac OS X: in version 10.0 and later in Carbon.framework
  1206. * CarbonLib: in CarbonLib 1.0 and later
  1207. * Non-Carbon CFM: available as macro/inline
  1208. }
  1209. function NewSoundParamUPP( userRoutine: SoundParamProcPtr ): SoundParamUPP; external name '_NewSoundParamUPP';
  1210. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1211. {
  1212. * NewSoundConverterFillBufferDataUPP()
  1213. *
  1214. * Availability:
  1215. * Mac OS X: in version 10.0 and later in Carbon.framework
  1216. * CarbonLib: in CarbonLib 1.1 and later
  1217. * Non-Carbon CFM: available as macro/inline
  1218. }
  1219. function NewSoundConverterFillBufferDataUPP( userRoutine: SoundConverterFillBufferDataProcPtr ): SoundConverterFillBufferDataUPP; external name '_NewSoundConverterFillBufferDataUPP';
  1220. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1221. {
  1222. * NewSIInterruptUPP()
  1223. *
  1224. * Availability:
  1225. * Mac OS X: in version 10.0 and later in Carbon.framework
  1226. * CarbonLib: in CarbonLib 1.0 and later
  1227. * Non-Carbon CFM: available as macro/inline
  1228. }
  1229. function NewSIInterruptUPP( userRoutine: SIInterruptProcPtr ): SIInterruptUPP; external name '_NewSIInterruptUPP';
  1230. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1231. {
  1232. * NewSICompletionUPP()
  1233. *
  1234. * Availability:
  1235. * Mac OS X: in version 10.0 and later in Carbon.framework
  1236. * CarbonLib: in CarbonLib 1.0 and later
  1237. * Non-Carbon CFM: available as macro/inline
  1238. }
  1239. function NewSICompletionUPP( userRoutine: SICompletionProcPtr ): SICompletionUPP; external name '_NewSICompletionUPP';
  1240. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1241. {
  1242. * DisposeSoundParamUPP()
  1243. *
  1244. * Availability:
  1245. * Mac OS X: in version 10.0 and later in Carbon.framework
  1246. * CarbonLib: in CarbonLib 1.0 and later
  1247. * Non-Carbon CFM: available as macro/inline
  1248. }
  1249. procedure DisposeSoundParamUPP( userUPP: SoundParamUPP ); external name '_DisposeSoundParamUPP';
  1250. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1251. {
  1252. * DisposeSoundConverterFillBufferDataUPP()
  1253. *
  1254. * Availability:
  1255. * Mac OS X: in version 10.0 and later in Carbon.framework
  1256. * CarbonLib: in CarbonLib 1.1 and later
  1257. * Non-Carbon CFM: available as macro/inline
  1258. }
  1259. procedure DisposeSoundConverterFillBufferDataUPP( userUPP: SoundConverterFillBufferDataUPP ); external name '_DisposeSoundConverterFillBufferDataUPP';
  1260. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1261. {
  1262. * DisposeSIInterruptUPP()
  1263. *
  1264. * Availability:
  1265. * Mac OS X: in version 10.0 and later in Carbon.framework
  1266. * CarbonLib: in CarbonLib 1.0 and later
  1267. * Non-Carbon CFM: available as macro/inline
  1268. }
  1269. procedure DisposeSIInterruptUPP( userUPP: SIInterruptUPP ); external name '_DisposeSIInterruptUPP';
  1270. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1271. {
  1272. * DisposeSICompletionUPP()
  1273. *
  1274. * Availability:
  1275. * Mac OS X: in version 10.0 and later in Carbon.framework
  1276. * CarbonLib: in CarbonLib 1.0 and later
  1277. * Non-Carbon CFM: available as macro/inline
  1278. }
  1279. procedure DisposeSICompletionUPP( userUPP: SICompletionUPP ); external name '_DisposeSICompletionUPP';
  1280. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1281. {
  1282. * InvokeSoundParamUPP()
  1283. *
  1284. * Availability:
  1285. * Mac OS X: in version 10.0 and later in Carbon.framework
  1286. * CarbonLib: in CarbonLib 1.0 and later
  1287. * Non-Carbon CFM: available as macro/inline
  1288. }
  1289. function InvokeSoundParamUPP( var pb: SoundParamBlockPtr; userUPP: SoundParamUPP ): Boolean; external name '_InvokeSoundParamUPP';
  1290. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1291. {
  1292. * InvokeSoundConverterFillBufferDataUPP()
  1293. *
  1294. * Availability:
  1295. * Mac OS X: in version 10.0 and later in Carbon.framework
  1296. * CarbonLib: in CarbonLib 1.1 and later
  1297. * Non-Carbon CFM: available as macro/inline
  1298. }
  1299. function InvokeSoundConverterFillBufferDataUPP( var data: SoundComponentDataPtr; refCon: UnivPtr; userUPP: SoundConverterFillBufferDataUPP ): Boolean; external name '_InvokeSoundConverterFillBufferDataUPP';
  1300. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1301. {
  1302. * InvokeSIInterruptUPP()
  1303. *
  1304. * Availability:
  1305. * Mac OS X: in version 10.0 and later in Carbon.framework
  1306. * CarbonLib: in CarbonLib 1.0 and later
  1307. * Non-Carbon CFM: available as macro/inline
  1308. }
  1309. procedure InvokeSIInterruptUPP( inParamPtr: SPBPtr; dataBuffer: Ptr; peakAmplitude: SInt16; sampleSize: SIGNEDLONG; userUPP: SIInterruptUPP ); external name '_InvokeSIInterruptUPP';
  1310. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1311. {
  1312. * InvokeSICompletionUPP()
  1313. *
  1314. * Availability:
  1315. * Mac OS X: in version 10.0 and later in Carbon.framework
  1316. * CarbonLib: in CarbonLib 1.0 and later
  1317. * Non-Carbon CFM: available as macro/inline
  1318. }
  1319. procedure InvokeSICompletionUPP( inParamPtr: SPBPtr; userUPP: SICompletionUPP ); external name '_InvokeSICompletionUPP';
  1320. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1321. type
  1322. FilePlayCompletionProcPtr = procedure( chan: SndChannelPtr );
  1323. FilePlayCompletionUPP = FilePlayCompletionProcPtr;
  1324. {
  1325. * NewFilePlayCompletionUPP()
  1326. *
  1327. * Availability:
  1328. * Mac OS X: not available
  1329. * CarbonLib: not available
  1330. * Non-Carbon CFM: available as macro/inline
  1331. }
  1332. {
  1333. * DisposeFilePlayCompletionUPP()
  1334. *
  1335. * Availability:
  1336. * Mac OS X: not available
  1337. * CarbonLib: not available
  1338. * Non-Carbon CFM: available as macro/inline
  1339. }
  1340. {
  1341. * InvokeFilePlayCompletionUPP()
  1342. *
  1343. * Availability:
  1344. * Mac OS X: not available
  1345. * CarbonLib: not available
  1346. * Non-Carbon CFM: available as macro/inline
  1347. }
  1348. {
  1349. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1350. prototypes
  1351. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1352. }
  1353. { Sound Manager routines }
  1354. {$ifc not TARGET_CPU_64}
  1355. {
  1356. * SysBeep() *** DEPRECATED ***
  1357. *
  1358. * Deprecated:
  1359. * Use AudioServicesPlayAlertSound(). Found in
  1360. * AudioToolbox/AudioServices.h
  1361. *
  1362. * Availability:
  1363. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1364. * CarbonLib: in CarbonLib 1.0 and later
  1365. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1366. }
  1367. procedure SysBeep( duration: SInt16 ); external name '_SysBeep';
  1368. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1369. {
  1370. * SndDoCommand() *** DEPRECATED ***
  1371. *
  1372. * Availability:
  1373. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1374. * CarbonLib: in CarbonLib 1.0 and later
  1375. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1376. }
  1377. function SndDoCommand( chan: SndChannelPtr; const (*var*) cmd: SndCommand; noWait: Boolean ): OSErr; external name '_SndDoCommand';
  1378. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1379. {
  1380. * SndDoImmediate() *** DEPRECATED ***
  1381. *
  1382. * Availability:
  1383. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1384. * CarbonLib: in CarbonLib 1.0 and later
  1385. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1386. }
  1387. function SndDoImmediate( chan: SndChannelPtr; const (*var*) cmd: SndCommand ): OSErr; external name '_SndDoImmediate';
  1388. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1389. {
  1390. * SndNewChannel() *** DEPRECATED ***
  1391. *
  1392. * Availability:
  1393. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1394. * CarbonLib: in CarbonLib 1.0 and later
  1395. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1396. }
  1397. function SndNewChannel( var chan: SndChannelPtr; synth: SInt16; init: SIGNEDLONG; userRoutine: SndCallBackUPP ): OSErr; external name '_SndNewChannel';
  1398. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1399. {
  1400. * SndDisposeChannel() *** DEPRECATED ***
  1401. *
  1402. * Availability:
  1403. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1404. * CarbonLib: in CarbonLib 1.0 and later
  1405. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1406. }
  1407. function SndDisposeChannel( chan: SndChannelPtr; quietNow: Boolean ): OSErr; external name '_SndDisposeChannel';
  1408. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1409. {
  1410. * SndPlay() *** DEPRECATED ***
  1411. *
  1412. * Availability:
  1413. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1414. * CarbonLib: in CarbonLib 1.0 and later
  1415. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1416. }
  1417. function SndPlay( chan: SndChannelPtr; sndHandle: SndListHandle; async: Boolean ): OSErr; external name '_SndPlay';
  1418. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1419. {$endc} {not TARGET_CPU_64}
  1420. {$ifc OLDROUTINENAMES}
  1421. {
  1422. * SndAddModifier()
  1423. *
  1424. * Availability:
  1425. * Mac OS X: not available
  1426. * CarbonLib: not available
  1427. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1428. }
  1429. {$endc} {OLDROUTINENAMES}
  1430. {
  1431. * SndControl()
  1432. *
  1433. * Availability:
  1434. * Mac OS X: not available
  1435. * CarbonLib: not available
  1436. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1437. }
  1438. { Sound Manager 2.0 and later, uses _SoundDispatch }
  1439. {$ifc not TARGET_CPU_64}
  1440. {
  1441. * SndSoundManagerVersion() *** DEPRECATED ***
  1442. *
  1443. * Availability:
  1444. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1445. * CarbonLib: in CarbonLib 1.0 and later
  1446. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1447. }
  1448. function SndSoundManagerVersion: NumVersion; external name '_SndSoundManagerVersion';
  1449. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1450. {$endc} {not TARGET_CPU_64}
  1451. {
  1452. * SndStartFilePlay()
  1453. *
  1454. * Availability:
  1455. * Mac OS X: not available
  1456. * CarbonLib: not available
  1457. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1458. }
  1459. {
  1460. * SndPauseFilePlay()
  1461. *
  1462. * Availability:
  1463. * Mac OS X: not available
  1464. * CarbonLib: not available
  1465. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1466. }
  1467. {
  1468. * SndStopFilePlay()
  1469. *
  1470. * Availability:
  1471. * Mac OS X: not available
  1472. * CarbonLib: not available
  1473. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1474. }
  1475. {$ifc not TARGET_CPU_64}
  1476. {
  1477. * SndChannelStatus() *** DEPRECATED ***
  1478. *
  1479. * Availability:
  1480. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1481. * CarbonLib: in CarbonLib 1.0 and later
  1482. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1483. }
  1484. function SndChannelStatus( chan: SndChannelPtr; theLength: SInt16; theStatus: SCStatusPtr ): OSErr; external name '_SndChannelStatus';
  1485. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1486. {
  1487. * SndManagerStatus() *** DEPRECATED ***
  1488. *
  1489. * Availability:
  1490. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1491. * CarbonLib: in CarbonLib 1.0 and later
  1492. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1493. }
  1494. function SndManagerStatus( theLength: SInt16; theStatus: SMStatusPtr ): OSErr; external name '_SndManagerStatus';
  1495. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1496. {
  1497. * SndGetSysBeepState() *** DEPRECATED ***
  1498. *
  1499. * Deprecated:
  1500. * SysBeep related APIs have been replaced by AudioServices. Found
  1501. * in AudioToolbox/AudioServices.h
  1502. *
  1503. * Availability:
  1504. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1505. * CarbonLib: in CarbonLib 1.0 and later
  1506. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1507. }
  1508. procedure SndGetSysBeepState( var sysBeepState: SInt16 ); external name '_SndGetSysBeepState';
  1509. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1510. {
  1511. * SndSetSysBeepState() *** DEPRECATED ***
  1512. *
  1513. * Deprecated:
  1514. * SysBeep related APIs have been replaced by AudioServices. Found
  1515. * in AudioToolbox/AudioServices.h
  1516. *
  1517. * Availability:
  1518. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1519. * CarbonLib: in CarbonLib 1.0 and later
  1520. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1521. }
  1522. function SndSetSysBeepState( sysBeepState: SInt16 ): OSErr; external name '_SndSetSysBeepState';
  1523. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1524. {$endc} {not TARGET_CPU_64}
  1525. {
  1526. * SndPlayDoubleBuffer()
  1527. *
  1528. * Availability:
  1529. * Mac OS X: not available
  1530. * CarbonLib: not available
  1531. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1532. }
  1533. { MACE compression routines, uses _SoundDispatch }
  1534. {
  1535. * MACEVersion()
  1536. *
  1537. * Availability:
  1538. * Mac OS X: not available
  1539. * CarbonLib: not available
  1540. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1541. }
  1542. {
  1543. * Comp3to1()
  1544. *
  1545. * Availability:
  1546. * Mac OS X: not available
  1547. * CarbonLib: not available
  1548. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1549. }
  1550. {
  1551. * Exp1to3()
  1552. *
  1553. * Availability:
  1554. * Mac OS X: not available
  1555. * CarbonLib: not available
  1556. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1557. }
  1558. {
  1559. * Comp6to1()
  1560. *
  1561. * Availability:
  1562. * Mac OS X: not available
  1563. * CarbonLib: not available
  1564. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1565. }
  1566. {
  1567. * Exp1to6()
  1568. *
  1569. * Availability:
  1570. * Mac OS X: not available
  1571. * CarbonLib: not available
  1572. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1573. }
  1574. { Sound Manager 3.0 and later calls, uses _SoundDispatch }
  1575. {$ifc not TARGET_CPU_64}
  1576. {
  1577. * GetSysBeepVolume() *** DEPRECATED ***
  1578. *
  1579. * Availability:
  1580. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1581. * CarbonLib: in CarbonLib 1.0 and later
  1582. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1583. }
  1584. function GetSysBeepVolume( var level: SIGNEDLONG ): OSErr; external name '_GetSysBeepVolume';
  1585. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1586. {
  1587. * SetSysBeepVolume() *** DEPRECATED ***
  1588. *
  1589. * Availability:
  1590. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1591. * CarbonLib: in CarbonLib 1.0 and later
  1592. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1593. }
  1594. function SetSysBeepVolume( level: SIGNEDLONG ): OSErr; external name '_SetSysBeepVolume';
  1595. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1596. {
  1597. * GetDefaultOutputVolume() *** DEPRECATED ***
  1598. *
  1599. * Availability:
  1600. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1601. * CarbonLib: in CarbonLib 1.0 and later
  1602. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1603. }
  1604. function GetDefaultOutputVolume( var level: SIGNEDLONG ): OSErr; external name '_GetDefaultOutputVolume';
  1605. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1606. {
  1607. * SetDefaultOutputVolume() *** DEPRECATED ***
  1608. *
  1609. * Availability:
  1610. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1611. * CarbonLib: in CarbonLib 1.0 and later
  1612. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1613. }
  1614. function SetDefaultOutputVolume( level: SIGNEDLONG ): OSErr; external name '_SetDefaultOutputVolume';
  1615. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1616. {
  1617. * GetSoundHeaderOffset() *** DEPRECATED ***
  1618. *
  1619. * Availability:
  1620. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1621. * CarbonLib: in CarbonLib 1.0 and later
  1622. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1623. }
  1624. function GetSoundHeaderOffset( sndHandle: SndListHandle; var offset: SIGNEDLONG ): OSErr; external name '_GetSoundHeaderOffset';
  1625. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1626. {$endc} {not TARGET_CPU_64}
  1627. {
  1628. * UnsignedFixedMulDiv()
  1629. *
  1630. * Availability:
  1631. * Mac OS X: not available
  1632. * CarbonLib: in CarbonLib 1.0 and later
  1633. * Non-Carbon CFM: in SoundLib 3.0 and later
  1634. }
  1635. (*
  1636. function UnsignedFixedMulDiv( value: UnsignedFixed; multiplier: UnsignedFixed; divisor: UnsignedFixed ): UnsignedFixed; external name '_UnsignedFixedMulDiv';
  1637. Duplicated in FixMath.h, also strange that it's included here without availability info.
  1638. *)
  1639. {$ifc not TARGET_CPU_64}
  1640. {
  1641. * GetCompressionInfo() *** DEPRECATED ***
  1642. *
  1643. * Availability:
  1644. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1645. * CarbonLib: in CarbonLib 1.0 and later
  1646. * Non-Carbon CFM: in SoundLib 3.0 and later
  1647. }
  1648. function GetCompressionInfo( compressionID: SInt16; format: OSType; numChannels: SInt16; sampleSize: SInt16; cp: CompressionInfoPtr ): OSErr; external name '_GetCompressionInfo';
  1649. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1650. {
  1651. * SetSoundPreference() *** DEPRECATED ***
  1652. *
  1653. * Availability:
  1654. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1655. * CarbonLib: in CarbonLib 1.0 and later
  1656. * Non-Carbon CFM: in SoundLib 3.0 and later
  1657. }
  1658. function SetSoundPreference( theType: OSType; var name: Str255; settings: Handle ): OSErr; external name '_SetSoundPreference';
  1659. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1660. {
  1661. * GetSoundPreference() *** DEPRECATED ***
  1662. *
  1663. * Availability:
  1664. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1665. * CarbonLib: in CarbonLib 1.0 and later
  1666. * Non-Carbon CFM: in SoundLib 3.0 and later
  1667. }
  1668. function GetSoundPreference( theType: OSType; var name: Str255; settings: Handle ): OSErr; external name '_GetSoundPreference';
  1669. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1670. {
  1671. * OpenMixerSoundComponent() *** DEPRECATED ***
  1672. *
  1673. * Availability:
  1674. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1675. * CarbonLib: in CarbonLib 1.0 and later
  1676. * Non-Carbon CFM: in SoundLib 3.0 and later
  1677. }
  1678. function OpenMixerSoundComponent( outputDescription: SoundComponentDataPtr; outputFlags: SIGNEDLONG; var mixerComponent: ComponentInstance ): OSErr; external name '_OpenMixerSoundComponent';
  1679. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1680. {
  1681. * CloseMixerSoundComponent() *** DEPRECATED ***
  1682. *
  1683. * Availability:
  1684. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1685. * CarbonLib: in CarbonLib 1.0 and later
  1686. * Non-Carbon CFM: in SoundLib 3.0 and later
  1687. }
  1688. function CloseMixerSoundComponent( ci: ComponentInstance ): OSErr; external name '_CloseMixerSoundComponent';
  1689. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1690. { Sound Manager 3.1 and later calls, uses _SoundDispatch }
  1691. {
  1692. * SndGetInfo() *** DEPRECATED ***
  1693. *
  1694. * Availability:
  1695. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1696. * CarbonLib: in CarbonLib 1.0 and later
  1697. * Non-Carbon CFM: in SoundLib 3.1 and later
  1698. }
  1699. function SndGetInfo( chan: SndChannelPtr; selector: OSType; infoPtr: UnivPtr ): OSErr; external name '_SndGetInfo';
  1700. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1701. {
  1702. * SndSetInfo() *** DEPRECATED ***
  1703. *
  1704. * Availability:
  1705. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1706. * CarbonLib: in CarbonLib 1.0 and later
  1707. * Non-Carbon CFM: in SoundLib 3.1 and later
  1708. }
  1709. function SndSetInfo( chan: SndChannelPtr; selector: OSType; infoPtr: {const} UnivPtr ): OSErr; external name '_SndSetInfo';
  1710. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1711. {
  1712. * GetSoundOutputInfo() *** DEPRECATED ***
  1713. *
  1714. * Availability:
  1715. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1716. * CarbonLib: in CarbonLib 1.0 and later
  1717. * Non-Carbon CFM: in SoundLib 3.1 and later
  1718. }
  1719. function GetSoundOutputInfo( outputDevice: Component; selector: OSType; infoPtr: UnivPtr ): OSErr; external name '_GetSoundOutputInfo';
  1720. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1721. {
  1722. * SetSoundOutputInfo() *** DEPRECATED ***
  1723. *
  1724. * Availability:
  1725. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1726. * CarbonLib: in CarbonLib 1.0 and later
  1727. * Non-Carbon CFM: in SoundLib 3.1 and later
  1728. }
  1729. function SetSoundOutputInfo( outputDevice: Component; selector: OSType; infoPtr: {const} UnivPtr ): OSErr; external name '_SetSoundOutputInfo';
  1730. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1731. { Sound Manager 3.2 and later calls, uses _SoundDispatch }
  1732. {
  1733. * GetCompressionName() *** DEPRECATED ***
  1734. *
  1735. * Availability:
  1736. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1737. * CarbonLib: in CarbonLib 1.0 and later
  1738. * Non-Carbon CFM: in SoundLib 3.2 and later
  1739. }
  1740. function GetCompressionName( compressionType: OSType; var compressionName: Str255 ): OSErr; external name '_GetCompressionName';
  1741. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1742. {
  1743. * SoundConverterOpen() *** DEPRECATED ***
  1744. *
  1745. * Availability:
  1746. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1747. * CarbonLib: in CarbonLib 1.0 and later
  1748. * Non-Carbon CFM: in SoundLib 3.2 and later
  1749. }
  1750. function SoundConverterOpen( const (*var*) inputFormat: SoundComponentData; const (*var*) outputFormat: SoundComponentData; var sc: SoundConverter ): OSErr; external name '_SoundConverterOpen';
  1751. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1752. {
  1753. * SoundConverterClose() *** DEPRECATED ***
  1754. *
  1755. * Availability:
  1756. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1757. * CarbonLib: in CarbonLib 1.0 and later
  1758. * Non-Carbon CFM: in SoundLib 3.2 and later
  1759. }
  1760. function SoundConverterClose( sc: SoundConverter ): OSErr; external name '_SoundConverterClose';
  1761. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1762. {
  1763. * SoundConverterGetBufferSizes() *** DEPRECATED ***
  1764. *
  1765. * Availability:
  1766. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1767. * CarbonLib: in CarbonLib 1.0 and later
  1768. * Non-Carbon CFM: in SoundLib 3.2 and later
  1769. }
  1770. function SoundConverterGetBufferSizes( sc: SoundConverter; inputBytesTarget: UNSIGNEDLONG; var inputFrames: UNSIGNEDLONG; var inputBytes: UNSIGNEDLONG; var outputBytes: UNSIGNEDLONG ): OSErr; external name '_SoundConverterGetBufferSizes';
  1771. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1772. {
  1773. * SoundConverterBeginConversion() *** DEPRECATED ***
  1774. *
  1775. * Availability:
  1776. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1777. * CarbonLib: in CarbonLib 1.0 and later
  1778. * Non-Carbon CFM: in SoundLib 3.2 and later
  1779. }
  1780. function SoundConverterBeginConversion( sc: SoundConverter ): OSErr; external name '_SoundConverterBeginConversion';
  1781. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1782. {
  1783. * SoundConverterConvertBuffer() *** DEPRECATED ***
  1784. *
  1785. * Availability:
  1786. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1787. * CarbonLib: in CarbonLib 1.0 and later
  1788. * Non-Carbon CFM: in SoundLib 3.2 and later
  1789. }
  1790. function SoundConverterConvertBuffer( sc: SoundConverter; inputPtr: {const} UnivPtr; inputFrames: UNSIGNEDLONG; outputPtr: UnivPtr; var outputFrames: UNSIGNEDLONG; var outputBytes: UNSIGNEDLONG ): OSErr; external name '_SoundConverterConvertBuffer';
  1791. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1792. {
  1793. * SoundConverterEndConversion() *** DEPRECATED ***
  1794. *
  1795. * Availability:
  1796. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1797. * CarbonLib: in CarbonLib 1.0 and later
  1798. * Non-Carbon CFM: in SoundLib 3.2 and later
  1799. }
  1800. function SoundConverterEndConversion( sc: SoundConverter; outputPtr: UnivPtr; var outputFrames: UNSIGNEDLONG; var outputBytes: UNSIGNEDLONG ): OSErr; external name '_SoundConverterEndConversion';
  1801. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1802. { Sound Manager 3.3 and later calls, uses _SoundDispatch }
  1803. {
  1804. * SoundConverterGetInfo() *** DEPRECATED ***
  1805. *
  1806. * Availability:
  1807. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1808. * CarbonLib: in CarbonLib 1.0 and later
  1809. * Non-Carbon CFM: in SoundLib 3.3 and later
  1810. }
  1811. function SoundConverterGetInfo( sc: SoundConverter; selector: OSType; infoPtr: UnivPtr ): OSErr; external name '_SoundConverterGetInfo';
  1812. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1813. {
  1814. * SoundConverterSetInfo() *** DEPRECATED ***
  1815. *
  1816. * Availability:
  1817. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1818. * CarbonLib: in CarbonLib 1.0 and later
  1819. * Non-Carbon CFM: in SoundLib 3.3 and later
  1820. }
  1821. function SoundConverterSetInfo( sc: SoundConverter; selector: OSType; infoPtr: UnivPtr ): OSErr; external name '_SoundConverterSetInfo';
  1822. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1823. { Sound Manager 3.6 and later calls, uses _SoundDispatch }
  1824. {
  1825. * SoundConverterFillBuffer() *** DEPRECATED ***
  1826. *
  1827. * Availability:
  1828. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1829. * CarbonLib: in CarbonLib 1.1 and later
  1830. * Non-Carbon CFM: in SoundLib 3.6 and later
  1831. }
  1832. function SoundConverterFillBuffer( sc: SoundConverter; fillBufferDataUPP: SoundConverterFillBufferDataUPP; fillBufferDataRefCon: UnivPtr; outputBuffer: UnivPtr; outputBufferByteSize: UNSIGNEDLONG; var bytesWritten: UNSIGNEDLONG; var framesWritten: UNSIGNEDLONG; var outputFlags: UNSIGNEDLONG ): OSErr; external name '_SoundConverterFillBuffer';
  1833. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1834. {
  1835. * SoundManagerGetInfo() *** DEPRECATED ***
  1836. *
  1837. * Availability:
  1838. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1839. * CarbonLib: in CarbonLib 1.1 and later
  1840. * Non-Carbon CFM: in SoundLib 3.6 and later
  1841. }
  1842. function SoundManagerGetInfo( selector: OSType; infoPtr: UnivPtr ): OSErr; external name '_SoundManagerGetInfo';
  1843. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1844. {
  1845. * SoundManagerSetInfo() *** DEPRECATED ***
  1846. *
  1847. * Availability:
  1848. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1849. * CarbonLib: in CarbonLib 1.1 and later
  1850. * Non-Carbon CFM: in SoundLib 3.6 and later
  1851. }
  1852. function SoundManagerSetInfo( selector: OSType; infoPtr: {const} UnivPtr ): OSErr; external name '_SoundManagerSetInfo';
  1853. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1854. {
  1855. Sound Component Functions
  1856. basic sound component functions
  1857. }
  1858. {
  1859. * SoundComponentInitOutputDevice() *** DEPRECATED ***
  1860. *
  1861. * Availability:
  1862. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1863. * CarbonLib: in CarbonLib 1.0 and later
  1864. * Non-Carbon CFM: in SoundLib 3.0 and later
  1865. }
  1866. function SoundComponentInitOutputDevice( ti: ComponentInstance; actions: SIGNEDLONG ): ComponentResult; external name '_SoundComponentInitOutputDevice';
  1867. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1868. {
  1869. * SoundComponentSetSource() *** DEPRECATED ***
  1870. *
  1871. * Availability:
  1872. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1873. * CarbonLib: in CarbonLib 1.0 and later
  1874. * Non-Carbon CFM: in SoundLib 3.0 and later
  1875. }
  1876. function SoundComponentSetSource( ti: ComponentInstance; sourceID: SoundSource; source: ComponentInstance ): ComponentResult; external name '_SoundComponentSetSource';
  1877. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1878. {
  1879. * SoundComponentGetSource() *** DEPRECATED ***
  1880. *
  1881. * Availability:
  1882. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1883. * CarbonLib: in CarbonLib 1.0 and later
  1884. * Non-Carbon CFM: in SoundLib 3.0 and later
  1885. }
  1886. function SoundComponentGetSource( ti: ComponentInstance; sourceID: SoundSource; var source: ComponentInstance ): ComponentResult; external name '_SoundComponentGetSource';
  1887. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1888. {
  1889. * SoundComponentGetSourceData() *** DEPRECATED ***
  1890. *
  1891. * Availability:
  1892. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1893. * CarbonLib: in CarbonLib 1.0 and later
  1894. * Non-Carbon CFM: in SoundLib 3.0 and later
  1895. }
  1896. function SoundComponentGetSourceData( ti: ComponentInstance; var sourceData: SoundComponentDataPtr ): ComponentResult; external name '_SoundComponentGetSourceData';
  1897. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1898. {
  1899. * SoundComponentSetOutput() *** DEPRECATED ***
  1900. *
  1901. * Availability:
  1902. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1903. * CarbonLib: in CarbonLib 1.0 and later
  1904. * Non-Carbon CFM: in SoundLib 3.0 and later
  1905. }
  1906. function SoundComponentSetOutput( ti: ComponentInstance; requested: SoundComponentDataPtr; var actual: SoundComponentDataPtr ): ComponentResult; external name '_SoundComponentSetOutput';
  1907. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1908. { junction methods for the mixer, must be called at non-interrupt level}
  1909. {
  1910. * SoundComponentAddSource() *** DEPRECATED ***
  1911. *
  1912. * Availability:
  1913. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1914. * CarbonLib: in CarbonLib 1.0 and later
  1915. * Non-Carbon CFM: in SoundLib 3.0 and later
  1916. }
  1917. function SoundComponentAddSource( ti: ComponentInstance; var sourceID: SoundSource ): ComponentResult; external name '_SoundComponentAddSource';
  1918. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1919. {
  1920. * SoundComponentRemoveSource() *** DEPRECATED ***
  1921. *
  1922. * Availability:
  1923. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1924. * CarbonLib: in CarbonLib 1.0 and later
  1925. * Non-Carbon CFM: in SoundLib 3.0 and later
  1926. }
  1927. function SoundComponentRemoveSource( ti: ComponentInstance; sourceID: SoundSource ): ComponentResult; external name '_SoundComponentRemoveSource';
  1928. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1929. { info methods}
  1930. {
  1931. * SoundComponentGetInfo() *** DEPRECATED ***
  1932. *
  1933. * Availability:
  1934. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1935. * CarbonLib: in CarbonLib 1.0 and later
  1936. * Non-Carbon CFM: in SoundLib 3.0 and later
  1937. }
  1938. function SoundComponentGetInfo( ti: ComponentInstance; sourceID: SoundSource; selector: OSType; infoPtr: UnivPtr ): ComponentResult; external name '_SoundComponentGetInfo';
  1939. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1940. {
  1941. * SoundComponentSetInfo() *** DEPRECATED ***
  1942. *
  1943. * Availability:
  1944. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1945. * CarbonLib: in CarbonLib 1.0 and later
  1946. * Non-Carbon CFM: in SoundLib 3.0 and later
  1947. }
  1948. function SoundComponentSetInfo( ti: ComponentInstance; sourceID: SoundSource; selector: OSType; infoPtr: UnivPtr ): ComponentResult; external name '_SoundComponentSetInfo';
  1949. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1950. { control methods}
  1951. {
  1952. * SoundComponentStartSource() *** DEPRECATED ***
  1953. *
  1954. * Availability:
  1955. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1956. * CarbonLib: in CarbonLib 1.0 and later
  1957. * Non-Carbon CFM: in SoundLib 3.0 and later
  1958. }
  1959. function SoundComponentStartSource( ti: ComponentInstance; count: SInt16; var sources: SoundSource ): ComponentResult; external name '_SoundComponentStartSource';
  1960. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1961. {
  1962. * SoundComponentStopSource() *** DEPRECATED ***
  1963. *
  1964. * Availability:
  1965. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1966. * CarbonLib: in CarbonLib 1.0 and later
  1967. * Non-Carbon CFM: in SoundLib 3.0 and later
  1968. }
  1969. function SoundComponentStopSource( ti: ComponentInstance; count: SInt16; var sources: SoundSource ): ComponentResult; external name '_SoundComponentStopSource';
  1970. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1971. {
  1972. * SoundComponentPauseSource() *** DEPRECATED ***
  1973. *
  1974. * Availability:
  1975. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1976. * CarbonLib: in CarbonLib 1.0 and later
  1977. * Non-Carbon CFM: in SoundLib 3.0 and later
  1978. }
  1979. function SoundComponentPauseSource( ti: ComponentInstance; count: SInt16; var sources: SoundSource ): ComponentResult; external name '_SoundComponentPauseSource';
  1980. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1981. {
  1982. * SoundComponentPlaySourceBuffer() *** DEPRECATED ***
  1983. *
  1984. * Availability:
  1985. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  1986. * CarbonLib: in CarbonLib 1.0 and later
  1987. * Non-Carbon CFM: in SoundLib 3.0 and later
  1988. }
  1989. function SoundComponentPlaySourceBuffer( ti: ComponentInstance; sourceID: SoundSource; pb: SoundParamBlockPtr; actions: SIGNEDLONG ): ComponentResult; external name '_SoundComponentPlaySourceBuffer';
  1990. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  1991. {$endc} {not TARGET_CPU_64}
  1992. { selectors for component calls }
  1993. const
  1994. kSoundComponentInitOutputDeviceSelect = $0001;
  1995. kSoundComponentSetSourceSelect = $0002;
  1996. kSoundComponentGetSourceSelect = $0003;
  1997. kSoundComponentGetSourceDataSelect = $0004;
  1998. kSoundComponentSetOutputSelect = $0005;
  1999. kSoundComponentAddSourceSelect = $0101;
  2000. kSoundComponentRemoveSourceSelect = $0102;
  2001. kSoundComponentGetInfoSelect = $0103;
  2002. kSoundComponentSetInfoSelect = $0104;
  2003. kSoundComponentStartSourceSelect = $0105;
  2004. kSoundComponentStopSourceSelect = $0106;
  2005. kSoundComponentPauseSourceSelect = $0107;
  2006. kSoundComponentPlaySourceBufferSelect = $0108;
  2007. {Audio Components}
  2008. {Volume is described as a value between 0 and 1, with 0 indicating minimum
  2009. volume and 1 indicating maximum volume; if the device doesn't support
  2010. software control of volume, then a value of unimpErr is returned, indicating
  2011. that these functions are not supported by the device
  2012. }
  2013. {
  2014. * AudioGetVolume()
  2015. *
  2016. * Availability:
  2017. * Mac OS X: not available
  2018. * CarbonLib: not available
  2019. * Non-Carbon CFM: in SoundLib 3.0 and later
  2020. }
  2021. {
  2022. * AudioSetVolume()
  2023. *
  2024. * Availability:
  2025. * Mac OS X: not available
  2026. * CarbonLib: not available
  2027. * Non-Carbon CFM: in SoundLib 3.0 and later
  2028. }
  2029. {If the device doesn't support software control of mute, then a value of unimpErr is
  2030. returned, indicating that these functions are not supported by the device.}
  2031. {
  2032. * AudioGetMute()
  2033. *
  2034. * Availability:
  2035. * Mac OS X: not available
  2036. * CarbonLib: not available
  2037. * Non-Carbon CFM: in SoundLib 3.0 and later
  2038. }
  2039. {
  2040. * AudioSetMute()
  2041. *
  2042. * Availability:
  2043. * Mac OS X: not available
  2044. * CarbonLib: not available
  2045. * Non-Carbon CFM: in SoundLib 3.0 and later
  2046. }
  2047. {AudioSetToDefaults causes the associated device to reset its volume and mute values
  2048. (and perhaps other characteristics, e.g. attenuation) to "factory default" settings}
  2049. {
  2050. * AudioSetToDefaults()
  2051. *
  2052. * Availability:
  2053. * Mac OS X: not available
  2054. * CarbonLib: not available
  2055. * Non-Carbon CFM: in SoundLib 3.0 and later
  2056. }
  2057. {This routine is required; it must be implemented by all audio components}
  2058. {
  2059. * AudioGetInfo()
  2060. *
  2061. * Availability:
  2062. * Mac OS X: not available
  2063. * CarbonLib: not available
  2064. * Non-Carbon CFM: in SoundLib 3.0 and later
  2065. }
  2066. {
  2067. * AudioGetBass()
  2068. *
  2069. * Availability:
  2070. * Mac OS X: not available
  2071. * CarbonLib: not available
  2072. * Non-Carbon CFM: in SoundLib 3.0 and later
  2073. }
  2074. {
  2075. * AudioSetBass()
  2076. *
  2077. * Availability:
  2078. * Mac OS X: not available
  2079. * CarbonLib: not available
  2080. * Non-Carbon CFM: in SoundLib 3.0 and later
  2081. }
  2082. {
  2083. * AudioGetTreble()
  2084. *
  2085. * Availability:
  2086. * Mac OS X: not available
  2087. * CarbonLib: not available
  2088. * Non-Carbon CFM: in SoundLib 3.0 and later
  2089. }
  2090. {
  2091. * AudioSetTreble()
  2092. *
  2093. * Availability:
  2094. * Mac OS X: not available
  2095. * CarbonLib: not available
  2096. * Non-Carbon CFM: in SoundLib 3.0 and later
  2097. }
  2098. {
  2099. * AudioGetOutputDevice()
  2100. *
  2101. * Availability:
  2102. * Mac OS X: not available
  2103. * CarbonLib: not available
  2104. * Non-Carbon CFM: in SoundLib 3.0 and later
  2105. }
  2106. {This is routine is private to the AudioVision component. It enables the watching of the mute key.}
  2107. {
  2108. * AudioMuteOnEvent()
  2109. *
  2110. * Availability:
  2111. * Mac OS X: not available
  2112. * CarbonLib: not available
  2113. * Non-Carbon CFM: in SoundLib 3.0 and later
  2114. }
  2115. const
  2116. kDelegatedSoundComponentSelectors = $0100;
  2117. { Sound Input Manager routines, uses _SoundDispatch }
  2118. {$ifc not TARGET_CPU_64}
  2119. {
  2120. * SPBVersion() *** DEPRECATED ***
  2121. *
  2122. * Availability:
  2123. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2124. * CarbonLib: in CarbonLib 1.0 and later
  2125. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2126. }
  2127. function SPBVersion: NumVersion; external name '_SPBVersion';
  2128. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2129. {
  2130. * SndRecord() *** DEPRECATED ***
  2131. *
  2132. * Availability:
  2133. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2134. * CarbonLib: in CarbonLib 1.0 and later
  2135. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2136. }
  2137. function SndRecord( filterProc: ModalFilterUPP; corner: Point; quality: OSType; var sndHandle: SndListHandle ): OSErr; external name '_SndRecord';
  2138. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2139. {$endc} {not TARGET_CPU_64}
  2140. {
  2141. * SndRecordToFile()
  2142. *
  2143. * Availability:
  2144. * Mac OS X: not available
  2145. * CarbonLib: not available
  2146. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2147. }
  2148. {$ifc not TARGET_CPU_64}
  2149. {
  2150. * SPBSignInDevice() *** DEPRECATED ***
  2151. *
  2152. * Availability:
  2153. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2154. * CarbonLib: in CarbonLib 1.0 and later
  2155. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2156. }
  2157. function SPBSignInDevice( deviceRefNum: SInt16; const (*var*) deviceName: Str255 ): OSErr; external name '_SPBSignInDevice';
  2158. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2159. {
  2160. * SPBSignOutDevice() *** DEPRECATED ***
  2161. *
  2162. * Availability:
  2163. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2164. * CarbonLib: in CarbonLib 1.0 and later
  2165. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2166. }
  2167. function SPBSignOutDevice( deviceRefNum: SInt16 ): OSErr; external name '_SPBSignOutDevice';
  2168. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2169. {
  2170. * SPBGetIndexedDevice() *** DEPRECATED ***
  2171. *
  2172. * Availability:
  2173. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2174. * CarbonLib: in CarbonLib 1.0 and later
  2175. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2176. }
  2177. function SPBGetIndexedDevice( count: SInt16; var deviceName: Str255; var deviceIconHandle: Handle ): OSErr; external name '_SPBGetIndexedDevice';
  2178. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2179. {
  2180. * SPBOpenDevice() *** DEPRECATED ***
  2181. *
  2182. * Availability:
  2183. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2184. * CarbonLib: in CarbonLib 1.0 and later
  2185. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2186. }
  2187. function SPBOpenDevice( const (*var*) deviceName: Str255; permission: SInt16; var inRefNum: SIGNEDLONG ): OSErr; external name '_SPBOpenDevice';
  2188. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2189. {
  2190. * SPBCloseDevice() *** DEPRECATED ***
  2191. *
  2192. * Availability:
  2193. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2194. * CarbonLib: in CarbonLib 1.0 and later
  2195. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2196. }
  2197. function SPBCloseDevice( inRefNum: SIGNEDLONG ): OSErr; external name '_SPBCloseDevice';
  2198. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2199. {
  2200. * SPBRecord() *** DEPRECATED ***
  2201. *
  2202. * Availability:
  2203. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2204. * CarbonLib: in CarbonLib 1.0 and later
  2205. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2206. }
  2207. function SPBRecord( inParamPtr: SPBPtr; asynchFlag: Boolean ): OSErr; external name '_SPBRecord';
  2208. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2209. {$endc} {not TARGET_CPU_64}
  2210. {
  2211. * SPBRecordToFile()
  2212. *
  2213. * Availability:
  2214. * Mac OS X: not available
  2215. * CarbonLib: not available
  2216. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2217. }
  2218. {$ifc not TARGET_CPU_64}
  2219. {
  2220. * SPBPauseRecording() *** DEPRECATED ***
  2221. *
  2222. * Availability:
  2223. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2224. * CarbonLib: in CarbonLib 1.0 and later
  2225. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2226. }
  2227. function SPBPauseRecording( inRefNum: SIGNEDLONG ): OSErr; external name '_SPBPauseRecording';
  2228. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2229. {
  2230. * SPBResumeRecording() *** DEPRECATED ***
  2231. *
  2232. * Availability:
  2233. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2234. * CarbonLib: in CarbonLib 1.0 and later
  2235. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2236. }
  2237. function SPBResumeRecording( inRefNum: SIGNEDLONG ): OSErr; external name '_SPBResumeRecording';
  2238. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2239. {
  2240. * SPBStopRecording() *** DEPRECATED ***
  2241. *
  2242. * Availability:
  2243. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2244. * CarbonLib: in CarbonLib 1.0 and later
  2245. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2246. }
  2247. function SPBStopRecording( inRefNum: SIGNEDLONG ): OSErr; external name '_SPBStopRecording';
  2248. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2249. {
  2250. * SPBGetRecordingStatus() *** DEPRECATED ***
  2251. *
  2252. * Availability:
  2253. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2254. * CarbonLib: in CarbonLib 1.0 and later
  2255. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2256. }
  2257. function SPBGetRecordingStatus( inRefNum: SIGNEDLONG; var recordingStatus: SInt16; var meterLevel: SInt16; var totalSamplesToRecord: UNSIGNEDLONG; var numberOfSamplesRecorded: UNSIGNEDLONG; var totalMsecsToRecord: UNSIGNEDLONG; var numberOfMsecsRecorded: UNSIGNEDLONG ): OSErr; external name '_SPBGetRecordingStatus';
  2258. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2259. {
  2260. * SPBGetDeviceInfo() *** DEPRECATED ***
  2261. *
  2262. * Availability:
  2263. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2264. * CarbonLib: in CarbonLib 1.0 and later
  2265. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2266. }
  2267. function SPBGetDeviceInfo( inRefNum: SIGNEDLONG; infoType: OSType; infoData: UnivPtr ): OSErr; external name '_SPBGetDeviceInfo';
  2268. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2269. {
  2270. * SPBSetDeviceInfo() *** DEPRECATED ***
  2271. *
  2272. * Availability:
  2273. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2274. * CarbonLib: in CarbonLib 1.0 and later
  2275. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2276. }
  2277. function SPBSetDeviceInfo( inRefNum: SIGNEDLONG; infoType: OSType; infoData: UnivPtr ): OSErr; external name '_SPBSetDeviceInfo';
  2278. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2279. {
  2280. * SPBMillisecondsToBytes() *** DEPRECATED ***
  2281. *
  2282. * Availability:
  2283. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2284. * CarbonLib: in CarbonLib 1.0 and later
  2285. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2286. }
  2287. function SPBMillisecondsToBytes( inRefNum: SIGNEDLONG; var milliseconds: SIGNEDLONG ): OSErr; external name '_SPBMillisecondsToBytes';
  2288. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2289. {
  2290. * SPBBytesToMilliseconds() *** DEPRECATED ***
  2291. *
  2292. * Availability:
  2293. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2294. * CarbonLib: in CarbonLib 1.0 and later
  2295. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2296. }
  2297. function SPBBytesToMilliseconds( inRefNum: SIGNEDLONG; var byteCount: SIGNEDLONG ): OSErr; external name '_SPBBytesToMilliseconds';
  2298. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2299. {
  2300. * SetupSndHeader() *** DEPRECATED ***
  2301. *
  2302. * Availability:
  2303. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2304. * CarbonLib: in CarbonLib 1.0 and later
  2305. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2306. }
  2307. function SetupSndHeader( sndHandle: SndListHandle; numChannels: SInt16; sampleRate: UnsignedFixed; sampleSize: SInt16; compressionType: OSType; baseNote: SInt16; numBytes: UNSIGNEDLONG; var headerLen: SInt16 ): OSErr; external name '_SetupSndHeader';
  2308. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2309. {
  2310. * SetupAIFFHeader() *** DEPRECATED ***
  2311. *
  2312. * Availability:
  2313. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2314. * CarbonLib: in CarbonLib 1.0 and later
  2315. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2316. }
  2317. function SetupAIFFHeader( fRefNum: SInt16; numChannels: SInt16; sampleRate: UnsignedFixed; sampleSize: SInt16; compressionType: OSType; numBytes: UNSIGNEDLONG; numFrames: UNSIGNEDLONG ): OSErr; external name '_SetupAIFFHeader';
  2318. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2319. { Sound Input Manager 1.1 and later calls, uses _SoundDispatch }
  2320. {
  2321. * ParseAIFFHeader() *** DEPRECATED ***
  2322. *
  2323. * Availability:
  2324. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2325. * CarbonLib: in CarbonLib 1.0 and later
  2326. * Non-Carbon CFM: in SoundLib 3.0 and later
  2327. }
  2328. function ParseAIFFHeader( fRefNum: SInt16; var sndInfo: SoundComponentData; var numFrames: UNSIGNEDLONG; var dataOffset: UNSIGNEDLONG ): OSErr; external name '_ParseAIFFHeader';
  2329. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2330. {
  2331. * ParseSndHeader() *** DEPRECATED ***
  2332. *
  2333. * Availability:
  2334. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2335. * CarbonLib: in CarbonLib 1.0 and later
  2336. * Non-Carbon CFM: in SoundLib 3.0 and later
  2337. }
  2338. function ParseSndHeader( sndHandle: SndListHandle; var sndInfo: SoundComponentData; var numFrames: UNSIGNEDLONG; var dataOffset: UNSIGNEDLONG ): OSErr; external name '_ParseSndHeader';
  2339. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2340. {$endc} {not TARGET_CPU_64}
  2341. {$ifc TARGET_API_MAC_CARBON}
  2342. { Only to be used if you are writing a sound input component; this }
  2343. { is the param block for a read request from the SoundMgr to the }
  2344. { sound input component. Not to be confused with the SPB struct }
  2345. { above, which is the param block for a read request from an app }
  2346. { to the SoundMgr. }
  2347. type
  2348. SndInputCmpParamPtr = ^SndInputCmpParam;
  2349. SICCompletionProcPtr = procedure( SICParmPtr: SndInputCmpParamPtr );
  2350. SndInputCmpParam = record
  2351. ioCompletion: SICCompletionProcPtr; { completion routine [pointer]}
  2352. ioInterrupt: SIInterruptProcPtr; { interrupt routine [pointer]}
  2353. ioResult: OSErr; { I/O result code [word]}
  2354. pad: SInt16;
  2355. ioReqCount: UNSIGNEDLONG;
  2356. ioActCount: UNSIGNEDLONG;
  2357. ioBuffer: Ptr;
  2358. ioMisc: Ptr;
  2359. end;
  2360. {$ifc not TARGET_CPU_64}
  2361. {
  2362. * SndInputReadAsync() *** DEPRECATED ***
  2363. *
  2364. * Availability:
  2365. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2366. * CarbonLib: not available
  2367. * Non-Carbon CFM: not available
  2368. }
  2369. function SndInputReadAsync( self: ComponentInstance; SICParmPtr: SndInputCmpParamPtr ): ComponentResult; external name '_SndInputReadAsync';
  2370. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2371. {
  2372. * SndInputReadSync() *** DEPRECATED ***
  2373. *
  2374. * Availability:
  2375. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2376. * CarbonLib: not available
  2377. * Non-Carbon CFM: not available
  2378. }
  2379. function SndInputReadSync( self: ComponentInstance; SICParmPtr: SndInputCmpParamPtr ): ComponentResult; external name '_SndInputReadSync';
  2380. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2381. {
  2382. * SndInputPauseRecording() *** DEPRECATED ***
  2383. *
  2384. * Availability:
  2385. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2386. * CarbonLib: not available
  2387. * Non-Carbon CFM: not available
  2388. }
  2389. function SndInputPauseRecording( self: ComponentInstance ): ComponentResult; external name '_SndInputPauseRecording';
  2390. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2391. {
  2392. * SndInputResumeRecording() *** DEPRECATED ***
  2393. *
  2394. * Availability:
  2395. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2396. * CarbonLib: not available
  2397. * Non-Carbon CFM: not available
  2398. }
  2399. function SndInputResumeRecording( self: ComponentInstance ): ComponentResult; external name '_SndInputResumeRecording';
  2400. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2401. {
  2402. * SndInputStopRecording() *** DEPRECATED ***
  2403. *
  2404. * Availability:
  2405. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2406. * CarbonLib: not available
  2407. * Non-Carbon CFM: not available
  2408. }
  2409. function SndInputStopRecording( self: ComponentInstance ): ComponentResult; external name '_SndInputStopRecording';
  2410. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2411. {
  2412. * SndInputGetStatus() *** DEPRECATED ***
  2413. *
  2414. * Availability:
  2415. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2416. * CarbonLib: not available
  2417. * Non-Carbon CFM: not available
  2418. }
  2419. function SndInputGetStatus( self: ComponentInstance; var recordingStatus: SInt16; var totalSamplesToRecord: UNSIGNEDLONG; var numberOfSamplesRecorded: UNSIGNEDLONG ): ComponentResult; external name '_SndInputGetStatus';
  2420. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2421. {
  2422. * SndInputGetDeviceInfo() *** DEPRECATED ***
  2423. *
  2424. * Availability:
  2425. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2426. * CarbonLib: not available
  2427. * Non-Carbon CFM: not available
  2428. }
  2429. function SndInputGetDeviceInfo( self: ComponentInstance; infoType: OSType; infoData: UnivPtr ): ComponentResult; external name '_SndInputGetDeviceInfo';
  2430. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2431. {
  2432. * SndInputSetDeviceInfo() *** DEPRECATED ***
  2433. *
  2434. * Availability:
  2435. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2436. * CarbonLib: not available
  2437. * Non-Carbon CFM: not available
  2438. }
  2439. function SndInputSetDeviceInfo( self: ComponentInstance; infoType: OSType; infoData: UnivPtr ): ComponentResult; external name '_SndInputSetDeviceInfo';
  2440. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2441. {
  2442. * SndInputInitHardware() *** DEPRECATED ***
  2443. *
  2444. * Availability:
  2445. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only] but deprecated in 10.5
  2446. * CarbonLib: not available
  2447. * Non-Carbon CFM: not available
  2448. }
  2449. function SndInputInitHardware( self: ComponentInstance ): ComponentResult; external name '_SndInputInitHardware';
  2450. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  2451. {$endc} {not TARGET_CPU_64}
  2452. { selectors for component calls }
  2453. const
  2454. kSndInputReadAsyncSelect = $0001;
  2455. kSndInputReadSyncSelect = $0002;
  2456. kSndInputPauseRecordingSelect = $0003;
  2457. kSndInputResumeRecordingSelect = $0004;
  2458. kSndInputStopRecordingSelect = $0005;
  2459. kSndInputGetStatusSelect = $0006;
  2460. kSndInputGetDeviceInfoSelect = $0007;
  2461. kSndInputSetDeviceInfoSelect = $0008;
  2462. kSndInputInitHardwareSelect = $0009;
  2463. {$endc} {TARGET_API_MAC_CARBON}
  2464. {$endc} {not TARGET_CPU_64}
  2465. {$endc} {TARGET_OS_MAC}
  2466. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  2467. end.
  2468. {$endc} {not MACOSALLINCLUDE}