Skip to content

Commit

Permalink
deprecate output_to_speaker
Browse files Browse the repository at this point in the history
  • Loading branch information
ajar98 committed Jul 10, 2024
1 parent 21429a4 commit 2ff7c09
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 13 deletions.
1 change: 0 additions & 1 deletion vocode/streaming/models/telephony.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
9 changes: 0 additions & 9 deletions vocode/streaming/output_device/vonage_output_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand All @@ -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:
Expand Down
3 changes: 0 additions & 3 deletions vocode/streaming/telephony/conversation/outbound_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 2ff7c09

Please sign in to comment.