Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if self.sndArr.shape[1] == 1:
self.stereo = 0
elif self.sndArr.shape[1] == 2:
self.stereo = 1
else:
raise IOError("Couldn't determine whether array is "
"stereo. Shape={}".format(self.sndArr.shape))
self._nSamples = thisArray.shape[0]
if self.stopTime == -1:
self.stopTime = self._nSamples / float(self.sampleRate)
# set to run from the start:
self.seek(0)
self.sourceType = "array"
if not self.track: # do we have one already?
self.track = audio.Slave(self.stream.handle, data=self.sndArr,
volume=self.volume)
else:
self.track.stop()
self.track.fill_buffer(self.sndArr, start_index=1)