mirror of
https://github.com/azahar-emu/soundtouch
synced 2025-11-07 07:30:02 +01:00
Fixed issue that clipped brief sequence of audio from beginning of the input audio
This commit is contained in:
parent
e302cd7123
commit
1049304b5d
35
README.html
35
README.html
@ -14,7 +14,7 @@
|
|||||||
<body class="normal">
|
<body class="normal">
|
||||||
<hr>
|
<hr>
|
||||||
<h1>SoundTouch audio processing library v1.9.3pre</h1>
|
<h1>SoundTouch audio processing library v1.9.3pre</h1>
|
||||||
<p class="normal">SoundTouch library Copyright © Olli Parviainen 2001-2015</p>
|
<p class="normal">SoundTouch library Copyright © Olli Parviainen 2001-2017</p>
|
||||||
<hr>
|
<hr>
|
||||||
<h2>1. Introduction </h2>
|
<h2>1. Introduction </h2>
|
||||||
<p>SoundTouch is an open-source audio processing library that allows
|
<p>SoundTouch is an open-source audio processing library that allows
|
||||||
@ -570,6 +570,14 @@ this corresponds to lowering the pitch by -0.318 semitones:</p>
|
|||||||
<hr>
|
<hr>
|
||||||
<h2>5. Change History</h2>
|
<h2>5. Change History</h2>
|
||||||
<h3>5.1. SoundTouch library Change History </h3>
|
<h3>5.1. SoundTouch library Change History </h3>
|
||||||
|
<p><b>1.9.3:</b></p>
|
||||||
|
<ul>
|
||||||
|
<li>Added functions to get initial processing latency, duration ratio between the original input and processed output tracks, and clarified reporting of input/output batch sizes</li>
|
||||||
|
<li>Fixed issue that added brief sequence of silence to beginning of output audio</li>
|
||||||
|
<li>Bugfix: Fixed a glitch that could cause negative array indexing in quick seek algorithm</li>
|
||||||
|
<li>Bugfix: flush() didn't properly flush final samples from the pipeline on 2nd time in case that soundtouch object instance was recycled and used for processing a second audio stream.</li>
|
||||||
|
<li>Bugfix: Pi value had incorrect 9th/10th decimals</li>
|
||||||
|
</ul>
|
||||||
<p><b>1.9.2:</b></p>
|
<p><b>1.9.2:</b></p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Fix in GNU package configuration</li>
|
<li>Fix in GNU package configuration</li>
|
||||||
@ -822,11 +830,12 @@ switch "-bpm"</li>
|
|||||||
<p>Kudos for these people who have contributed to development or
|
<p>Kudos for these people who have contributed to development or
|
||||||
submitted bugfixes:</p>
|
submitted bugfixes:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li> Arthur A</li>
|
<li> Arthur A</li>
|
||||||
<li> Paul Adenot</li>
|
<li> Paul Adenot</li>
|
||||||
<li> Richard Ash</li>
|
<li> Richard Ash</li>
|
||||||
<li> Stanislav Brabec</li>
|
<li> Stanislav Brabec</li>
|
||||||
<li> Christian Budde</li>
|
<li> Christian Budde</li>
|
||||||
|
<li> Jamie Bullock</li>
|
||||||
<li> Chris Bryan</li>
|
<li> Chris Bryan</li>
|
||||||
<li> Jacek Caban</li>
|
<li> Jacek Caban</li>
|
||||||
<li> Brian Cameron</li>
|
<li> Brian Cameron</li>
|
||||||
@ -834,24 +843,24 @@ submitted bugfixes:</p>
|
|||||||
<li> David Clark</li>
|
<li> David Clark</li>
|
||||||
<li> Patrick Colis</li>
|
<li> Patrick Colis</li>
|
||||||
<li> Miquel Colon</li>
|
<li> Miquel Colon</li>
|
||||||
<li> Jim Credland</li>
|
<li> Jim Credland</li>
|
||||||
<li> Sandro Cumerlato</li>
|
<li> Sandro Cumerlato</li>
|
||||||
<li> Justin Frankel</li>
|
<li> Justin Frankel</li>
|
||||||
<li> Masa H.</li>
|
<li> Masa H.</li>
|
||||||
<li> Jason Garland</li>
|
<li> Jason Garland</li>
|
||||||
<li> Takashi Iwai</li>
|
<li> Takashi Iwai</li>
|
||||||
<li> Thomas Klausner</li>
|
<li> Thomas Klausner</li>
|
||||||
<li> Tony Mechelynck </li>
|
<li> Tony Mechelynck </li>
|
||||||
<li> Mathias Möhl</li>
|
<li> Mathias Möhl</li>
|
||||||
<li> Yuval Naveh</li>
|
<li> Yuval Naveh</li>
|
||||||
<li> Mats Palmgren </li>
|
<li> Mats Palmgren </li>
|
||||||
<li> Paulo Pizarro</li>
|
<li> Paulo Pizarro</li>
|
||||||
<li> Andrey Ponomarenko</li>
|
<li> Andrey Ponomarenko</li>
|
||||||
<li> Blaise Potard</li>
|
<li> Blaise Potard</li>
|
||||||
<li> Michael Pruett</li>
|
<li> Michael Pruett</li>
|
||||||
<li> Rajeev Puran</li>
|
<li> Rajeev Puran</li>
|
||||||
<li> RJ Ryan</li>
|
<li> RJ Ryan</li>
|
||||||
<li> John Sheehy</li>
|
<li> John Sheehy</li>
|
||||||
<li> Tim Shuttleworth</li>
|
<li> Tim Shuttleworth</li>
|
||||||
<li> Albert Sirvent</li>
|
<li> Albert Sirvent</li>
|
||||||
<li> John Stumpo</li>
|
<li> John Stumpo</li>
|
||||||
|
|||||||
@ -310,6 +310,7 @@ int TDStretch::seekBestOverlapPositionFull(const SAMPLETYPE *refPos)
|
|||||||
// Scans for the best correlation value by testing each possible position
|
// Scans for the best correlation value by testing each possible position
|
||||||
// over the permitted range.
|
// over the permitted range.
|
||||||
bestCorr = calcCrossCorr(refPos, pMidBuffer, norm);
|
bestCorr = calcCrossCorr(refPos, pMidBuffer, norm);
|
||||||
|
bestCorr = (bestCorr + 0.1) * 0.75;
|
||||||
|
|
||||||
#pragma omp parallel for
|
#pragma omp parallel for
|
||||||
for (i = 1; i < seekLength; i ++)
|
for (i = 1; i < seekLength; i ++)
|
||||||
@ -670,26 +671,50 @@ void TDStretch::processSamples()
|
|||||||
// (that's in 'midBuffer')
|
// (that's in 'midBuffer')
|
||||||
overlap(outputBuffer.ptrEnd((uint)overlapLength), inputBuffer.ptrBegin(), (uint)offset);
|
overlap(outputBuffer.ptrEnd((uint)overlapLength), inputBuffer.ptrBegin(), (uint)offset);
|
||||||
outputBuffer.putSamples((uint)overlapLength);
|
outputBuffer.putSamples((uint)overlapLength);
|
||||||
|
offset += overlapLength;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Adjust processing offset at beginning of track:
|
||||||
|
// - do not perform initial overlapping
|
||||||
|
// - compensate expected value of 'seekBestOverlapPosition' offset landing to middle of seekLength
|
||||||
|
isBeginning = false;
|
||||||
|
int skip = overlapLength + seekLength / 2;
|
||||||
|
|
||||||
|
#ifdef SOUNDTOUCH_ALLOW_NONEXACT_SIMD_OPTIMIZATION
|
||||||
|
#ifdef SOUNDTOUCH_ALLOW_SSE
|
||||||
|
// if SSE mode, round the skip amount to value corresponding to aligned memory address
|
||||||
|
if (channels == 1)
|
||||||
|
{
|
||||||
|
skip &= -4;
|
||||||
|
}
|
||||||
|
else if (channels == 2)
|
||||||
|
{
|
||||||
|
skip &= -2;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
skipFract -= skip;
|
||||||
|
assert(nominalSkip >= -skipFract);
|
||||||
}
|
}
|
||||||
isBeginning = false;
|
|
||||||
|
|
||||||
// ... then copy sequence samples from 'inputBuffer' to output:
|
// ... then copy sequence samples from 'inputBuffer' to output:
|
||||||
|
|
||||||
// crosscheck that we don't have buffer overflow...
|
// crosscheck that we don't have buffer overflow...
|
||||||
if ((int)inputBuffer.numSamples() < (offset + seekWindowLength))
|
if ((int)inputBuffer.numSamples() < (offset + seekWindowLength - overlapLength))
|
||||||
{
|
{
|
||||||
continue; // just in case, shouldn't really happen
|
continue; // just in case, shouldn't really happen
|
||||||
}
|
}
|
||||||
|
|
||||||
// length of sequence
|
// length of sequence
|
||||||
temp = (seekWindowLength - 2 * overlapLength);
|
temp = (seekWindowLength - 2 * overlapLength);
|
||||||
outputBuffer.putSamples(inputBuffer.ptrBegin() + channels * (offset + overlapLength), (uint)temp);
|
outputBuffer.putSamples(inputBuffer.ptrBegin() + channels * offset, (uint)temp);
|
||||||
|
|
||||||
// Copies the end of the current sequence from 'inputBuffer' to
|
// Copies the end of the current sequence from 'inputBuffer' to
|
||||||
// 'midBuffer' for being mixed with the beginning of the next
|
// 'midBuffer' for being mixed with the beginning of the next
|
||||||
// processing sequence and so on
|
// processing sequence and so on
|
||||||
assert((offset + temp + overlapLength * 2) <= (int)inputBuffer.numSamples());
|
assert((offset + temp + overlapLength) <= (int)inputBuffer.numSamples());
|
||||||
memcpy(pMidBuffer, inputBuffer.ptrBegin() + channels * (offset + temp + overlapLength),
|
memcpy(pMidBuffer, inputBuffer.ptrBegin() + channels * (offset + temp),
|
||||||
channels * sizeof(SAMPLETYPE) * overlapLength);
|
channels * sizeof(SAMPLETYPE) * overlapLength);
|
||||||
|
|
||||||
// Remove the processed samples from the input buffer. Update
|
// Remove the processed samples from the input buffer. Update
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user