Skip to content

Add support for exporting labels in SubRip format - #383

Closed
Pokechu22 wants to merge 1 commit into
audacity:masterfrom
Pokechu22:subrip-labels
Closed

Pokechu22 wants to merge 1 commit into
audacity:masterfrom
Pokechu22:subrip-labels

Conversation

@Pokechu22

Copy link
Copy Markdown
Contributor

Not intended for the 2.3.3; this is just something I needed for my own use (for Wikimedia Commons) and now that I've implemented it, I might as well put it out.

This adds support for importing and exporting label track context in the format used by SubRip (with some weak documentation here), and also exporting in the related WebVVT format (but not importing due to the increased complexity of that format).

@JamesCrook

Copy link
Copy Markdown
Contributor

As a minimum this sequence should be made into a subroutine:

LabelFormat format = LabelFormat::TEXT;
if (fName.Right(4).CmpNoCase(wxT(".srt")) == 0) {
format = LabelFormat::SUBRIP;
} else if (fName.Right(4).CmpNoCase(wxT(".vtt")) == 0) {
format = LabelFormat::WEBVVT;
}

I think also that we need an #ifdef EXPERIMENTAL_SUBRIP_FORMATS. We should support import of our own exported SRT, even if we don't support the full WebVVT format. Closed for a resubmit with these corrections.

@JamesCrook JamesCrook closed this Oct 14, 2019
@Pokechu22

Copy link
Copy Markdown
Contributor Author

We should support import of our own exported SRT, even if we don't support the full WebVVT format.

Importing exported SRT files works; it's only WebVVT that can't be imported again.

@JamesCrook

Copy link
Copy Markdown
Contributor

OK.

@Pokechu22

Copy link
Copy Markdown
Contributor Author

As another note, I feel like there must already be some timestamp parsing code somewhere in audacity that I could re-use (since the UI has timestamps), but I couldn't find it.

@JamesCrook

Copy link
Copy Markdown
Contributor

The UI that draws the time ruler converts raw times into formatted timestamps. It does not do the reverse conversion.

@SteveDaulton

Copy link
Copy Markdown
Member

This looks like a very specialist use case, which would be better as an optional plug-in or module rather than a core feature. Could we at least discus this on the QA list?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants