[go: up one dir, main page]

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

Speaker info for WebVTT subtitles #1632

Closed
ashiagr opened this issue Aug 20, 2024 · 2 comments
Closed

Speaker info for WebVTT subtitles #1632

ashiagr opened this issue Aug 20, 2024 · 2 comments

Comments

@ashiagr
Copy link
ashiagr commented Aug 20, 2024

We're using WebvttParser() to parse WebVTT transcripts, which internally uses WebvttCueParser() to parse cues.
While WebvttCueParser.parseCueText(...) provides the payload with style formatting, it removes the speaker identifiers or the TAG_VOICE.

Can we get an in-built support for speaker info within the cues of WebVTT transcripts?

@icbaker
Copy link
Collaborator
icbaker commented Aug 20, 2024

I guess you're referring to this? https://www.w3.org/TR/webvtt1/#webvtt-cue-voice-span

We do have some code already that parses <v[voice="foo"]> tags in order to resolve the associated styles: https://github.com/search?q=repo%3Aandroidx%2Fmedia+path%3Avtt+voice&type=code

But the voice information isn't directly exposed in the resulting Cue object.

I suspect this would need to be exposed using a 'custom span' in Cue.text, like we do for Japanese rubies: https://github.com/androidx/media/blob/release/libraries/common/src/main/java/androidx/media3/common/text/RubySpan.java

I'll mark this as an enhancement. I'm afraid we are unlikely to work on this ourselves soon, but we would consider a high quality PR implementing this.

@icbaker
Copy link
Collaborator
icbaker commented Sep 2, 2024

Closing this because #1652 has been merged - thanks!

@icbaker icbaker closed this as completed Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants