sequence length

This commit is contained in:
Brandon Thomas committed 2023-02-15 01:24:16 -05:00
1 parent 90aa091398
commit a735d3e972
2 files changed
+10

No files matched your search

@@ -8,8 +8,12 @@ pub struct Args <'a> {
// TODO: This will be multiple types in the future
pub news_story_token: &'a NewsStoryToken,
// 1-indexed offset of the audio file within the total speech
pub sequence_order: i64,
// Total number of wav file items in the speech
pub sequence_length: i64,
pub tts_voice_identifier: &'a TtsModelToken,
pub full_text: &'a str,
@@ -30,6 +34,7 @@ INSERT INTO tts_render_tasks(
story_type,
story_token,
sequence_order,
sequence_length,
tts_service,
tts_voice_identifier,
full_text
@@ -39,6 +44,7 @@ VALUES (
"news_story",
?,
?,
?,
"fakeyou",
?,
?
@@ -47,6 +53,7 @@ VALUES (
tts_render_task_token,
news_story_token,
args.sequence_order,
args.sequence_length,
tts_voice_identifier,
args.full_text
);
@@ -49,12 +49,15 @@ pub async fn process_single_item(target: &NewsStoryProductionItem, job_state: &A
// NB: John Madden voice model
let tts_model_token = TtsModelToken::new_from_str("TM:30ha2t6bxfn4");
let sequence_length = paragraphs.len() as i64;
for (i, paragraph) in paragraphs.iter().enumerate() {
let sequence_order = (i + 1) as i64;
insert_tts_render_task(InsertArgs {
news_story_token: &target.news_story_token,
sequence_order,
sequence_length,
tts_voice_identifier: &tts_model_token,
full_text: &paragraph,
sqlite_pool: &job_state.sqlite_pool,