RAPID SEQUENCE of audioclips on a Mac
J. Scott Saults
SaultsJ at missouri.edu
Mon Jan 7 14:46:00 EST 2002
I appreciate hearing from Mike Brown and Geoff Canyon regarding audio
formats for playing in Revolution. I can confirm that 16-bit aiff
plays fine at several sampling rates, but 16-bit wave does not, at
least on a Mac. I'd gotten into a habit of using WAVE only under
Windows 98 simply because that format is required by externals
commands (the MCPsych DLLs) that I have to use to play sequences of
sounds in memory research software I've developed for PCs.
Unfortunately, the these DLLs are for Windows only. I 'd like to find
a solution for the Mac OS, or I may have to (reluctantly) either
abandon the Mac OS, or Revolution / Metacard, in my research. Let me
explain my difficulty accomplishing a seeming simple task in
Revolution.
For more than 12 years I've used HyperCard and SuperCard to present
sequences of sounds, usually recorded speech but occasionally tones,
to be used as stimuli in STM memory research. Arbitrary sequences of
up to 20 sound resources can be played by simply issuing a series of
'play' commands. While the first sound begins playing, the remaining
sounds are quickly loaded and cued to play in order, one immediately
after the other. This provides a reasonably clean, reliable and
precise sequence of sounds in which the onset-to-onset times,
determined by the duration of the digitized samples, can be
controlled within a few milliseconds. I can accomplish the same basic
task in Revolution on the PC only by using the external commands of
the MCPsych. DLLs, as far as I know. How can I do this in Revolution
on a Mac, with or (preferably) without external commands?
Simply put, this is my specific QUESTION:
In Revolutionn on a Mac, with or without help from external commands,
how can I play an arbitrary list of several different, brief (<250
ms) sounds so they are presented as a rapid (at least 4/second),
regular SEQUENCE.
In Revolutions on the my Mac, at least, the results of a simple
series of 'play' and 'wait' commands, like the following, are FAR too
slow and erratic. (Of course, without the waits, the successive play
commands simply interrupt each other, because Revolution cannot, to
my knowledge, cue the sounds.)
## soundList is just a list of names of the audioclips
put 250 into onsetToOnset
Repeat with i = 1 to 5
put milliseconds() into onsetTime
play line i of soundList
wait until milliseconds() - onsetTime > onsetToOnset
end repeat
Neither getting the milliseconds after the 'play' command, nor using
'wait until the sound is "done"' works any better in my tests.
Does anyone have any suggestions for how to accomplish this better?
Many thanks in advance for any new ideas.
Desperately seeking answers,
Scott Saults
J. Scott Saults, Ph.D.
Research Associate
email: SaultsJ at missouri.edu
Department of Psychology
210 McAlester Hall
More information about the use-livecode
mailing list