feat: implement smart chunking with custom Silero VAD#14
Closed
Signal46 wants to merge 3 commits intocjpais:mainfrom
Closed
feat: implement smart chunking with custom Silero VAD#14Signal46 wants to merge 3 commits intocjpais:mainfrom
Signal46 wants to merge 3 commits intocjpais:mainfrom
Conversation
- Implements [SmartChunker](cci:2://file:///c:/transcribe-rs/transcribe-rs_SmartChunking/src/chunking.rs:5:0-5:24) in [src/chunking.rs](cci:7://file:///c:/transcribe-rs/transcribe-rs_SmartChunking/src/chunking.rs:0:0-0:0) to split audio on silence. - Adds [src/vad.rs](cci:7://file:///c:/transcribe-rs/transcribe-rs_SmartChunking/src/vad.rs:0:0-0:0) with a custom, lightweight [SileroVad](cci:2://file:///c:/transcribe-rs/transcribe-rs_SmartChunking/src/vad.rs:6:0-11:1) wrapper using `ort` and `ndarray` to avoid dependency conflicts. - Exposes [transcribe_with_smart_chunking](cci:1://file:///c:/transcribe-rs/transcribe-rs_SmartChunking/src/lib.rs:204:4-228:5) in the [TranscriptionEngine](cci:2://file:///c:/transcribe-rs/transcribe-rs_SmartChunking/src/lib.rs:125:0-229:1) trait. - Adds [tests/smart_chunking.rs](cci:7://file:///c:/transcribe-rs/transcribe-rs_SmartChunking/tests/smart_chunking.rs:0:0-0:0) to verify VAD and chunking logic. - Updates [Cargo.toml](cci:7://file:///c:/transcribe-rs/transcribe-rs_SmartChunking/Cargo.toml:0:0-0:0) with necessary dependencies (`anyhow`, `ndarray`, `reqwest` for tests). - Updates `.gitignore` to exclude `*.onnx` model files.
Add progress callback parameter for real-time progress reporting Fix VAD sample rate input type from f32 to i64 (resolves the "Unexpected input data type" error) Update TranscriptionEngine trait signature
Owner
|
First I wanna say thank you for this. I really appreciate you porting the code to make a PR here. I did skim the code this morning. I think there's some minor things I will want to tweak, but I want to simmer on them for a few days. Just as I think about the overall architecture of this library and how ultimately it will be used. |
- Implement `decode_and_resample` to support various audio formats (MP3, M4A, etc.) - Update `transcribe_file` to use the new decoder, enabling native support for non-WAV files - Add `symphonia` and `rubato` dependencies
Owner
|
this is on my todo, but that list is long right now, i will review when I can! |
Owner
|
#67 supersedes this |
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.
Per discussion in cjpais/Handy#381
ortandndarrayto avoid dependency conflicts.anyhow,ndarray,reqwestfor tests)..gitignoreto exclude*.onnxmodel files.