Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!apple!claris!outpost.UUCP!peirce From: peirce@outpost.UUCP (Michael Peirce) Newsgroups: comp.sys.mac.programmer Subject: Re: Playing SND resources Message-ID: <0B010004.sef8uo@outpost.UUCP> Date: 21 Jan 91 18:43:03 GMT Reply-To: peirce@outpost.UUCP Organization: Peirce Software Lines: 33 X-Mailer: uAccess - Mac Release: 1.0.3 In article <1991Jan21.154725.15365@mthvax.cs.miami.edu>, rsherman@mthvax.cs.miami.edu (Roby Sherman) writes: > > Does anyone know of a short, no-nonsense routine to play a SND resource? I > don't have Inside Mac volume 5, so I have no idea how to make a Sound > Manager call! HELP! thanks... The simpliest was would be to do something like the following: PROCEDURE PlayMySound; CONST kMySoundID = -4065; VAR h : Handle; stat : OSErr; BEGIN IF TrapAvailable(_SndPlay, ToolTrap) THEN BEGIN h := GetResource('snd ',kMySoundID); IF h <> NIL THEN BEGIN HLock(h); stat := SndPlay(NIL,h,kSYNC); HUnlock(h); END; END; END; -- michael -- Michael Peirce -- outpost!peirce@claris.com -- Peirce Software -- Suite 301, 719 Hibiscus Place -- Macintosh Programming -- San Jose, California 95117 -- & Consulting -- (408) 244-6554, AppleLink: PEIRCE