diff --git a/demo/app.py b/demo/app.py index d89871e..d9fac7c 100644 --- a/demo/app.py +++ b/demo/app.py @@ -150,7 +150,7 @@ def gen_button_clicked(): speech_tokenizer, tone, ) - st.audio(speech, sample_rate=speech_model.config.sampling_rate) + st.audio(speech, sample_rate=44100) st.session_state.audio.append(speech) text = "" diff --git a/example_data/config.yaml b/example_data/config.yaml index 774e507..6415060 100644 --- a/example_data/config.yaml +++ b/example_data/config.yaml @@ -18,7 +18,6 @@ text_to_text_prompt: | "Speaker 1": "Sure! Imagine it like this...", "Speaker 2": "Oh, that's cool! But how does..." } -sampling_rate: 44100 speakers: - id: 1 name: Laura diff --git a/src/document_to_podcast/cli.py b/src/document_to_podcast/cli.py index a641269..18de858 100644 --- a/src/document_to_podcast/cli.py +++ b/src/document_to_podcast/cli.py @@ -26,7 +26,6 @@ def document_to_podcast( text_to_text_prompt: str = DEFAULT_PROMPT, text_to_speech_model: str = "parler-tts/parler-tts-mini-v1", speakers: list[Speaker] | None = None, - sampling_rate: int = 44100, from_config: str | None = None, ): """ @@ -65,9 +64,6 @@ def document_to_podcast( speakers (list[Speaker] | None, optional): The speakers for the podcast. Defaults to DEFAULT_SPEAKERS. - sampling_rate (int, optional): The sampling rate for the output audio. - Defaults to 44_100. - from_config (str, optional): The path to the config file. Defaults to None. If provided, all other arguments will be ignored. @@ -83,7 +79,6 @@ def document_to_podcast( text_to_text_prompt=text_to_text_prompt, text_to_speech_model=text_to_speech_model, speakers=[Speaker.model_validate(speaker) for speaker in speakers], - sampling_rate=sampling_rate, ) output_folder = Path(config.output_folder) @@ -148,7 +143,7 @@ def document_to_podcast( sf.write( str(output_folder / "podcast.wav"), np.concatenate(podcast_audio), - samplerate=sampling_rate, + samplerate=44100, ) (output_folder / "podcast.txt").write_text(podcast_script) logger.success("Done!") diff --git a/src/document_to_podcast/config.py b/src/document_to_podcast/config.py index 573eb07..ff892a4 100644 --- a/src/document_to_podcast/config.py +++ b/src/document_to_podcast/config.py @@ -86,4 +86,3 @@ class Config(BaseModel): "parler-tts/parler-tts-mini-v1.1", ] speakers: list[Speaker] - sampling_rate: int