diff --git a/vocode/streaming/models/telephony.py b/vocode/streaming/models/telephony.py index a6b773f1d3..6df5910fe8 100644 --- a/vocode/streaming/models/telephony.py +++ b/vocode/streaming/models/telephony.py @@ -101,7 +101,6 @@ def default_synthesizer_config(): class VonageCallConfig(BaseCallConfig, type=CallConfigType.VONAGE.value): # type: ignore vonage_config: VonageConfig vonage_uuid: str - output_to_speaker: bool = False @staticmethod def default_transcriber_config(): diff --git a/vocode/streaming/output_device/vonage_output_device.py b/vocode/streaming/output_device/vonage_output_device.py index 53234e67c9..6ea0b13975 100644 --- a/vocode/streaming/output_device/vonage_output_device.py +++ b/vocode/streaming/output_device/vonage_output_device.py @@ -3,7 +3,6 @@ from fastapi import WebSocket from fastapi.websockets import WebSocketState -from vocode.streaming.output_device.blocking_speaker_output import BlockingSpeakerOutput from vocode.streaming.output_device.rate_limit_interruptions_output_device import ( RateLimitInterruptionsOutputDevice, ) @@ -19,19 +18,11 @@ class VonageOutputDevice(RateLimitInterruptionsOutputDevice): def __init__( self, ws: Optional[WebSocket] = None, - output_to_speaker: bool = False, ): super().__init__(sampling_rate=VONAGE_SAMPLING_RATE, audio_encoding=VONAGE_AUDIO_ENCODING) self.ws = ws - self.output_to_speaker = output_to_speaker - if output_to_speaker: - self.output_speaker = BlockingSpeakerOutput.from_default_device( - sampling_rate=VONAGE_SAMPLING_RATE, blocksize=VONAGE_CHUNK_SIZE // 2 - ) async def play(self, chunk: bytes): - if self.output_to_speaker: - self.output_speaker.consume_nonblocking(chunk) for i in range(0, len(chunk), VONAGE_CHUNK_SIZE): subchunk = chunk[i : i + VONAGE_CHUNK_SIZE] if len(subchunk) % 2 == 1: diff --git a/vocode/streaming/telephony/conversation/outbound_call.py b/vocode/streaming/telephony/conversation/outbound_call.py index 5570ebdf7e..9a14cbdf50 100644 --- a/vocode/streaming/telephony/conversation/outbound_call.py +++ b/vocode/streaming/telephony/conversation/outbound_call.py @@ -36,7 +36,6 @@ def __init__( digits: Optional[ str ] = None, # Keys to press when the call connects, see send_digits https://www.twilio.com/docs/voice/api/call-resource#create-a-call-resource - output_to_speaker: bool = False, ): self.base_url = base_url self.to_phone = to_phone @@ -49,7 +48,6 @@ def __init__( self.telephony_client = self.create_telephony_client() self.transcriber_config = self.create_transcriber_config(transcriber_config) self.synthesizer_config = self.create_synthesizer_config(synthesizer_config) - self.output_to_speaker = output_to_speaker self.sentry_tags = sentry_tags self.digits = digits @@ -115,7 +113,6 @@ async def start(self): vonage_uuid=self.telephony_id, from_phone=self.from_phone, to_phone=self.to_phone, - output_to_speaker=False, sentry_tags=self.sentry_tags, telephony_params=self.telephony_params, direction="outbound",