Skip to content

Commit

Permalink
[Bug-628] correct coding errors in the google synthesiser
Browse files Browse the repository at this point in the history
  • Loading branch information
jstahlbaum-fibernetics committed Jul 11, 2024
1 parent 48cba3e commit dab1947
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vocode/streaming/synthesizer/google_synthesizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import Any

import google.auth
from google.cloud import texttospeech as tts # type: ignore
from google.cloud import texttospeech_v1beta1 as tts # type: ignore

from vocode.streaming.models.message import BaseMessage
from vocode.streaming.models.synthesizer import GoogleSynthesizerConfig
Expand Down Expand Up @@ -34,7 +34,7 @@ def __init__(
# Select the type of audio file you want returned
self.audio_config = tts.AudioConfig(
audio_encoding=tts.AudioEncoding.LINEAR16,
sample_rate_hertz=24000,
sample_rate_hertz=synthesizer_config.sampling_rate,
speaking_rate=synthesizer_config.speaking_rate,
pitch=synthesizer_config.pitch,
effects_profile_id=["telephony-class-application"],
Expand Down Expand Up @@ -75,7 +75,7 @@ async def create_speech(
in_memory_wav.setnchannels(1)
in_memory_wav.setsampwidth(2)
in_memory_wav.setframerate(output_sample_rate)
in_memory_wav.writeframes(response.audio_content)
in_memory_wav.writeframes(response.audio_content[44:])
output_bytes_io.seek(0)

result = self.create_synthesis_result_from_wav(
Expand Down

0 comments on commit dab1947

Please sign in to comment.