kevhill
Bioengineer
- Jun 26, 2006
- 1
I am currently experiencing a very strange problem when trying to play back and record sounds using the daq toolbox and an Creative Audigy 2 ZS Platinum.
If I try to start a sound too quickly after the last sound has stopped, for example with the following code:
start(ai)
for rep=1:nreps;
putdata(ao,[outp outp]);
start(ao);
pause(length(outp)/fs+.05);
end;
data = getdata(ai);
any sound which is played within about ~250ms after another has ended will have a decaying amplitude. once the amplitude has decayed to zero, it jups right back to full amplitude. This isn't a speaker issue, but present even if I take the data directly from the SPDIF out to the input.
Now comes the very odd part of all of this. If I open up windows media player and play a sound and stop it, then run the same matlab script, I no longer get the odd decay, but now have a 4ms ramp at the begining of every sound. Furthermore if I close WMP, the behavior reverts to the post-sound decay!
This sounds like either some bad drivers (I have the latest release from creative and they haven't been very helpful so far) or perhaps some artifact of the way the toolkit initializes the sound card differently than WMP would? Anyone have any idea on how to fix this?
If I try to start a sound too quickly after the last sound has stopped, for example with the following code:
start(ai)
for rep=1:nreps;
putdata(ao,[outp outp]);
start(ao);
pause(length(outp)/fs+.05);
end;
data = getdata(ai);
any sound which is played within about ~250ms after another has ended will have a decaying amplitude. once the amplitude has decayed to zero, it jups right back to full amplitude. This isn't a speaker issue, but present even if I take the data directly from the SPDIF out to the input.
Now comes the very odd part of all of this. If I open up windows media player and play a sound and stop it, then run the same matlab script, I no longer get the odd decay, but now have a 4ms ramp at the begining of every sound. Furthermore if I close WMP, the behavior reverts to the post-sound decay!
This sounds like either some bad drivers (I have the latest release from creative and they haven't been very helpful so far) or perhaps some artifact of the way the toolkit initializes the sound card differently than WMP would? Anyone have any idea on how to fix this?