Skip to content
This repository has been archived by the owner on Feb 23, 2021. It is now read-only.

Commit

Permalink
add voice param to buildAudiofromurl (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamarahills committed Nov 20, 2018
1 parent 63619f7 commit b86497d
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions command/CommandController.js
Expand Up @@ -373,7 +373,7 @@ async function processArticleRequest(
if (summaryOnly) {
audioUrl = await buildSummaryAudioFromUrl(req.body.url);
} else {
audioUrl = await buildAudioFromUrl(req.body.url);
audioUrl = await buildAudioFromUrl(req.body.url, process.env.POLLY_VOICE);
}

if (result) {
Expand Down Expand Up @@ -750,7 +750,10 @@ async function searchAndPlayArticle(
articleInfo.item_id
);
} else {
audioUrl = await buildAudioFromUrl(articleInfo.resolved_url);
audioUrl = await buildAudioFromUrl(
articleInfo.resolved_url,
process.env.POLLY_VOICE
);
}

await audioHelper.storeAudioFileLocation(
Expand Down Expand Up @@ -791,9 +794,13 @@ async function searchAndPlayArticle(
}
}

async function buildAudioFromUrl(url) {
async function buildAudioFromUrl(url, voice) {
let article = await getPocketArticleTextFromUrl(url);
return buildAudioFromText(`${article.article}`, `${article.resolved_id}`);
return buildAudioFromText(
`${article.article}`,
`${voice}`,
`${article.resolved_id}`
);
}

async function buildIntro(
Expand Down

0 comments on commit b86497d

Please sign in to comment.