how do i disable the tts in the voicepipelineagent...
# ask-ai
l
how do i disable the tts in the voicepipelineagent ?
g
It might be possible to disable TTS in the
VoicePipelineAgent
by using a custom no-op TTS subclass. This approach could involve creating a TTS class that does nothing when its methods are called, effectively bypassing the TTS functionality. According to a Slack discussion, this method is considered a workaround. Would you like more details on how to implement this? Sources: - Slack discussion 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
l
@millions-hair-24956 how do i mute the tts in the voicepipelineagent ?
g
It seems likely that you can mute the TTS in the
VoicePipelineAgent
by implementing a custom no-op TTS subclass. This subclass would override the TTS methods to perform no actions, effectively muting the TTS output. This approach is suggested as a workaround in a Slack discussion. Would you like more detailed guidance on creating such a subclass? Sources: - Slack discussion 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
l
@millions-hair-24956 give me detailed guidance on how to do it
g
To mute the TTS in the
VoicePipelineAgent
, you can create a custom no-op TTS subclass that overrides the TTS methods to perform no actions. Here's a step-by-step guide on how to implement this: 1. Create a No-Op TTS Class: Define a new class that inherits from the base TTS class. Override the methods to do nothing. 2. Override the
synthesize
Method
: This method is responsible for generating speech. In your no-op class, you can override it to simply return without performing any action. 3. Integrate the No-Op TTS with
VoicePipelineAgent
: When initializing the
VoicePipelineAgent
, pass an instance of your no-op TTS class as the TTS parameter. Here's an example in Python:
Copy code
from livekit.agents.pipeline import VoicePipelineAgent
from livekit.agents.tts import TTS

# Define a no-op TTS class
class NoOpTTS(TTS):
    def synthesize(self, text: str):
        # Override to do nothing
        pass

# Initialize the VoicePipelineAgent with the no-op TTS
agent = VoicePipelineAgent(
    vad=your_vad_instance,
    stt=your_stt_instance,
    llm=your_llm_instance,
    tts=NoOpTTS(),  # Use the no-op TTS here
    chat_ctx=your_chat_context
)

# Start the agent
agent.start(your_room, your_participant)
This setup ensures that when the
VoicePipelineAgent
attempts to use TTS, it will call the
synthesize
method of the
NoOpTTS
class, which does nothing, effectively muting the TTS output. If you need further assistance or have specific questions about the implementation, feel free to ask! Sources: - https://docs.livekit.io/agents/voice-agent/voice-pipeline/ - https://livekit-users.slack.com/archives/C07FY8WHGPM/p1732746266.911239 Note: I wasn’t able to find highly relevant data sources, but above are a few potentially relevant links. 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
l
@millions-hair-24956 how can i make the room get access on the desktop audio output ?
g
To access desktop audio output in a LiveKit room, you can use the
createScreenTracks
method with the
audio
option set to
true
. This allows you to capture audio playing from a browser tab. Here's a basic example in JavaScript:
Copy code
const tracks = await localParticipant.createScreenTracks({ audio: true });
tracks.forEach((track) => {
  localParticipant.publishTrack(track);
});
Ensure that you select a browser tab and check "Share tab audio" during the screen sharing prompt to capture the audio output. This feature is supported in certain browsers, so check compatibility on MDN's compatibility table. Would you like more detailed guidance on this process? Sources: - Share browser audio 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.