Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[solved] Temporal Jitter in auditory stimuli presentation with pyaudio

edited December 2015 in OpenSesame

Hello,

I'm preparing an experiment with sequences of four audio stimuli at 200ms each. So, each sequence has a duration 4x200ms = 800ms. At first I used a sampler item specifying the sound file: [sound1].wav, where "sound1" is the first column in my experiment loop. The result was fine but after reading in the documentation that is preferable to use pyaudio ("if you require very accurate temporal precision when presenting auditory stimuli you may want to write an inline_script that plays back sound using a different module, such as PyAudio.") I decided to change the implementation. So I followed the example presented here: http://people.csail.mit.edu/hubert/pyaudio/. I used the "play" example and I changed only this part to fit my experiment:

# inline_script item

OUTPUT_FILE = "/Users/test/Documents/OpenSesame/SESSION_B_2.opensesame/pool/%s.wav" % self.get('sound1')

wf = wave.open(OUTPUT_FILE, 'rb')

Once I finished the implementation and I run the experiment, there was definitely a noticeable delay in the stimuli presentation.

I chose pyaudio to avoid any temporal jitter and finally the result was worse. Is there something wrong with my implementation? Thank you very much!

Comments

  • edited 8:55AM

    Hi,

    It seems like you're doing everything right, but also like you're confusing jitter and delay (or latency).

    • jitter is variability in playback onset. For example, if playback is sometimes delayed by 10 ms, and sometimes by 200 ms, then jitter is high; however, if playback is always delayed by about 200 ms then jitter is low.
    • delay is the time between the moment that you want playback to start, and the moment that playback actually starts. This can be very high, but stable, in which case you have a high delay with little jitter.

    What you're noticing is, I assume, a high delay. In my experience, pyaudio generally has a lower jitter than pygame for sound playback, even though the delay may the same or higher. Does that make sense? I should also point out that this is my general experience, and may not be the case on all systems--it's really a matter of testing what works best.

    Cheers!
    Sebastiaan

    Buy Me A Coffee

  • edited 8:55AM

    Hi Sebastiaan,

    Thank you for you immediate response!
    You are right delay is the appropriate term for what I notice and it is actually high. So, after trying both pygame & pyaudio I will go for the first one which works best.
    I assume we can consider the issue resolved.

    Cheers!

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games