Open
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #93 +/- ##
==========================================
+ Coverage 76.32% 78.98% +2.66%
==========================================
Files 8 13 +5
Lines 1246 1680 +434
==========================================
+ Hits 951 1327 +376
- Misses 264 310 +46
- Partials 31 43 +12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This ports the decoder-side SILK output resampler from the RFC reference implementation into a dedicated Go subpackage and wires the Opus decoder to resample SILK output directly to the caller's requested output rate.
The branch removes the old naive sample-repetition path and replaces it with the RFC-style decoder resampler state, delay handling, and per-ratio FIR/IIR paths.
Public API
This PR updates the public decoder API so callers can request a specific output sample rate and channel count instead of relying on the old fixed behavior:
NewDecoderWithOutput(sampleRate, channels)(*Decoder).Init(sampleRate, channels)to validate and store the requested output formatDecodeToInt16andDecodeToFloat32helpers that return samples-per-channelDecode/DecodeFloat32use the configured output format before converting to the public PCM buffersThat aligns the exposed API with the output rates exercised by the RFC conformance flow: 8, 12, 16, 24, or 48 kHz, mono or stereo.
RFC Alignment
Where possible, this follows the RFC/reference implementation directly:
Relevant references:
Implementation Notes
internal/resample/silkas a Go port of the RFC SILK decoder resamplerDecoderso mono/stereo SILK output can be resampled without reinitializing every packetValidation
go test ./...go test -race ./...golangci-lint run, but the tool currently fails in this environment before analysis withcontext loading failed: no go files to analyze