How can I play an audio signal such that the command-to-sound delay is consistent (<1–2 us)?
10 views (last 30 days)
Show older comments
Hello!
I'm looking for a way, preferably in MATLAB, to play a sound with a consistent delay between the code saying "Play!" and the sound starting to play. By "consistent," I mean a delay that doesn't differ by more than one or two microseconds from one trial to the next. Any ideas would be great, thanks very much!
Alex
2 Comments
Answers (1)
Walter Roberson
on 12 Jan 2012
This cannot be done in MATLAB, and is unlikely to ever be supported.
MATLAB runs on general-purpose operating systems (such as MS Windows and Linux) which do not offer any promises that the process will not be swapped out or that the CPU will not be given over to another process, or that something else (e.g., disk i/o) will not take CPU's attention dealing with interrupts or DMA.
Real-time guarantees like this require OS and hardware cooperation.
One company that did a fair bit of work on making meaningful audio synchronization available through user calls, was SGI.
2 Comments
Walter Roberson
on 26 Jan 2012
Unfortunately the SGI equipment I am thinking of has not been made in years. I do not know whether they brought the library in to Linux.
See Also
Categories
Find more on Audio I/O and Waveform Generation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!