Fixed cutting end of sound, developing micro restreaming
This commit is contained in:
21
modules/restream/restream.py
Normal file
21
modules/restream/restream.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from gui.gui import Ui_MainWindow
|
||||
import sounddevice as sd
|
||||
from . import get_streaming_devices
|
||||
|
||||
|
||||
class Restreamer(object):
|
||||
def __init__(self):
|
||||
self.stream = sd.Stream()
|
||||
|
||||
@staticmethod
|
||||
def callback(indata, outdata, frames, time, status):
|
||||
if status:
|
||||
print(status)
|
||||
outdata[:] = indata
|
||||
|
||||
def restart(self, ui: Ui_MainWindow):
|
||||
self.stream.stop()
|
||||
self.stream = sd.Stream(device=(get_streaming_devices().input[ui.input_device_restream_box.currentText()],
|
||||
get_streaming_devices().output[ui.output_device_restream_box.currentText()]),
|
||||
callback=Restreamer.callback)
|
||||
self.stream.start()
|
||||
Reference in New Issue
Block a user