home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!gatech!utkcs2!utkux1.utk.edu!danny@utkux1.utk.edu
- From: danny@utkux1.utk.edu (Danny W. McCampbell)
- Subject: Still trying to get this stupid sound stuff to work...
- Message-ID: <1992Aug26.192610.14018@utkux1.utk.edu>
- Sender: usenet@utkux1.utk.edu (USENET News System)
- Organization: University of Tennessee
- Date: Wed, 26 Aug 1992 19:26:10 GMT
- Lines: 44
-
- Will someone tell me what I can do to this code to cause the sound
- to play transparently. What I mean is after the sound starts playing
- a modal dialog is brought up. I want the user to be able to click
- in the dialog and when he/she does the sound stops and the dialog
- disappears. What is happening now is the sound sound starts playing,
- the dialog comes up, but you cannot do anything until the sound
- finishes. Check it out:
-
- unit Sounds;
-
- interface
- uses
- Sound;
- procedure PlaySound;
-
- implementation
- procedure PlaySound;
- const
- kAsync = true;
- soundID = 128;
- var
- err: OSErr;
- mySndHandle: Handle;
- mySndChan: SndChannelPtr;
-
- begin
- mySndChan := nil;
- mySndHandle := GetResource('snd ', soundID);
- if mySndHandle <> nil then
- begin
- err := SndPlay(mySndChan, mySndHandle, kAsync);
- if err <> noErr then
- ExitToShell;
- end;
- end;
- end.
-
- I call sound play when the user chooses the about item from my program
- from the AppleMenu. Then I bring up a modal dialog. What can I
- do to get what I mentioned above to happen. Thanks in advance.
-
- Danny McCampbell
-
-
-