Skip to content

feat: implement generate subtitles provider#381

Open
edward-ly wants to merge 2 commits into
mainfrom
feat/noid/stt-subtitles
Open

feat: implement generate subtitles provider#381
edward-ly wants to merge 2 commits into
mainfrom
feat/noid/stt-subtitles

Conversation

@edward-ly

@edward-ly edward-ly commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Requires nextcloud/server#61127 and nextcloud/assistant#577

Registers the app as a new provider for the core:audio2text:subtitles task, reusing the transcription API to produce output as .srt or .vtt files instead of just text. Lightly tested with an MP3 of this podcast episode.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@edward-ly edward-ly force-pushed the feat/noid/stt-subtitles branch 2 times, most recently from b446aa7 to 3c8362b Compare June 18, 2026 15:39
@edward-ly edward-ly marked this pull request as ready for review June 18, 2026 15:43

@lukasdotcom lukasdotcom left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A few comments. Also remember to fix the psalm error

Comment thread lib/AppInfo/Application.php
Comment thread lib/TaskProcessing/AudioToTextSubtitlesProvider.php
@edward-ly

edward-ly commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

A few comments. Also remember to fix the psalm error

Psalm is failing because nextcloud/server#61127 hasn't been merged yet. Once that changes, it should be green again, I think.

@lukasdotcom

lukasdotcom commented Jun 18, 2026

Copy link
Copy Markdown
Member

A few comments. Also remember to fix the psalm error

Psalm is failing because nextcloud/server#61127 hasn't been merged yet. Once that changes, it should be green again, I think.

If that fixes it we can wait until the server's pr is merged.

Comment on lines +115 to +117
// Maximum file size for OpenAI is 25MB. (https://developers.openai.com/api/docs/guides/speech-to-text)
if ($fileSize > 25 * 1000 * 1000) {
throw new ProcessingException('Filesize of input too large. Max is 25MB');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

would be nice to have this as a user-facing exception, same for the mimetype check below
see #383

'alloy', 'ash', 'ballad', 'coral', 'echo', 'fable',
'onyx', 'nova', 'sage', 'shimmer', 'verse'
];
public const DEFAULT_SUBTITLE_FORMAT = 'srt';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

seems unused

Comment on lines +57 to +59
public const DEFAULT_SUBTITLE_FORMATS = [
'srt', 'vtt'
];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: how does SUPPORTED_SUBTITLE_FORMATS sound? Default would imply it can be changed.

Signed-off-by: Edward Ly <contact@edward.ly>
@julien-nc julien-nc force-pushed the feat/noid/stt-subtitles branch from 3c8362b to a78dfe9 Compare June 24, 2026 09:49
…will get in nextcloud/ocp soon

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
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.

4 participants