Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: incorrectly changed the base type in my last pull request for L… #1184

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

TheCodingLand
Copy link
Contributor

Fix base class of LocalAudioTransport

@markbackman
Copy link
Contributor

Good catch. Thank you.

Can you either set up Ruff for linting or install pre-commit hooks?

Copy link
Contributor

@markbackman markbackman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, just need to fix linting. The import order needs to be alphabetical.

@aconchillo
Copy link
Contributor

Ooops,my bad. 🤦‍♂️

@@ -26,7 +25,7 @@


async def main():
transport = LocalAudioTransport(TransportParams(audio_out_enabled=True))
transport = LocalAudioTransport(LocalTransportParams(audio_out_enabled=True))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is necessary. LocalTransportParams is a subclass of TransportParams. The actual audio_out_enabled is in TransportParams, so it seems fine to keep it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this change is correct.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SInce we are at it, it would be nice to make this params=LocalTransportParams(...) and force keyword in the contructor.

def __init__(self, *, params: LocalTransportParams):

@@ -41,7 +40,7 @@ async def say_something():
await asyncio.sleep(1)
await task.queue_frames([TTSSpeakFrame("Hello there, how is it going!"), EndFrame()])

runner = PipelineRunner()
runner = PipelineRunner(handle_sigint=False if sys.platform == "win32" else True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably drop this too. In general, Pipecat doesn't support Windows. We probably need a higher level message than just something in this demo.

Copy link
Contributor Author

@TheCodingLand TheCodingLand Feb 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

transport = LocalAudioTransport(TransportParams(audio_out_enabled=True))

Since the type of param LocalAudioTransport has changed, it's required to use the new class, since LocalAudioTransport now reads input_device_index and output_device_index to setup pyaudio.

TransportParams doesn't have the default value.
I could manage the case but seems inconsistent with the rest of the code where params are subclassed by service that requires specific parameters.

Any specific reason why pipecat doesnt support windows ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, only daily-python doesn't really support Windows. I'd say everything else supports Windows, even though I haven't personally tried it.

pipecat[whisper, openai]
textual==1.0.0
pydantic-settings==2.7.1
pyaudio==0.2.14
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can remove pyaudio and specify local option in pipecat

--extra-index-url https://download.pytorch.org/whl/cu124
torch==2.5.0+cu124
torchvision
torchaudio
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need all these torch imports?

@aconchillo
Copy link
Contributor

@TheCodingLand This is awesome!

@markbackman markbackman self-requested a review February 9, 2025 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants