Skip to content

Commit

Permalink
uses .value instead of passing enum for sampling rate (#613)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajar98 committed Jul 5, 2024
1 parent 9904cd6 commit f84cd03
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion vocode/streaming/models/synthesizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class BarkSynthesizerConfig(SynthesizerConfig, type=SynthesizerType.BARK.value):

DEFAULT_POLLY_LANGUAGE_CODE = "en-US"
DEFAULT_POLLY_VOICE_ID = "Matthew"
DEFAULT_POLLY_SAMPLING_RATE = SamplingRate.RATE_16000
DEFAULT_POLLY_SAMPLING_RATE = SamplingRate.RATE_16000.value


class PollySynthesizerConfig(SynthesizerConfig, type=SynthesizerType.POLLY.value): # type: ignore
Expand Down
4 changes: 2 additions & 2 deletions vocode/streaming/telephony/constants.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from vocode.streaming.models.audio import AudioEncoding, SamplingRate

# TODO(EPD-186): namespace as Twilio
DEFAULT_SAMPLING_RATE = SamplingRate.RATE_8000
DEFAULT_SAMPLING_RATE: int = SamplingRate.RATE_8000.value
DEFAULT_AUDIO_ENCODING = AudioEncoding.MULAW
DEFAULT_CHUNK_SIZE = 20 * 160
MULAW_SILENCE_BYTE = b"\xff"

VONAGE_SAMPLING_RATE = SamplingRate.RATE_16000
VONAGE_SAMPLING_RATE: int = SamplingRate.RATE_16000.value
VONAGE_AUDIO_ENCODING = AudioEncoding.LINEAR16
VONAGE_CHUNK_SIZE = 640 # 20ms at 16kHz with 16bit samples
VONAGE_CONTENT_TYPE = "audio/l16;rate=16000"
Expand Down

0 comments on commit f84cd03

Please sign in to comment.