Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add no_timestamps flag #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const options = {
gen_file_subtitle: false, // outputs .srt file
gen_file_vtt: false, // outputs .vtt file
word_timestamps: true // timestamp for every word

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're missing a comma after true

no_timestamps: true // return only text
// timestamp_size: 0 // cannot use along with word_timestamps:true
}
}
Expand Down
8 changes: 5 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/whisper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const getFlags = (flags: IFlagTypes): string => {
if(flags.timestamp_size) s += " -ml " + String(flags.timestamp_size);
// input language
if(flags.language) s += " -l " + flags.language;
if(flags.no_timestamps) s += " -nt true ";

return s;
}
Expand Down Expand Up @@ -90,5 +91,6 @@ export type IFlagTypes = {
"gen_file_vtt"?: boolean,
"timestamp_size"?: number,
"word_timestamps"?: boolean,
"language"?: string
"language"?: string,
"no_timestamps"?: boolean,
}