Howdy, Stranger!

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

Supported by

Detecting voice onsets (voicekey)

2»

Comments

  • Hello @sebastiaan,

    (Sorry for my delayed reply.)

    thank you for your latest hint. I first, as you mentioned earlier, copied all the DLL files to the OS folder, and I fortunately didn't get an error message anymore! So I didn't try to run OS as admin.

    To sum up -

    • I put from psychopy import voicekey in the very beginning of my exp (in the prepare phase of an inline script) to activate the voicekey. There I also added class _BaseVoiceKey(object)[...] to activate the abstract base class for virtual voice-keys.
    • In the sequence (in which I want to measure voice onsets), right as first item, i put the following code for the class for speech onset detection (inline script, run phase):
    class OnsetVoiceKey(_BaseVoiceKey):
        """Class for speech onset detection.
    
        Uses bandpass-filtered signal (100-3000Hz). When the voice key trips,
        the best voice-onset RT estimate is saved as `self.event_onset`, in sec.
    
        """
    
    def detect(self):
            """Trip if recent audio power is greater than the baseline.
            """
            if self.event_detected or not self.baseline:
                return
            window = 5  # recent hold duration window, in chunks
            threshold = 10 * self.baseline
            conditions = all([x > threshold for x in self.power_bp[-window:]])
            if conditions:
                self.event_lag = window * self.msPerChunk / 1000.
                self.event_onset = self.elapsed - self.event_lag
                self.trip()
                self.event_time = self.event_onset
    

    What exactly does "... is saved as 'self.event_onset'" mean here?

    How can it be written into the logfile?

    Thanks in advance,

    plex84

  • Hi @plex84 ,

    It seems that you're trying to implement your own OnsetVoiceKey class by inheriting from BaseVoiceKey . Unless you have a good reason to do that (?), this isn't necessary because this class already exists. So in theory it should be as simple as:

    from psychopy.voicekey import OnsetVoiceKey
    
    vk = OnsetVoiceKey(sec=3)
    vk.detect()
    

    And then the onset time should be available as:

    vk.event_onset
    

    That being said, for me this is only theory, because I haven't gotten this to work, neither on Ubuntu or Windows. It seems that PsychoPy's Voicekey relies on libraries that are pretty fragile. Given the proper configuration, I'm sure it works, but I just haven't managed to so far.

    — Sebastiaan

    Buy Me A Coffee

  • Hi @sebastiaan,

    thanks for your answer. I put your latest script in the inline script and the following error message occurred:

    File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\inline_script.py", line 116, in run
       self.workspace._exec(self.crun)
     File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\base_python_workspace.py", line 124, in _exec
       exec(bytecode, self._globals)
     Inline script, line 3, in <module>
     File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\psychopy\voicekey\__init__.py", line 112, in __init__
       raise VoiceKeyException(msg)
    psychopy.voicekey.VoiceKeyException: Need a running pyo server: call voicekey.pyo_init()
    

    (Sidenote: Pyo was installed as admin a few weeks ago.)

    plex84

  • Hi @plex84 ,

    I got the same error. A proposed solution is already in the error message, namely to call the following somewhere at the start of the experiment:

    from psychopy.voicekey import pyo_init
    pyo_init()
    

    You can try that. However, this didn't work for me either.

    — Sebastiaan

    Buy Me A Coffee

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