Audio Device Fails to respond, somethimes.

1 view (last 30 days)
Tim Mottram
Tim Mottram on 5 Sep 2011
Hi Guys, I was wondering about the origin of the "Audio Device fails to respond" error when using WAVRECORD? It seems to crop up when I sample over long periods of time, 4-5 minuets and above. Is it to do with a memory issue? Seems to happen with high sample frequencies as well.. Thanks in advance :) Tim

Answers (2)

Daniel Shub
Daniel Shub on 5 Sep 2011
The wavrecord function is Windows only. Windows handling of sound is crappy. To make matters worse, MATLAB's handling of sound is crappy. Finally, wavrecord is a depreciated function that doesn't use some of the newer and better underlying sound code. At a minimum switch to audiorecorder. Even better switch to something based on portaudio.
  1 Comment
Tim Mottram
Tim Mottram on 6 Sep 2011
Hi Daniel,
Thanks for your reply, is there a way to record for an exact amount of time (I could use record(r) then wait for say 10 secs but that seems imprecise). I am performing spectral analysis on the data so the time sampled for is very important to me. I also couldn't find anything in matlab about portaudio? I'm running 2010a if that helps.
Thanks in advance :)
Tim

Sign in to comment.


Walter Roberson
Walter Roberson on 6 Sep 2011
There is no known way to do anything in the Universe for an exact amount of time. Some of the leading theories are that time and space are quantized, whereas other important theories are that when you get to sufficiently small distances, time and distance become indeterminate and variable.
The situation in MATLAB is even worse: you cannot be sure of doing anything in MATLAB to within the nearest year of when you would like it done. Now, delays of multiple years are uncommon in MATLAB, but even in regular processing, the highest precision you should expect in normal operations is +/- 1/60th of a second.
If high accuracy of timestamping of audio is important to you, then you should switch to using an analog to digital convertor that has a built-in facility for time-stamping every sample: once it is time-stamped as it is received by the hardware that is running independently of the operating system, system busyness, interrupt latency, and buffering issues in transferring the data in to MATLAB become much less important.

Categories

Find more on Startup and Shutdown 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!