コード例 #1
0
    def __init__(self, exp, parentName, name='mic_1',
                 startType='time (s)', startVal=0.0,
                 stopType='duration (s)', stopVal=2.0, startEstim='',
                 durationEstim='', stereo=False):
        super(MicrophoneComponent, self).__init__(
            exp, parentName, name=name,
            startType=startType, startVal=startVal,
            stopType=stopType, stopVal=stopVal,
            startEstim=startEstim, durationEstim=durationEstim)

        self.type = 'Microphone'
        self.url = "http://www.psychopy.org/builder/components/microphone.html"
        self.exp.requirePsychopyLibs(['microphone'])

        # params
        msg = _translate(
            "Record two channels (stereo) or one (mono, smaller file)")
        self.params['stereo'] = Param(
            stereo, valType='bool',
            hint=msg,
            label=_localized['stereo'])

        self.params['stopType'].allowedVals = ['duration (s)']

        msg = _translate(
            'The duration of the recording in seconds; blank = 0 sec')
        self.params['stopType'].hint = msg
コード例 #2
0
    def __init__(
        self,
        exp,
        parentName,
        name="mic_1",
        startType="time (s)",
        startVal=0.0,
        stopType="duration (s)",
        stopVal=2.0,
        startEstim="",
        durationEstim="",
        stereo=False,
    ):
        super(MicrophoneComponent, self).__init__(
            exp,
            parentName,
            name=name,
            startType=startType,
            startVal=startVal,
            stopType=stopType,
            stopVal=stopVal,
            startEstim=startEstim,
            durationEstim=durationEstim,
        )

        self.type = "Microphone"
        self.url = "http://www.psychopy.org/builder/components/microphone.html"
        self.exp.requirePsychopyLibs(["microphone"])

        # params
        msg = _translate("Record two channels (stereo) or one (mono, smaller file)")
        self.params["stereo"] = Param(stereo, valType="bool", hint=msg, label=_localized["stereo"])

        self.params["stopType"].allowedVals = ["duration (s)"]

        msg = _translate("The duration of the recording in seconds; blank = 0 sec")
        self.params["stopType"].hint = msg
コード例 #3
0
# Part of the PsychoPy library
# Copyright (C) 2015 Jonathan Peirce
# Distributed under the terms of the GNU General Public License (GPL).

# Author: Jeremy R. Gray, 2012

from os import path
from _base import BaseComponent, Param, getInitVals, _translate

# the absolute path to the folder containing this path
thisFolder = path.abspath(path.dirname(__file__))
iconFile = path.join(thisFolder, 'microphone.png')
tooltip = _translate('Microphone: basic sound capture (fixed onset & '
                     'duration), okay for spoken words')

_localized = {'stereo': _translate('Stereo')}


class MicrophoneComponent(BaseComponent):
    """An event class for capturing short sound stimuli"""
    categories = ['Responses']

    def __init__(self, exp, parentName, name='mic_1',
                 startType='time (s)', startVal=0.0,
                 stopType='duration (s)', stopVal=2.0, startEstim='',
                 durationEstim='', stereo=False):
        super(MicrophoneComponent, self).__init__(
            exp, parentName, name=name,
            startType=startType, startVal=startVal,
            stopType=stopType, stopVal=stopVal,
            startEstim=startEstim, durationEstim=durationEstim)
コード例 #4
0
# Part of the PsychoPy library
# Copyright (C) 2015 Jonathan Peirce
# Distributed under the terms of the GNU General Public License (GPL).

# Author: Jeremy R. Gray, 2012

from os import path
from _base import BaseComponent, Param, getInitVals, _translate

# the absolute path to the folder containing this path
thisFolder = path.abspath(path.dirname(__file__))
iconFile = path.join(thisFolder, "microphone.png")
tooltip = _translate("Microphone: basic sound capture (fixed onset & " "duration), okay for spoken words")

_localized = {"stereo": _translate("Stereo")}


class MicrophoneComponent(BaseComponent):
    """An event class for capturing short sound stimuli"""

    categories = ["Responses"]

    def __init__(
        self,
        exp,
        parentName,
        name="mic_1",
        startType="time (s)",
        startVal=0.0,
        stopType="duration (s)",
        stopVal=2.0,