Merge branch 'main' into tee-client

This commit is contained in:
John Sichi
2024-03-13 20:12:51 +09:00
2 changed files with 12 additions and 8 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ setup(
), ),
install_requires=[ install_requires=[
"PyAudio", "PyAudio",
"faster-whisper==0.10.0", "faster-whisper==1.0.1",
"torch", "torch",
"torchaudio", "torchaudio",
"websockets", "websockets",
+11 -7
View File
@@ -284,13 +284,17 @@ class TranscriptionTeeClient:
self.record_seconds = 60000 self.record_seconds = 60000
self.frames = b"" self.frames = b""
self.p = pyaudio.PyAudio() self.p = pyaudio.PyAudio()
self.stream = self.p.open( try:
format=self.format, self.stream = self.p.open(
channels=self.channels, format=self.format,
rate=self.rate, channels=self.channels,
input=True, rate=self.rate,
frames_per_buffer=self.chunk, input=True,
) frames_per_buffer=self.chunk,
)
except OSError as error:
print(f"[WARN]: Unable to access microphone. {error}")
self.stream = None
def __call__(self, audio=None, hls_url=None): def __call__(self, audio=None, hls_url=None):
""" """