Skip to content

Commit

Permalink
Fix!
Browse files Browse the repository at this point in the history
  • Loading branch information
dnhkng committed Jun 30, 2024
1 parent c04e3d8 commit 50f0c88
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
14 changes: 2 additions & 12 deletions glados.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from glados import asr, tts, vad
from glados.llama import LlamaServer, LlamaServerConfig


logger.remove(0)
logger.add(sys.stderr, level="INFO")

Expand Down Expand Up @@ -71,12 +70,8 @@ def from_yaml(cls, path: str, key_to_config: Sequence[str] | None = ("Glados",))
return cls(**config)




class Glados:



def __init__(
self,
voice_model: str,
Expand Down Expand Up @@ -149,8 +144,7 @@ def __init__(
if announcement:
audio = self._tts.generate_speech_audio(announcement)
logger.success(f"TTS text: {announcement}")
self.play_sound(audio, tts.RATE)

sd.play(audio, self._tts.rate)
if not self.interruptible:
sd.wait()

Expand Down Expand Up @@ -372,7 +366,7 @@ def process_TTS_thread(self):
total_samples = len(audio)

if total_samples:
self.play_sound(audio, tts.RATE)
sd.play(audio, self._tts.rate)

interrupted, percentage_played = self.percentage_played(
total_samples
Expand Down Expand Up @@ -411,10 +405,6 @@ def process_TTS_thread(self):
except queue.Empty:
pass

def play_sound(self, audio, rate) -> None:
sd.play(audio, rate, blocksize=2048)


def clip_interrupted_sentence(
self, generated_text: str, percentage_played: float
) -> str:
Expand Down
2 changes: 1 addition & 1 deletion submodules/llama.cpp
Submodule llama.cpp updated 110 files
2 changes: 1 addition & 1 deletion submodules/whisper.cpp
Submodule whisper.cpp updated 237 files

0 comments on commit 50f0c88

Please sign in to comment.