[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SND resources
- To: info-mcl@cambridge.apple.com
- Subject: Re: SND resources
- From: ueda@shpcsl.sharp.co.jp (UEDA masaya)
- Date: Wed, 1 Jun 94 15:12:55 JST
- Cc: owens@vuse.vanderbilt.edu
Date: 31 May 1994 14:25:04 U
From: Steve_Casner@qmgate.arc.nasa.gov ("Steve Casner")
Newsgroups: comp.lang.lisp.mcl
Distribution: world
> do some animation while the sound plays in the background.
you need to do ASYNCHRONOUS sound play. the best way to do this
is to open your sound channel at startup (and leave it open) and then
call your SndPlay function whenever you need to. Pass a t argument
to the SndPlay function as the asynch arg (the last argument i think).
This is a sample code to play sound asynchronously.
; at startup
(setq quux
(rlet ((foo :ptr (%null-ptr)))
(#_SndNewChannel foo #$sampledSynth #$initMono (%null-ptr))
(%get-ptr foo)))
; async sound play
(defvar *quack*
(with-pstrs ((snd-name "quack"))
(#_getnamedresource "snd " snd-name)))
(dotimes (x 10) (#_SndPlay quux *quack* t))
(#_disposptr quux)
----- Thanks -----
Masaya UEDA ueda@shpcsl.sharp.co.jp
Information Technology Research Lab., SHARP Co.
2613-1 Ichinomoto, Tenri, Nara 632, JAPAN
TEL: +81-7436-5-2466 FAX: +81-7436-5-2163