Skip to content

Commit

Permalink
modularized local transport
Browse files Browse the repository at this point in the history
  • Loading branch information
chadbailey59 committed Apr 3, 2024
1 parent 75aba76 commit fff2479
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/dailyai/transports/local_transport.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import asyncio
import numpy as np
import tkinter as tk
import pyaudio

from dailyai.transports.threaded_transport import ThreadedTransport


class LocalTransport(ThreadedTransport):
def __init__(self, **kwargs):
super().__init__(**kwargs)
try:
global pyaudio
import pyaudio
except ModuleNotFoundError as e:
print(f"Exception: {e}")
print("In order to use the local transport, you'll need to `pip install pyaudio`. On MacOS, you'll also need to `brew install portaudio`.")
raise Exception(f"Missing module: {e}")
self._sample_width = kwargs.get("sample_width") or 2
self._n_channels = kwargs.get("n_channels") or 1
self._tk_root = kwargs.get("tk_root") or None
Expand Down

0 comments on commit fff2479

Please sign in to comment.