Hello there,
I've been struggling with this for a while now. I want to be able to
play a tone and let the user decide when to shut the tone off by
pressing a key without any clicks. Obviously, a click occurs if I just
interrupt playback with a PsychPortAudio('Stop') command after a keypress.
The closest I've come is by using something similar to the fade-out
method at the end of the BasicAMAndMixScheduleDemo file. My code is:
tic
while toc < .2
ramp = 1 - (toc*5);
PsychPortAudio('Volume', pahandle, ramp);
end
PsychPortAudio('Stop', pahandle);
Unfortunately, because this ramps so quickly (200 milliseconds is about
as slow as I can afford), I get easily audible noise artifacts as it
ramps. How else can I achieve my goal of being able to stop a tone in
real time without a click?
I'm on Windows 7 using Asio4all with crummy default laptop audio audio
drivers.
Thank you for any help,
Andy
I've been struggling with this for a while now. I want to be able to
play a tone and let the user decide when to shut the tone off by
pressing a key without any clicks. Obviously, a click occurs if I just
interrupt playback with a PsychPortAudio('Stop') command after a keypress.
The closest I've come is by using something similar to the fade-out
method at the end of the BasicAMAndMixScheduleDemo file. My code is:
tic
while toc < .2
ramp = 1 - (toc*5);
PsychPortAudio('Volume', pahandle, ramp);
end
PsychPortAudio('Stop', pahandle);
Unfortunately, because this ramps so quickly (200 milliseconds is about
as slow as I can afford), I get easily audible noise artifacts as it
ramps. How else can I achieve my goal of being able to stop a tone in
real time without a click?
I'm on Windows 7 using Asio4all with crummy default laptop audio audio
drivers.
Thank you for any help,
Andy