[Bug]: Time-stretched proxies are written at the source's bit depth
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- cpp
- Domain
- audio-video-rtc
Research direction
The bit-depth choice is in the proxy writer in modules/tracktion_engine/model/clips/tracktion_AudioClipBase.cpp, around line 158, where std::max (16, sourceInfo.bitsPerSample) is passed to AudioFileWriter. Read how proxyInfo is set to tell time-stretched proxies from normal ones. Done means time-stretched proxies are written as 32-bit float while normal-speed proxies keep the source bit depth. Check this with a stretched and an unstretched clip, since the patch in the issue is unverified.
Written by the indexing model from the issue text.
Description
Summary. ProxyGeneratorJob writes a time-stretched proxy with std::max (16, sourceInfo.bitsPerSample) bits, i.e. 16 or 24-bit integer. The stretcher's output is new audio: it gets requantised and clipped if it exceeds 0 dBFS.
Proposal (patch below): write time-stretched proxies as 32-bit float; normal-speed proxies keep the source's bit depth.
Environment: develop @07e2d674 with its JUCE 8.0.13, macOS arm64, 48 kHz, TRACKTION_ENABLE_TIMESTRETCH_SIGNALSMITH=1. The code in question is unchanged on develop @38d5a275.
Patch: 001-proxy-32bit-float.patch
diff --git a/modules/tracktion_engine/model/clips/tracktion_AudioClipBase.cpp b/modules/tracktion_engine/model/clips/tracktion_AudioClipBase.cpp
index b3d2852..6e8964e 100644
--- a/modules/tracktion_engine/model/clips/tracktion_AudioClipBase.cpp
+++ b/modules/tracktion_engine/model/clips/tracktion_AudioClipBase.cpp
@@ -158,9 +158,13 @@ private:
if (! wavFormat->isChannelLayoutSupported (sourceInfo.channelLayout))
sourceInfo.channelLayout = juce::AudioChannelSet::discreteChannels (sourceInfo.channelLayout.size());
+ // A time-stretched proxy is new audio, not a copy of the source: write it as 32-bit float
+ // so it isn't requantised to the source's bit depth or clipped above 0 dBFS
+ const int bitsPerSample = proxyInfo != nullptr ? 32 : std::max (16, sourceInfo.bitsPerSample);
+
AudioFileWriter writer (tempFile, wavFormat,
sourceInfo.numChannels, sourceInfo.sampleRate,
- std::max (16, sourceInfo.bitsPerSample),
+ bitsPerSample,
sourceInfo.metadata, 0,
sourceInfo.channelLayout);
- Dominant language
- C++
- Stars
- 1.5k
- Forks
- 222
- Avg merge
- 15h 44m
- Merged PRs (30d)
- 33
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Tracktion/tracktion_engine
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Tracktion/tracktion_engine#476 · 5 comments ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 22/100
Tracktion/tracktion_engine#474 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
Tracktion/tracktion_engine#473 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 56/100
Tracktion/tracktion_engine#460 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
Tracktion/tracktion_engine#401 · 1 comment ·
Maintainers usually reply within 1 day
All issues in Tracktion/tracktion_engine
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
metasequoiaime/msime#9113 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
tone-3000/tone3000-plugin#257 · 1 comment ·
Maintainers usually reply within 1 day
-
Locked plugin flip-flops position on every refresh after being disabledPossibly taken @Illustar0 claimed this today. Openissue report
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
ModOrganizer2/modorganizer#2449 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 1 day
-
enhancement P5
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
open-astro/AlpacaBridge#1468 ·
Maintainers usually reply within 1 day