[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Audio Glitch in Matlab
For the set-ups I've tried, I seem to get truncation clicks for everything on
Windows 7 and also the ASIO-based functions on Windows XP. [I wasn't able to
compile playrec successfully for Windows 7 and I haven't yet tried
If you want to measure exactly how many samples your machine is truncating, you
can play a signal that consists entirely of zeros except for a single "1" near
the end of the stimulus. If the "1" is presented, you'll hear a reassuring
click; if it's truncated; you'll get silence.
With ASIO, the amount truncated seems to depend reliably on the number of
samples presented. On my set-up, all complete blocks of 256 samples were
presented reliably, but the last incomplete block was truncated, i.e., the
number of truncated samples were mod(length(wave),256).
If I used Matlab's native functions with Windows 7, the amount truncated seemed
to have a random factors (and varied with the exact command used), but 40 ms of
silence at the end seemed to leave a big enough safety margin for everything.
It's not too much hardship to add 40 ms of silence to the end, especially if you
build it into a single function that adds the silence then presents the sound.
Alternative solutions include sticking with XP or switching to Macs...