Repository navigation
Fix paste into empty audio track preserving source sample rate - #10947
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between a379a28328ddc68e003e883bc0ba7bf8640f7a8f and 6e25ed8. 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR modifies the Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fix paste into empty audio track preserving source sample rate
Explanation: Currently, when a destination track is newly created and empty, it usually has the project/default rate (typically 44.1 kHz 32 bits). During paste, clip insertion resample to the destination rate, so copied audio from another rate (for example 48 kHz) is unexpectedly converted.
This fix set the destination track rate to the source track rate and format ONLY when the destination has no clips yet and rates differ. This prevents unintended resampling in the empty-track paste scenario while keeping existing behavior for non-empty destination tracks.
Reproduction:
Before this fix: Pasting into a newly created empty track force the pasted audio to the destination/project default sample rate (typically 44.1 kHz 32 bits). This caused unintended sample-rate conversion and possible quality loss
After this fix: If the destination WaveTrack is empty, its rate and format is aligned to the source before paste
Paste behavior for non-empty destination tracks is unchanged
Motivation: Preserve audio fidelity and avoid unexpected resampling.
Recommended:
QA: