How to use the psychtoolbox.audio.Stream.__init__ function in psychtoolbox

To help you get started, we’ve selected a few psychtoolbox examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github psychopy / psychopy / psychopy / sound / backend_ptb.py View on Github external
self.streams = []
        self.list = []
        # sound stream info
        self.sampleRate = sampleRate
        self.channels = 2
        self.duplex = duplex
        self.blockSize = blockSize
        self.label = getStreamLabel(sampleRate, channels, blockSize)
        if device == 'default':
            device = None
        self.sounds = []  # list of dicts for sounds currently playing
        self.takeTimeStamp = False
        self.frameN = 1
        # self.frameTimes = range(5)  # DEBUGGING: store the last 5 callbacks
        if not travisCI:  # travis-CI testing does not have a sound device
            audio.Stream.__init__(self, [], mode=mode+8,
                                  latency_class=audioLatencyClass,
                                  freq=sampleRate, channels=channels,
                                  )  # suggested_latency=suggestedLatency
            self.start(0, 0, 1)
            # self.device = self._sdStream.device
            # self.latency = self._sdStream.latency
            # self.cpu_load = self._sdStream.cpu_load
        self._tSoundRequestPlay = 0