Skip to content

Commit

Permalink
feat: smol changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeocodes committed Jun 16, 2023
1 parent f82a8b7 commit 7cd89aa
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/types/prerecordedTranscriptionResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ export class PrerecordedTranscriptionResponse {
};

/**
* Converts the transcription to the WebVTT format
* @remarks In order to translate the transcription to WebVTT, the utterances
* feature must be used.
* @returns A string with the transcription in the WebVTT format
* Returns a VTT formatted string based on the transcription response.
* @param {number} lineLength The maximum line length. Default: 8
* @returns {string}
*/
public toWebVTT(length = 14): string {
public toWebVTT(lineLength = 8): string {
if (!this.results || !this.results.utterances) {
throw new Error(
"This function requires a transcript that was generated with the utterances feature."
Expand Down Expand Up @@ -65,7 +64,7 @@ export class PrerecordedTranscriptionResponse {
};

this.results.utterances.forEach((utterance) => {
lines.push(limitedUtterance(utterance, length));
lines.push(limitedUtterance(utterance, lineLength));
});

return lines.join("\n");
Expand Down

0 comments on commit 7cd89aa

Please sign in to comment.