Skip to content

Commit

Permalink
Drop sampling_rate param
Browse files Browse the repository at this point in the history
  • Loading branch information
daavoo committed Dec 12, 2024
1 parent 38f86e2 commit 615dfbc
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion demo/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""

Expand Down
1 change: 0 additions & 1 deletion example_data/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 1 addition & 6 deletions src/document_to_podcast/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
):
"""
Expand Down Expand Up @@ -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.
Expand All @@ -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)
Expand Down Expand Up @@ -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!")
Expand Down
1 change: 0 additions & 1 deletion src/document_to_podcast/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,3 @@ class Config(BaseModel):
"parler-tts/parler-tts-mini-v1.1",
]
speakers: list[Speaker]
sampling_rate: int

0 comments on commit 615dfbc

Please sign in to comment.