feat(ffmpeg): add wav-3cx telephony preset and URL-param format pre-selection#568
Open
gingeekrishna wants to merge 3 commits into
Open
feat(ffmpeg): add wav-3cx telephony preset and URL-param format pre-selection#568gingeekrishna wants to merge 3 commits into
gingeekrishna wants to merge 3 commits into
Conversation
…election WAV preset for 3CX / telephony systems --------------------------------------- Adds `wav-3cx` as a new FFmpeg output target that produces a WAV file with the parameters required by 3CX and similar telephony platforms: - Channel: mono (-ac 1) - Sample rate: 8 kHz (-ar 8000) - Bit depth: 16-bit PCM (-sample_fmt s16) The target appears in the UI alongside the regular `wav` option under the ffmpeg converter group. `normalizeOutputFiletype` maps `wav-3cx` → `wav` so the downloaded file has the correct `.wav` extension. URL query-param pre-selection ------------------------------ Adds support for `?to=<format>&converter=<name>` query parameters on the root page. When a user lands on the page with these params set, the format selector is automatically pre-populated as soon as conversion options finish loading (after the first file is selected). Example: http://localhost:3000/?to=wav-3cx&converter=ffmpeg Closes C4illin#559 Signed-off-by: Radhakrishnan Pachyappan <gingeekrishna@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR adds a dedicated FFmpeg output preset for 3CX-compatible WAV exports and introduces URL query parameters that pre-select the target format (and optionally the converter) on the main page to streamline repeated conversions.
Changes:
- Add
wav-3cxas an FFmpeg output target and normalize its download extension to.wav. - Apply a 3CX telephony audio preset (mono, 8 kHz, 16-bit) during FFmpeg conversion when
wav-3cxis selected. - Support
?to=<format>&converter=<name>URL params to auto-select the desired target format after conversion options load.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/helpers/normalizeFiletype.ts | Maps wav-3cx to .wav so downloads use a standard WAV extension. |
| src/converters/ffmpeg.ts | Registers wav-3cx and applies extra FFmpeg audio arguments for the telephony preset. |
| public/script.js | Parses to / converter query params and auto-selects the matching conversion target in the UI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- script.js: replace unsafe CSS selector interpolation from URL params with dataset comparison via Array.from().find() to avoid DOMException on values containing quotes, brackets or other special characters - ffmpeg.ts: add explicit -c:a pcm_s16le to wav-3cx preset so the PCM codec is always set regardless of FFMPEG_OUTPUT_ARGS Signed-off-by: Radhakrishnan Pachyappan <gingeekrishna@gmail.com>
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.
Closes #559.
Changes
1. WAV preset for 3CX telephony (
wav-3cx)Adds a
wav-3cxoutput target to the FFmpeg converter that produces a WAV file with the exact parameters required by 3CX and similar telephony systems — no post-processing needed:-ac 1)-ar 8000)-sample_fmt s16)The option appears in the UI under the
ffmpeggroup alongside the regularwavtarget.normalizeOutputFiletypemapswav-3cx → wavso the downloaded file has the standard.wavextension that telephony systems expect.Before: upload → convert to
wav→ open in 3CX converter → set mono/8kHz/16-bit → doneAfter: upload → convert to
wav-3cx→ done2. URL query-param format pre-selection
Adds support for
?to=<format>&converter=<name>query parameters on the root page. When a user arrives with these set, the format selector is automatically pre-populated as soon as conversion options finish loading (after the first file is selected).This lets teams share a direct link for their most-used conversion, bookmarked or embedded in a workflow.
The
converterparam is optional — omitting it picks the first converter that offers the target format:Implementation notes
av1.mkv,h264.mp4,glb2 → glb, etc.) — no new abstractions needed.script.jsafter the dynamic/conversionsfetch resolves; no backend changes required.?torefers to a format not available for the uploaded file type, the param is silently ignored (the target button simply won't exist in the DOM).Summary by cubic
Adds a
wav-3cxpreset and URL-param pre-selection for one‑click 3CX/telephony conversions. Speeds up common exports and enables shareable links.New Features
wav-3cxoutput: WAV for 3CX (mono, 8 kHz, 16‑bit PCM). Shown underffmpeg;normalizeOutputFiletypemapswav-3cxtowavfor.wavdownloads.?to=<format>&converter=<name>on the root page. Auto-fills the target after options load; invalid combos are ignored.Bug Fixes
wav-3cxcodec hardening: Force-c:a pcm_s16leso PCM is used even ifFFMPEG_OUTPUT_ARGSsets a different codec.Written for commit 01553de. Summary will update on new commits.