Welcome!

Sign in with your CogSci, Facebook, Google, or Twitter account.

Or register to create a new account.

We'll use your information only for signing in to this forum.

Supported by

Auditory timing accuracy on Mac

rrrrrr Posts: 78
edited March 2016 in Expyriment

Hello,

The question is about the auditory timing accuracy on Mac.

We try to repeatedly play a beep tone for 1000ms followed by no sounds for 1000ms.
At the each onsets, we send a trigger via Aruduino to the oscilloscope.

The data shows that the duration of tone is about 1200ms.

How to test more precisely?

Best,

Comments

  • rrrrrr Posts: 78
    edited 9:51AM

    Hello,

    Sorry, the long duration was due to a hardware problem.
    After solving it, the duration becomes correct.

    The latency was about 20 ms on average (almost same as windows).

    When we tested the auditory timing by using PyAudio, it seems more accurate.

    Is it possible to play any sounds by PyAudio in the functions of Expyriment?

    Best,

  • oliveroliver Posts: 10
    edited 9:51AM

    Dear rrr, I have forwarded your message to Florian, the Mac and sound expert in the Expyriment team. He will get back to you in the next week.

    Oliver

  • fladdfladd Posts: 75
    edited 9:51AM

    Dear rrr,

    audio timing is certainly a difficult issue which depends on many factors. In my personal experience, even with professional audio equipment, special drivers, a highly optimised system and dedicated software (e.g. for music production), stable audio latency will still be around 5-10 ms. This holds for Windows, OS X and even Linux. As you already mentioned, the audio system used in Expyriment cannot reach these low values, but can get close by decreasing the audio buffer (expyriment.control.defaults.audiosystem_buffer_size). Be aware though, that a too small audio buffer will result in a distorted audio signal. Unfortunately, Expyriment cannot guarantee low latencies and jitter free audio. Even worse, there is no easy (software) way for us to measure the latency (as we can for visual stimulus presentation in the Expyriment test suite). Depending on the application, however, a 20 ms latency (as you are measuring), can be perfectly acceptable.
    For the rare cases in which really timing critical audio presentations (e.g. millisecond precision) are required, I would in almost all cases suggest to use an external device (i.e. an audio sampler) to play the sound, which can be triggered from the Expyriment computer (e.g. via MIDI).
    Coming back to a software solution: If you have measured better results with PyAudio, then you should be able to use that together with Expyriment. Just make sure that you stop the Expyriment Audio system before, by calling (expyriment.control.stop_audio_system()).

    I hope this was helpful. Let me know if you have any further questions.

    Thanked by 1rrr

    Florian Krause (Developer)
    http://www.expyriment.org

  • rrrrrr Posts: 78

    Thanks a lot!

Sign In or Register to comment.