Skip to content

Implement file to file external decoder - #4531

Merged
toots merged 17 commits into
mainfrom
decoder.file
Aug 4, 2025
Merged

toots merged 17 commits into
mainfrom
decoder.file

Conversation

@toots

@toots toots commented Jun 22, 2025

Copy link
Copy Markdown
Member

This PR creates a new type of external decoder that works at the file level.

Looking back, using external processes to handle live decoding inside the streaming loop was not a really smart idea. But it was also done before we had a fully fledged protocol resolution pipe line.

With this PR, we add a new type of protocol that operates at the file level. These protocols are checked when the request resolution return a local file and use file extension and mime types.

The protocol takes a local file and return a uri. This means that we can potentially kick back a annotate: uri to inline metadata decoding, typically something of the form: annotate:meta="value",...,:/path/to/decoded/file.wav

Files are decoded as part of the request resolution pipeline and the streaming loop can operate at the file level using an internal decoder without all the potential hangup of having to read/write from an external process. Woof!

On the user-facing API, we still name file-base protocol decoders. The old decoders are fully removed and we introduce a new decoder.add.

Being non backward-compatible simplifies the code a lot. The new decoders should be pretty easy to write if you're using the old decoder API.

@toots toots changed the title Implement file to file decoder Implement file to file external decoder Jun 22, 2025
@toots
toots marked this pull request as ready for review June 22, 2025 15:53
@toots
toots requested a review from smimram July 24, 2025 14:42
@toots toots added this to the 2.4.0 milestone Jul 24, 2025
@toots
toots added this pull request to the merge queue Aug 4, 2025
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 4, 2025
@toots
toots enabled auto-merge August 4, 2025 14:19
@toots
toots added this pull request to the merge queue Aug 4, 2025
Merged via the queue into main with commit 8310ee9 Aug 4, 2025
91 of 92 checks passed
@toots
toots deleted the decoder.file branch August 4, 2025 16:28
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.

1 participant