Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, rate, chunk, chans=1):
self.stream = sounddevice.RawStream(samplerate = int(rate), channels = chans,
callback = self._callback, dtype='int16', blocksize=chunk)
self.queue = queue.Queue()
def __init__(self, sample_rate, sample_width, block_size, flush_size):
if sample_width == 2:
audio_format = 'int16'
else:
raise Exception('unsupported sample width:', sample_width)
self._audio_stream = sd.RawStream(
samplerate=sample_rate, dtype=audio_format, channels=1,
blocksize=int(block_size/2), # blocksize is in number of frames.
)
self._block_size = block_size
self._flush_size = flush_size
self._sample_rate = sample_rate
def __init__(self, sample_rate, sample_width, block_size, flush_size):
if sample_width == 2:
audio_format = 'int16'
else:
raise Exception('unsupported sample width:', sample_width)
self._audio_stream = sd.RawStream(
samplerate=sample_rate, dtype=audio_format, channels=1,
blocksize=int(block_size/2), # blocksize is in number of frames.
)
self._block_size = block_size
self._flush_size = flush_size
self._sample_rate = sample_rate
def __init__(self, sample_rate, sample_width, block_size, flush_size, procedural_audio_wave):
self.ue_procedural_audio_wave = procedural_audio_wave
self.ue_procedural_audio_wave.SampleRate = sample_rate
self.ue_procedural_audio_wave.NumChannels = 1
self.ue_procedural_audio_wave.Duration = 10000.0
self.ue_procedural_audio_wave.SoundGroup = 4
self.ue_procedural_audio_wave.bLooping = False
if sample_width == 2:
audio_format = 'int16'
else:
raise Exception('unsupported sample width:', sample_width)
self._system_audio_stream = sd.RawStream(
samplerate=sample_rate, dtype=audio_format, channels=1,
blocksize=int(block_size/2), # blocksize is in number of frames.
)
self._block_size = block_size
self._flush_size = flush_size
self._sample_rate = sample_rate