Audacity 3.2.0
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
TruncSilenceBase Class Reference

Truncate Silence automatically reduces the length of passages where the volume is below a set threshold level. More...

#include <TruncSilenceBase.h>

Inheritance diagram for TruncSilenceBase:
[legend]
Collaboration diagram for TruncSilenceBase:
[legend]

Public Member Functions

 TruncSilenceBase ()
 
virtual ~TruncSilenceBase ()
 
ComponentInterfaceSymbol GetSymbol () const override
 
TranslatableString GetDescription () const override
 
ManualPageID ManualPage () const override
 Name of a page in the Audacity alpha manual, default is empty. More...
 
EffectType GetType () const override
 Type determines how it behaves. More...
 
bool LoadSettings (const CommandParameters &parms, EffectSettings &settings) const override
 Restore settings from keys and values. More...
 
double CalcPreviewInputLength (const EffectSettings &settings, double previewLength) const override
 
bool Analyze (RegionList &silenceList, RegionList &trackSilences, const WaveTrack &wt, sampleCount *silentFrame, sampleCount *index, int whichTrack, double *inputLength=nullptr, double *minInputLength=nullptr) const
 
bool Process (EffectInstance &instance, EffectSettings &settings) override
 
bool NeedsDither () const override
 
- Public Member Functions inherited from StatefulEffect
 ~StatefulEffect () override
 
std::shared_ptr< EffectInstanceMakeInstance () const override
 Make an object maintaining short-term state of an Effect. More...
 
- Public Member Functions inherited from StatefulEffectBase
virtual bool Init ()
 
virtual bool Process (EffectInstance &instance, EffectSettings &settings)=0
 
virtual bool RealtimeInitialize (EffectSettings &settings, double sampleRate)
 
virtual bool RealtimeAddProcessor (EffectSettings &settings, EffectOutputs *pOutputs, unsigned numChannels, float sampleRate)
 
virtual bool RealtimeSuspend ()
 
virtual bool RealtimeResume ()
 
virtual bool RealtimeProcessStart (MessagePackage &package)
 settings are possibly changed, since last call, by an asynchronous dialog More...
 
virtual size_t RealtimeProcess (size_t group, EffectSettings &settings, const float *const *inBuf, float *const *outBuf, size_t numSamples)
 
virtual bool RealtimeProcessEnd (EffectSettings &settings) noexcept
 settings can be updated to let a dialog change appearance at idle More...
 
virtual bool RealtimeFinalize (EffectSettings &settings) noexcept
 
virtual size_t SetBlockSize (size_t maxBlockSize)
 
virtual size_t GetBlockSize () const
 
virtual unsigned GetAudioInCount () const
 How many input buffers to allocate at once. More...
 
virtual unsigned GetAudioOutCount () const
 How many output buffers to allocate at once. More...
 
virtual sampleCount GetLatency () const
 
virtual bool NeedsDither () const
 
virtual bool ProcessInitialize (EffectSettings &settings, double sampleRate, ChannelNames chanMap=nullptr)
 
virtual bool ProcessFinalize () noexcept
 
- Public Member Functions inherited from Effect
 Effect ()
 
virtual ~Effect ()
 
PluginPath GetPath () const override
 
bool VisitSettings (SettingsVisitor &visitor, EffectSettings &settings) override
 
bool VisitSettings (ConstSettingsVisitor &visitor, const EffectSettings &settings) const override
 
ComponentInterfaceSymbol GetSymbol () const override
 
VendorSymbol GetVendor () const override
 
wxString GetVersion () const override
 
TranslatableString GetDescription () const override
 
EffectFamilySymbol GetFamily () const override
 Report identifier and user-visible name of the effect protocol. More...
 
bool IsInteractive () const override
 Whether the effect needs a dialog for entry of settings. More...
 
bool IsDefault () const override
 Whether the effect sorts "above the line" in the menus. More...
 
RealtimeSince RealtimeSupport () const override
 Since which version of Audacity has the effect supported realtime? More...
 
bool SupportsAutomation () const override
 Whether the effect has any automatable controls. More...
 
bool SaveSettings (const EffectSettings &settings, CommandParameters &parms) const override
 Store settings as keys and values. More...
 
bool LoadSettings (const CommandParameters &parms, EffectSettings &settings) const override
 Restore settings from keys and values. More...
 
OptionalMessage LoadUserPreset (const RegistryPath &name, EffectSettings &settings) const override
 
bool SaveUserPreset (const RegistryPath &name, const EffectSettings &settings) const override
 Save settings in the configuration file as a user-named preset. More...
 
RegistryPaths GetFactoryPresets () const override
 Report names of factory presets. More...
 
OptionalMessage LoadFactoryPreset (int id, EffectSettings &settings) const override
 
OptionalMessage LoadFactoryDefaults (EffectSettings &settings) const override
 
virtual const EffectParameterMethodsParameters () const
 
bool CanExportPresets () const override
 Whether the effect supports export of presets to files, and importing too. More...
 
bool HasOptions () const override
 
const EffectSettingsManagerGetDefinition () const override
 
virtual NumericFormatID GetSelectionFormat ()
 
bool SaveSettingsAsString (const EffectSettings &settings, wxString &parms) const override
 
OptionalMessage LoadSettingsFromString (const wxString &parms, EffectSettings &settings) const override
 
bool IsBatchProcessing () const override
 
void SetBatchProcessing () override
 
void UnsetBatchProcessing () override
 
unsigned TestUIFlags (unsigned mask)
 
bool Delegate (Effect &delegate, EffectSettings &settings, InstanceFinder finder={})
 Re-invoke DoEffect on another Effect object that implements the work. More...
 
- Public Member Functions inherited from EffectBase
 EffectBase ()
 
 ~EffectBase () override
 
bool IsLinearEffect () const
 
bool PreviewsFullSelection () const
 
void SetTracks (TrackList *pTracks)
 
double GetDefaultDuration ()
 
virtual std::any BeginPreview (const EffectSettings &settings)
 Called when Preview() starts, to allow temporary effect state changes. More...
 
bool DoEffect (EffectSettings &settings, const InstanceFinder &finder, double projectRate, TrackList *list, WaveTrackFactory *factory, NotifyingSelectedRegion &selectedRegion, unsigned flags, const EffectSettingsAccessPtr &pAccess) override
 
virtual double CalcPreviewInputLength (const EffectSettings &settings, double previewLength) const =0
 
void CountWaveTracks ()
 
- Public Member Functions inherited from EffectPlugin
EffectPluginoperator= (EffectPlugin &)=delete
 
virtual ~EffectPlugin ()
 
virtual bool HasOptions () const =0
 
virtual bool CanExportPresets () const =0
 Whether the effect supports export of presets to files, and importing too. More...
 
virtual const EffectSettingsManagerGetDefinition () const =0
 
virtual bool SaveSettingsAsString (const EffectSettings &settings, wxString &parms) const =0
 
virtual OptionalMessage LoadSettingsFromString (const wxString &parms, EffectSettings &settings) const =0
 
virtual bool IsBatchProcessing () const =0
 
virtual void SetBatchProcessing ()=0
 
virtual void UnsetBatchProcessing ()=0
 
virtual bool DoEffect (EffectSettings &settings, const InstanceFinder &finder, double projectRate, TrackList *list, WaveTrackFactory *factory, NotifyingSelectedRegion &selectedRegion, unsigned flags, const EffectSettingsAccessPtr &pAccess=nullptr)=0
 
- Public Member Functions inherited from EffectInstanceFactory
virtual ~EffectInstanceFactory ()
 
virtual std::shared_ptr< EffectInstanceMakeInstance () const =0
 Make an object maintaining short-term state of an Effect. More...
 
- Public Member Functions inherited from EffectSettingsManager
virtual ~EffectSettingsManager ()
 
virtual bool VisitSettings (SettingsVisitor &visitor, EffectSettings &settings)
 
virtual bool VisitSettings (ConstSettingsVisitor &visitor, const EffectSettings &settings) const
 
virtual EffectSettings MakeSettings () const
 
virtual bool CopySettingsContents (const EffectSettings &src, EffectSettings &dst) const
 Update one settings object from another. More...
 
virtual std::unique_ptr< EffectOutputsMakeOutputs () const
 Produce an object to hold values to send to effect output meters. More...
 
- Public Member Functions inherited from EffectDefinitionInterface
virtual ~EffectDefinitionInterface ()
 
virtual EffectType GetType () const =0
 Type determines how it behaves. More...
 
virtual EffectType GetClassification () const
 Determines which menu it appears in; default same as GetType(). More...
 
virtual EffectFamilySymbol GetFamily () const =0
 Report identifier and user-visible name of the effect protocol. More...
 
virtual bool IsInteractive () const =0
 Whether the effect needs a dialog for entry of settings. More...
 
virtual bool IsDefault () const =0
 Whether the effect sorts "above the line" in the menus. More...
 
virtual RealtimeSince RealtimeSupport () const =0
 Since which version of Audacity has the effect supported realtime? More...
 
bool SupportsRealtime () const
 
virtual bool SupportsAutomation () const =0
 Whether the effect has any automatable controls. More...
 
virtual bool EnablesDebug () const
 Whether the effect dialog should have a Debug button; default, always false. More...
 
virtual ManualPageID ManualPage () const
 Name of a page in the Audacity alpha manual, default is empty. More...
 
virtual FilePath HelpPage () const
 Fully qualified local help file name, default is empty. More...
 
virtual bool IsHiddenFromMenus () const
 Default is false. More...
 
- Public Member Functions inherited from ComponentInterface
virtual ~ComponentInterface ()
 
virtual PluginPath GetPath () const =0
 
virtual ComponentInterfaceSymbol GetSymbol () const =0
 
virtual VendorSymbol GetVendor () const =0
 
virtual wxString GetVersion () const =0
 
virtual TranslatableString GetDescription () const =0
 
TranslatableString GetName () const
 

Static Public Member Functions

static TruncSilenceBaseFetchParameters (TruncSilenceBase &e, EffectSettings &)
 
- Static Public Member Functions inherited from Effect
static EffectFetchParameters (Effect &e, EffectSettings &)
 
- Static Public Member Functions inherited from EffectBase
static std::optional< InstancePointerFindInstance (EffectPlugin &plugin)
 
static InstanceFinder DefaultInstanceFinder (EffectPlugin &plugin)
 
- Static Public Member Functions inherited from EffectDefinitionInterface
static Identifier GetSquashedName (const Identifier &ident)
 A utility that strips spaces and CamelCases a name. More...
 

Static Public Attributes

static const ComponentInterfaceSymbol Symbol
 
- Static Public Attributes inherited from EffectPlugin
static const wxString kUserPresetIdent = wxT("User Preset:")
 
static const wxString kFactoryPresetIdent = wxT("Factory Preset:")
 
static const wxString kCurrentSettingsIdent = wxT("<Current Settings>")
 
static const wxString kFactoryDefaultsIdent = wxT("<Factory Defaults>")
 

Protected Types

enum  kActions { kTruncate , kCompress , nActions }
 

Protected Member Functions

void Intersect (RegionList &dest, const RegionList &src)
 
bool ProcessIndependently ()
 
bool ProcessAll ()
 
bool FindSilences (RegionList &silences, const TrackIterRange< const WaveTrack > &range)
 
bool DoRemoval (const RegionList &silences, const TrackIterRange< Track > &range, unsigned iGroup, unsigned nGroups, double &totalCutLen)
 
const EffectParameterMethodsParameters () const override
 
- Protected Member Functions inherited from Effect
bool CheckWhetherSkipEffect (const EffectSettings &settings) const override
 Default implementation returns false. More...
 
double CalcPreviewInputLength (const EffectSettings &settings, double previewLength) const override
 Default implementation returns previewLength More...
 
bool TotalProgress (double frac, const TranslatableString &={}) const
 
bool TrackProgress (int whichTrack, double frac, const TranslatableString &={}) const
 
bool TrackGroupProgress (int whichGroup, double frac, const TranslatableString &={}) const
 
int GetNumWaveTracks () const
 
int GetNumWaveGroups () const
 
void GetBounds (const WaveTrack &track, sampleCount *start, sampleCount *len)
 
- Protected Member Functions inherited from EffectBase
virtual bool CheckWhetherSkipEffect (const EffectSettings &settings) const =0
 After Init(), tell whether Process() should be skipped. More...
 
void SetLinearEffectFlag (bool linearEffectFlag)
 
void SetPreviewFullSelectionFlag (bool previewDurationFlag)
 
bool IsPreviewing () const
 
const TrackListinputTracks () const
 
const AudacityProjectFindProject () const
 

Protected Attributes

double mThresholdDB {}
 
int mActionIndex
 
double mInitialAllowedSilence
 
double mTruncLongestAllowedSilence
 
double mSilenceCompressPercent
 
bool mbIndependent
 
size_t mBlendFrameCount
 
- Protected Attributes inherited from EffectBase
double mF0 {}
 
double mF1 {}
 
wxArrayString mPresetNames
 
unsigned mUIFlags { 0 }
 

Static Protected Attributes

static const EnumValueSymbol kActionStrings [nActions]
 
static constexpr EffectParameter Threshold
 
static constexpr EnumParameter ActIndex
 
static constexpr EffectParameter Minimum
 
static constexpr EffectParameter Truncate
 
static constexpr EffectParameter Compress
 
static constexpr EffectParameter Independent
 

Additional Inherited Members

- Public Types inherited from StatefulEffectBase
using MessagePackage = EffectInstance::MessagePackage
 
- Public Types inherited from EffectPlugin
using EffectSettingsAccessPtr = std::shared_ptr< EffectSettingsAccess >
 
using InstancePointer = std::shared_ptr< EffectInstanceEx >
 
using InstanceFinder = std::function< std::optional< InstancePointer >(EffectSettings &settings) >
 
- Public Types inherited from EffectDefinitionInterface
enum class  RealtimeSince : unsigned { Never , After_3_1 , Always }
 In which versions of Audacity was an effect realtime capable? More...
 
- Public Attributes inherited from EffectBase
std::shared_ptr< TrackListmTracks {}
 
int mNumTracks {}
 
BasicUI::ProgressDialogmProgress {}
 
double mProjectRate {}
 
WaveTrackFactorymFactory {}
 
double mT0 {}
 
double mT1 {}
 
bool mIsPreview { false }
 

Detailed Description

Truncate Silence automatically reduces the length of passages where the volume is below a set threshold level.

Definition at line 24 of file TruncSilenceBase.h.

Member Enumeration Documentation

◆ kActions

Enumerator
kTruncate 
kCompress 
nActions 

Definition at line 93 of file TruncSilenceBase.h.

Constructor & Destructor Documentation

◆ TruncSilenceBase()

TruncSilenceBase::TruncSilenceBase ( )

Definition at line 94 of file TruncSilenceBase.cpp.

95{
96 Parameters().Reset(*this);
97
99
100 // This used to be changeable via the audacity.cfg/registry. Doubtful that
101 // was ever done.
102 //
103 // Original comment:
104 //
105 // mBlendFrameCount only retrieved from prefs ... not using dialog
106 // Only way to change (for windows) is thru registry
107 // The values should be figured dynamically ... too many frames could be
108 // invalid
110}
static const size_t DEF_BlendFrameCount
void SetLinearEffectFlag(bool linearEffectFlag)
Definition: EffectBase.cpp:210
virtual void Reset(Effect &effect) const =0
const EffectParameterMethods & Parameters() const override

References DEF_BlendFrameCount, mBlendFrameCount, Parameters(), EffectParameterMethods::Reset(), and EffectBase::SetLinearEffectFlag().

Referenced by Parameters().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~TruncSilenceBase()

TruncSilenceBase::~TruncSilenceBase ( )
virtual

Definition at line 112 of file TruncSilenceBase.cpp.

113{
114}

Member Function Documentation

◆ Analyze()

bool TruncSilenceBase::Analyze ( RegionList silenceList,
RegionList trackSilences,
const WaveTrack wt,
sampleCount silentFrame,
sampleCount index,
int  whichTrack,
double *  inputLength = nullptr,
double *  minInputLength = nullptr 
) const

Definition at line 509 of file TruncSilenceBase.cpp.

513{
514 const auto rate = wt.GetRate();
515
516 // Smallest silent region to detect in frames
517 auto minSilenceFrames =
519
520 double truncDbSilenceThreshold = DB_TO_LINEAR(mThresholdDB);
521 auto blockLen = wt.GetMaxBlockSize();
522 auto start = wt.TimeToLongSamples(mT0);
523 auto end = wt.TimeToLongSamples(mT1);
524 sampleCount outLength = 0;
525
526 double previewLength;
527 gPrefs->Read(wxT("/AudioIO/EffectsPreviewLen"), &previewLength, 6.0);
528 // Minimum required length in samples.
529 const sampleCount previewLen(previewLength * rate);
530
531 // Keep position in overall silences list for optimization
532 RegionList::iterator rit(silenceList.begin());
533
534 // Allocate buffers
535 Floats buffers[] { Floats { blockLen }, Floats { blockLen } };
536
537 // Loop through current track
538 while (*index < end)
539 {
540 if (
541 inputLength &&
542 ((outLength >= previewLen) ||
543 (*index - start > wt.TimeToLongSamples(*minInputLength))))
544 {
545 *inputLength = std::min<double>(*inputLength, *minInputLength);
546 if (outLength >= previewLen)
547 {
548 *minInputLength = *inputLength;
549 }
550 return true;
551 }
552
553 if (!inputLength)
554 {
555 // Show progress dialog, test for cancellation
556 bool cancelled = TotalProgress(
557 detectFrac *
558 (whichTrack +
559 (*index - start).as_double() / (end - start).as_double()) /
560 (double)GetNumWaveTracks());
561 if (cancelled)
562 return false;
563 }
564
565 // Optimization: if not in a silent region skip ahead to the next one
566
567 double curTime = wt.LongSamplesToTime(*index);
568 for (; rit != silenceList.end(); ++rit)
569 {
570 // Find the first silent region ending after current time
571 if (rit->end >= curTime)
572 {
573 break;
574 }
575 }
576
577 if (rit == silenceList.end())
578 {
579 // No more regions -- no need to process the rest of the track
580 if (inputLength)
581 {
582 // Add available samples up to previewLength.
583 auto remainingTrackSamples =
584 wt.TimeToLongSamples(wt.GetEndTime()) - *index;
585 auto requiredTrackSamples = previewLen - outLength;
586 outLength += (remainingTrackSamples > requiredTrackSamples) ?
587 requiredTrackSamples :
588 remainingTrackSamples;
589 }
590
591 break;
592 }
593 else if (rit->start > curTime)
594 {
595 // End current silent region, skip ahead
596 if (*silentFrame >= minSilenceFrames)
597 {
598 trackSilences.push_back(Region(
599 wt.LongSamplesToTime(*index - *silentFrame),
600 wt.LongSamplesToTime(*index)));
601 }
602 *silentFrame = 0;
603 auto newIndex = wt.TimeToLongSamples(rit->start);
604 if (inputLength)
605 {
606 auto requiredTrackSamples = previewLen - outLength;
607 // Add non-silent sample to outLength
608 outLength += ((newIndex - *index) > requiredTrackSamples) ?
609 requiredTrackSamples :
610 newIndex - *index;
611 }
612
613 *index = newIndex;
614 }
615 // End of optimization
616
617 // Limit size of current block if we've reached the end
618 auto count = limitSampleBufferSize(blockLen, end - *index);
619
620 // Fill buffers
621 size_t iChannel = 0;
622 for (const auto pChannel : wt.Channels())
623 pChannel->GetFloats(buffers[iChannel++].get(), *index, count);
624
625 // Look for silenceList in current block
626 for (decltype(count) i = 0; i < count; ++i)
627 {
628 if (
629 inputLength &&
630 ((outLength >= previewLen) ||
631 (outLength > wt.TimeToLongSamples(*minInputLength))))
632 {
633 *inputLength =
634 wt.LongSamplesToTime(*index + i) - wt.LongSamplesToTime(start);
635 break;
636 }
637
638 const bool silent =
639 std::all_of(buffers, buffers + iChannel, [&](const Floats& buffer) {
640 return fabs(buffer[i]) < truncDbSilenceThreshold;
641 });
642 if (silent)
643 (*silentFrame)++;
644 else
645 {
646 sampleCount allowed = 0;
647 if (*silentFrame >= minSilenceFrames)
648 {
649 if (inputLength)
650 {
651 switch (mActionIndex)
652 {
653 case kTruncate:
654 outLength +=
656 break;
657 case kCompress:
659 outLength += sampleCount(
660 allowed.as_double() +
661 (*silentFrame - allowed).as_double() *
663 break;
664 // default: // Not currently used.
665 }
666 }
667
668 // Record the silent region
669 trackSilences.push_back(Region(
670 wt.LongSamplesToTime(*index + i - *silentFrame),
671 wt.LongSamplesToTime(*index + i)));
672 }
673 else if (inputLength)
674 { // included as part of non-silence
675 outLength += *silentFrame;
676 }
677 *silentFrame = 0;
678 if (inputLength)
679 {
680 ++outLength; // Add non-silent sample to outLength
681 }
682 }
683 }
684 // Next block
685 *index += count;
686 }
687
688 if (inputLength)
689 {
690 *inputLength = std::min<double>(*inputLength, *minInputLength);
691 if (outLength >= previewLen)
692 {
693 *minInputLength = *inputLength;
694 }
695 }
696
697 return true;
698}
wxT("CloseDown"))
#define DB_TO_LINEAR(x)
Definition: MemoryX.h:338
audacity::BasicSettings * gPrefs
Definition: Prefs.cpp:68
size_t limitSampleBufferSize(size_t bufferSize, sampleCount limit)
Definition: SampleCount.cpp:22
WaveTrack::Region Region
const double detectFrac
static const double DEF_MinTruncMs
double mT1
Definition: EffectBase.h:123
double mT0
Definition: EffectBase.h:122
bool TotalProgress(double frac, const TranslatableString &={}) const
Definition: Effect.cpp:335
int GetNumWaveTracks() const
Definition: Effect.h:139
double mSilenceCompressPercent
double mInitialAllowedSilence
double mTruncLongestAllowedSilence
auto Channels()
Definition: WaveTrack.h:263
double GetEndTime() const override
Implement WideSampleSequence.
Definition: WaveTrack.cpp:2613
double GetRate() const override
Definition: WaveTrack.cpp:821
size_t GetMaxBlockSize() const
Definition: WaveTrack.cpp:2279
double LongSamplesToTime(sampleCount pos) const
sampleCount TimeToLongSamples(double t0) const
virtual bool Read(const wxString &key, bool *value) const =0
Positions or offsets within audio files need a wide type.
Definition: SampleCount.h:19
double as_double() const
Definition: SampleCount.h:46
const char * end(const char *str) noexcept
Definition: StringUtils.h:106

References sampleCount::as_double(), WaveTrack::Channels(), DB_TO_LINEAR, DEF_MinTruncMs, detectFrac, details::end(), WaveTrack::GetEndTime(), WaveTrack::GetMaxBlockSize(), Effect::GetNumWaveTracks(), WaveTrack::GetRate(), gPrefs, anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel, kCompress, kTruncate, limitSampleBufferSize(), WideSampleSequence::LongSamplesToTime(), mActionIndex, mInitialAllowedSilence, mSilenceCompressPercent, EffectBase::mT0, EffectBase::mT1, mThresholdDB, mTruncLongestAllowedSilence, audacity::BasicSettings::Read(), WideSampleSequence::TimeToLongSamples(), Effect::TotalProgress(), and wxT().

Referenced by CalcPreviewInputLength(), and FindSilences().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CalcPreviewInputLength()

double TruncSilenceBase::CalcPreviewInputLength ( const EffectSettings settings,
double  previewLength 
) const
overridevirtual

Implements EffectBase.

Definition at line 186 of file TruncSilenceBase.cpp.

188{
189 double inputLength = mT1 - mT0;
190 double minInputLength = inputLength;
191
192 // Master list of silent regions
193 RegionList silences;
194
195 // Start with the whole selection silent
196 silences.push_back(Region(mT0, mT1));
197
198 int whichTrack = 0;
199
200 for (auto wt : inputTracks()->Selected<const WaveTrack>())
201 {
202 RegionList trackSilences;
203
204 auto index = wt->TimeToLongSamples(mT0);
205 sampleCount silentFrame = 0; // length of the current silence
206
207 Analyze(
208 silences, trackSilences, *wt, &silentFrame, &index, whichTrack,
209 &inputLength, &minInputLength);
210
211 whichTrack += wt->NChannels();
212 }
213 return inputLength;
214}
const TrackList * inputTracks() const
Definition: EffectBase.h:102
bool Analyze(RegionList &silenceList, RegionList &trackSilences, const WaveTrack &wt, sampleCount *silentFrame, sampleCount *index, int whichTrack, double *inputLength=nullptr, double *minInputLength=nullptr) const

References Analyze(), EffectBase::inputTracks(), EffectBase::mT0, and EffectBase::mT1.

Here is the call graph for this function:

◆ DoRemoval()

bool TruncSilenceBase::DoRemoval ( const RegionList silences,
const TrackIterRange< Track > &  range,
unsigned  iGroup,
unsigned  nGroups,
double &  totalCutLen 
)
protected

Definition at line 363 of file TruncSilenceBase.cpp.

366{
367 //
368 // Now remove the silent regions from all selected / sync-lock selected
369 // tracks.
370 //
371
372 // Loop over detected regions in reverse (so cuts don't change time values
373 // down the line)
374 int whichReg = 0;
375 RegionList::const_reverse_iterator rit;
376 for (rit = silences.rbegin(); rit != silences.rend(); ++rit)
377 {
378 const Region& region = *rit;
379 const Region* const r = &region;
380
381 // Progress dialog and cancellation. Do additional cleanup before return.
382 const double frac =
383 detectFrac + (1 - detectFrac) *
384 (iGroup + whichReg / double(silences.size())) /
385 nGroups;
386 if (TotalProgress(frac))
387 return false;
388
389 // Intersection may create regions smaller than allowed; ignore them.
390 // Allow one nanosecond extra for consistent results with exact
391 // milliseconds of allowed silence.
392 if ((r->end - r->start) < (mInitialAllowedSilence - 0.000000001))
393 continue;
394
395 // Find NEW silence length as requested
396 double inLength = r->end - r->start;
397 double outLength;
398
399 switch (mActionIndex)
400 {
401 case kTruncate:
402 outLength = std::min(mTruncLongestAllowedSilence, inLength);
403 break;
404 case kCompress:
405 outLength =
408 break;
409 default: // Not currently used.
410 outLength = std::min(
414 }
415
416 const double cutLen = std::max(0.0, inLength - outLength);
417 // Don't waste time cutting nothing.
418 if (cutLen == 0.0)
419 continue;
420
421 totalCutLen += cutLen;
422
423 bool success = true;
424 double cutStart = (r->start + r->end - cutLen) / 2;
425 double cutEnd = cutStart + cutLen;
427 [&](const Track* pTrack) {
428 return
429 // Don't waste time past the end of a track
430 pTrack->GetEndTime() < r->start;
431 })
432 .VisitWhile(
433 success,
434 [&](WaveTrack& wt) {
435 // In WaveTracks, clear with a cross-fade
436 auto blendFrames = mBlendFrameCount;
437 // Round start/end times to frame boundaries
438 cutStart = wt.SnapToSample(cutStart);
439 cutEnd = wt.SnapToSample(cutEnd);
440
441 // Make sure the cross-fade does not affect non-silent frames
442 if (wt.LongSamplesToTime(blendFrames) > inLength)
443 {
444 // Result is not more than blendFrames:
445 blendFrames = wt.TimeToLongSamples(inLength).as_size_t();
446 }
447
448 // Perform cross-fade in memory
449 struct Buffers
450 {
451 Buffers(size_t size)
452 : buf1 { size }
453 , buf2 { size }
454 {
455 }
456 Floats buf1, buf2;
457 };
458 Buffers buffers[2] { blendFrames, blendFrames };
459 auto t1 = wt.TimeToLongSamples(cutStart) - blendFrames / 2;
460 auto t2 = wt.TimeToLongSamples(cutEnd) - blendFrames / 2;
461
462 size_t iChannel = 0;
463 for (const auto pChannel : wt.Channels())
464 {
465 auto& buffer = buffers[iChannel];
466 pChannel->GetFloats(buffer.buf1.get(), t1, blendFrames);
467 pChannel->GetFloats(buffer.buf2.get(), t2, blendFrames);
468
469 for (decltype(blendFrames) i = 0; i < blendFrames; ++i)
470 {
471 buffer.buf1[i] = ((blendFrames - i) * buffer.buf1[i] +
472 i * buffer.buf2[i]) /
473 (double)blendFrames;
474 }
475 ++iChannel;
476 }
477
478 wt.Clear(cutStart, cutEnd);
479
480 iChannel = 0;
481 for (const auto pChannel : wt.Channels())
482 {
483 // Write cross-faded data
484 auto& buffer = buffers[iChannel];
485 success =
486 success &&
487 pChannel->SetFloats(
488 buffer.buf1.get(), t1, blendFrames,
489 // This effect mostly shifts samples to remove silences,
490 // and does only a little bit of floating point
491 // calculations to cross-fade the splices, over a 100
492 // sample interval by default. Don't dither.
494 ++iChannel;
495 }
496 },
497 [&](Track& t) {
498 // Non-wave tracks: just do a sync-lock adjust
499 t.SyncLockAdjust(cutEnd, cutStart);
500 });
501 if (!success)
502 return false;
503 ++whichReg;
504 }
505
506 return true;
507}
int min(int a, int b)
@ narrowestSampleFormat
Two synonyms for previous values that might change if more values were added.
static bool IsSelectedOrSyncLockSelectedP(const Track *pTrack)
Definition: SyncLock.h:61
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:110
A Track that contains audio waveform data.
Definition: WaveTrack.h:203
void Clear(double t0, double t1) override
Definition: WaveTrack.cpp:1161
double SnapToSample(double t) const
size_t as_size_t() const
Definition: SampleCount.cpp:16
Structure to hold region of a wavetrack and a comparison function for sortability.
Definition: WaveTrack.h:217

References sampleCount::as_size_t(), WaveTrack::Channels(), WaveTrack::Clear(), detectFrac, WaveTrack::Region::end, anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel, SyncLock::IsSelectedOrSyncLockSelectedP(), kCompress, kTruncate, WideSampleSequence::LongSamplesToTime(), mActionIndex, mBlendFrameCount, min(), mInitialAllowedSilence, mSilenceCompressPercent, mTruncLongestAllowedSilence, narrowestSampleFormat, size, WideSampleSequence::SnapToSample(), WaveTrack::Region::start, WideSampleSequence::TimeToLongSamples(), and Effect::TotalProgress().

Referenced by ProcessAll(), and ProcessIndependently().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FetchParameters()

static TruncSilenceBase * TruncSilenceBase::FetchParameters ( TruncSilenceBase e,
EffectSettings  
)
inlinestatic

Definition at line 28 of file TruncSilenceBase.h.

29 {
30 return &e;
31 }

◆ FindSilences()

bool TruncSilenceBase::FindSilences ( RegionList silences,
const TrackIterRange< const WaveTrack > &  range 
)
protected

Definition at line 317 of file TruncSilenceBase.cpp.

319{
320 // Start with the whole selection silent
321 silences.push_back(Region(mT0, mT1));
322
323 // Remove non-silent regions in each track
324 int whichTrack = 0;
325 for (auto wt : range)
326 {
327 // Smallest silent region to detect in frames
328 auto minSilenceFrames = sampleCount(
329 std::max(mInitialAllowedSilence, DEF_MinTruncMs) * wt->GetRate());
330
331 //
332 // Scan the track for silences
333 //
334 RegionList trackSilences;
335
336 auto index = wt->TimeToLongSamples(mT0);
337 sampleCount silentFrame = 0;
338
339 // Detect silences
340 bool cancelled = !(Analyze(
341 silences, trackSilences, *wt, &silentFrame, &index, whichTrack));
342
343 // Buffer has been freed, so we're OK to return if cancelled
344 if (cancelled)
345 return false;
346
347 if (silentFrame >= minSilenceFrames)
348 {
349 // Track ended in silence -- record region
350 trackSilences.push_back(Region(
351 wt->LongSamplesToTime(index - silentFrame),
352 wt->LongSamplesToTime(index)));
353 }
354
355 // Intersect with the overall silent region list
356 Intersect(silences, trackSilences);
357 whichTrack++;
358 }
359
360 return true;
361}
void Intersect(RegionList &dest, const RegionList &src)

References Analyze(), DEF_MinTruncMs, Intersect(), mInitialAllowedSilence, EffectBase::mT0, and EffectBase::mT1.

Referenced by ProcessAll(), and ProcessIndependently().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDescription()

TranslatableString TruncSilenceBase::GetDescription ( ) const
overridevirtual

Implements ComponentInterface.

Definition at line 123 of file TruncSilenceBase.cpp.

124{
125 return XO(
126 "Automatically reduces the length of passages where the volume is below a specified level");
127}
XO("Cut/Copy/Paste")

References XO().

Here is the call graph for this function:

◆ GetSymbol()

ComponentInterfaceSymbol TruncSilenceBase::GetSymbol ( ) const
overridevirtual

Implements ComponentInterface.

Definition at line 118 of file TruncSilenceBase.cpp.

119{
120 return Symbol;
121}
static const ComponentInterfaceSymbol Symbol

References Symbol.

◆ GetType()

EffectType TruncSilenceBase::GetType ( ) const
overridevirtual

Type determines how it behaves.

Implements EffectDefinitionInterface.

Definition at line 136 of file TruncSilenceBase.cpp.

137{
138 return EffectTypeProcess;
139}
@ EffectTypeProcess

References EffectTypeProcess.

Referenced by ProcessAll(), and ProcessIndependently().

Here is the caller graph for this function:

◆ Intersect()

void TruncSilenceBase::Intersect ( RegionList dest,
const RegionList src 
)
protected

Definition at line 703 of file TruncSilenceBase.cpp.

704{
705 RegionList::iterator destIter;
706 destIter = dest.begin();
707 // Any time we reach the end of the dest list we're finished
708 if (destIter == dest.end())
709 return;
710 RegionList::iterator curDest = destIter;
711
712 // Operation: find non-silent regions in src, remove them from dest.
713 double nsStart = curDest->start;
714 double nsEnd;
715 bool lastRun = false; // must run the loop one extra time
716
717 RegionList::const_iterator srcIter = src.begin();
718
719 // This logic, causing the loop to run once after end of src, must occur
720 // each time srcIter is updated
721 if (srcIter == src.end())
722 {
723 lastRun = true;
724 }
725
726 while (srcIter != src.end() || lastRun)
727 {
728 // Don't use curSrc unless lastRun is false!
729 RegionList::const_iterator curSrc;
730
731 if (lastRun)
732 {
733 // The last non-silent region extends as far as possible
734 nsEnd = std::numeric_limits<double>::max();
735 }
736 else
737 {
738 curSrc = srcIter;
739 nsEnd = curSrc->start;
740 }
741
742 if (nsEnd > nsStart)
743 {
744 // Increment through dest until we have a region that could be affected
745 while (curDest->end <= nsStart)
746 {
747 ++destIter;
748 if (destIter == dest.end())
749 {
750 return;
751 }
752 curDest = destIter;
753 }
754
755 // Check for splitting dest region in two
756 if (nsStart > curDest->start && nsEnd < curDest->end)
757 {
758 // The second region
759 Region r(nsEnd, curDest->end);
760
761 // The first region
762 curDest->end = nsStart;
763
764 // Insert second region after first
765 RegionList::iterator nextIt(destIter);
766 ++nextIt;
767
768 // This should just read: destIter = dest.insert(nextIt, r); but we
769 // work around two two wxList::insert() bugs. First, in some
770 // versions it returns the wrong value. Second, in some versions,
771 // it crashes when you insert at list end.
772 if (nextIt == dest.end())
773 dest.push_back(r);
774 else
775 dest.insert(nextIt, r);
776 ++destIter; // (now points at the newly-inserted region)
777
778 curDest = destIter;
779 }
780
781 // Check for truncating the end of dest region
782 if (
783 nsStart > curDest->start && nsStart < curDest->end &&
784 nsEnd >= curDest->end)
785 {
786 curDest->end = nsStart;
787
788 ++destIter;
789 if (destIter == dest.end())
790 {
791 return;
792 }
793 curDest = destIter;
794 }
795
796 // Check for all dest regions that need to be removed completely
797 while (nsStart <= curDest->start && nsEnd >= curDest->end)
798 {
799 destIter = dest.erase(destIter);
800 if (destIter == dest.end())
801 {
802 return;
803 }
804 curDest = destIter;
805 }
806
807 // Check for truncating the beginning of dest region
808 if (
809 nsStart <= curDest->start && nsEnd > curDest->start &&
810 nsEnd < curDest->end)
811 {
812 curDest->start = nsEnd;
813 }
814 }
815
816 if (lastRun)
817 {
818 // done
819 lastRun = false;
820 }
821 else
822 {
823 // Next non-silent region starts at the end of this silent region
824 nsStart = curSrc->end;
825 ++srcIter;
826 if (srcIter == src.end())
827 {
828 lastRun = true;
829 }
830 }
831 }
832}

References details::end().

Referenced by FindSilences().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadSettings()

bool TruncSilenceBase::LoadSettings ( const CommandParameters parms,
EffectSettings settings 
) const
overridevirtual

Restore settings from keys and values.

Returns
true on success

Implements EffectSettingsManager.

Definition at line 141 of file TruncSilenceBase.cpp.

143{
145
146 // A bit of special treatment for two parameters
147
148 // This control migrated from a choice to a text box in version 2.3.0
149 double myThreshold {};
150 bool newParams = [&] {
151 double temp;
152 if (!parms.ReadAndVerify(
154 return false;
155 myThreshold = temp;
156 return true;
157 }();
158
159 if (!newParams)
160 {
161 int temp;
162 // Use legacy param:
163 if (!parms.ReadAndVerify(
164 L"Db", &temp, 0, Enums::DbChoices, Enums::NumDbChoices))
165 return false;
166 myThreshold = enumToDB(temp);
167 }
168
169 {
170 int temp;
171 if (!parms.ReadAndVerify(
174 return false;
175
176 // TODO: fix this when settings are really externalized
177 const_cast<int&>(mActionIndex) = temp;
178 }
179 // TODO: fix this when settings are really externalized
180 const_cast<double&>(mThresholdDB) = myThreshold;
181 return true;
182}
static Settings & settings()
Definition: TrackInfo.cpp:51
static CommandParameters::ObsoleteMap kObsoleteActions[]
static const size_t nObsoleteActions
static double enumToDB(int val)
bool ReadAndVerify(const wxString &key, float *val, float defVal, float min, float max) const
bool LoadSettings(const CommandParameters &parms, EffectSettings &settings) const override
Restore settings from keys and values.
Definition: Effect.cpp:122
static const size_t NumDbChoices
static const EnumValueSymbol DbChoices[]
static constexpr EffectParameter Threshold
static constexpr EnumParameter ActIndex
static const EnumValueSymbol kActionStrings[nActions]
const wxChar *const key
Identifier in configuration file.
const Type def
Default value.
const Type min
Minimum value.
const Type max
Maximum value.

References ActIndex, Enums::DbChoices, EffectParameter< Structure, Member, Type, Value >::def, enumToDB(), kActionStrings, EffectParameter< Structure, Member, Type, Value >::key, kObsoleteActions, Effect::LoadSettings(), mActionIndex, EffectParameter< Structure, Member, Type, Value >::max, EffectParameter< Structure, Member, Type, Value >::min, mThresholdDB, nActions, nObsoleteActions, Enums::NumDbChoices, CommandParameters::ReadAndVerify(), settings(), and Threshold.

Here is the call graph for this function:

◆ ManualPage()

ManualPageID TruncSilenceBase::ManualPage ( ) const
overridevirtual

Name of a page in the Audacity alpha manual, default is empty.

Reimplemented from EffectDefinitionInterface.

Definition at line 129 of file TruncSilenceBase.cpp.

130{
131 return L"Truncate_Silence";
132}

◆ NeedsDither()

bool TruncSilenceBase::NeedsDither ( ) const
overridevirtual

Reimplemented from StatefulEffectBase.

Definition at line 852 of file TruncSilenceBase.cpp.

853{
854 return false;
855}

◆ Parameters()

const EffectParameterMethods & TruncSilenceBase::Parameters ( ) const
overrideprotectedvirtual

Reimplemented from Effect.

Definition at line 73 of file TruncSilenceBase.cpp.

74{
75 static CapturedParameters<
78 parameters;
79 return parameters;
80}
Generates EffectParameterMethods overrides from variadic template arguments.
static constexpr EffectParameter Independent
static constexpr EffectParameter Truncate
static constexpr EffectParameter Minimum
static constexpr EffectParameter Compress

References ActIndex, Compress, Independent, Minimum, Threshold, Truncate, and TruncSilenceBase().

Referenced by TruncSilenceBase().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Process()

bool TruncSilenceBase::Process ( EffectInstance instance,
EffectSettings settings 
)
overridevirtual

Implements StatefulEffectBase.

Definition at line 216 of file TruncSilenceBase.cpp.

217{
218 const bool success = mbIndependent ? ProcessIndependently() : ProcessAll();
219
220 return success;
221}

References mbIndependent, ProcessAll(), and ProcessIndependently().

Here is the call graph for this function:

◆ ProcessAll()

bool TruncSilenceBase::ProcessAll ( )
protected

Definition at line 291 of file TruncSilenceBase.cpp.

292{
293 // Copy tracks
294 EffectOutputTracks outputs {
295 *mTracks, GetType(), { { mT0, mT1 } }, true, true
296 };
297
298 // Master list of silent regions.
299 // This list should always be kept in order.
300 RegionList silences;
301
302 if (FindSilences(silences, outputs.Get().Selected<const WaveTrack>()))
303 {
304 auto trackRange = outputs.Get().Any();
305 double totalCutLen = 0.0;
306 if (DoRemoval(silences, trackRange, 0, 1, totalCutLen))
307 {
308 mT1 -= totalCutLen;
309 outputs.Commit();
310 return true;
311 }
312 }
313
314 return false;
315}
std::shared_ptr< TrackList > mTracks
Definition: EffectBase.h:116
Use this object to copy the input tracks to tentative outputTracks.
bool FindSilences(RegionList &silences, const TrackIterRange< const WaveTrack > &range)
EffectType GetType() const override
Type determines how it behaves.
bool DoRemoval(const RegionList &silences, const TrackIterRange< Track > &range, unsigned iGroup, unsigned nGroups, double &totalCutLen)

References DoRemoval(), FindSilences(), GetType(), EffectBase::mT0, EffectBase::mT1, and EffectBase::mTracks.

Referenced by Process().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProcessIndependently()

bool TruncSilenceBase::ProcessIndependently ( )
protected

Definition at line 223 of file TruncSilenceBase.cpp.

224{
225 unsigned nGroups = 0;
226
227 const bool syncLock = SyncLockState::Get(*FindProject()).IsSyncLocked();
228
229 // Check if it's permissible
230 {
231 for (auto track : inputTracks()->Selected<const WaveTrack>())
232 {
233 if (syncLock)
234 {
235 auto otherTracks =
236 SyncLock::Group(*track).Filter<const WaveTrack>() +
238 [&](const Track* pTrack) { return pTrack == track; };
239 if (otherTracks)
240 {
242 "When truncating independently, there may only be one selected audio track in each Sync-Locked Track Group."));
243 return false;
244 }
245 }
246
247 ++nGroups;
248 }
249 }
250
251 if (nGroups == 0)
252 // nothing to do
253 return true;
254
255 // Now do the work
256
257 // Copy tracks
258 EffectOutputTracks outputs {
259 *mTracks, GetType(), { { mT0, mT1 } }, true, true
260 };
261 double newT1 = 0.0;
262
263 {
264 unsigned iGroup = 0;
265 for (auto track : outputs.Get().Selected<WaveTrack>())
266 {
267 RegionList silences;
268 if (!FindSilences(
269 silences, TrackList::SingletonRange(&as_const(*track))))
270 return false;
271 // Treat tracks in the sync lock group only
272 Track *groupFirst, *groupLast;
273 auto range = syncLock ? SyncLock::Group(*track) :
274 TrackList::SingletonRange<Track>(track);
275 double totalCutLen = 0.0;
276 if (!DoRemoval(silences, range, iGroup, nGroups, totalCutLen))
277 return false;
278 newT1 = std::max(newT1, mT1 - totalCutLen);
279
280 ++iGroup;
281 }
282 }
283
284 mT1 = newT1;
285
286 outputs.Commit();
287
288 return true;
289}
const AudacityProject * FindProject() const
Definition: EffectBase.cpp:220
static TrackIterRange< Track > Group(Track &track)
Definition: SyncLock.cpp:150
bool IsSyncLocked() const
Definition: SyncLock.cpp:44
static SyncLockState & Get(AudacityProject &project)
Definition: SyncLock.cpp:27
bool IsSelected() const
Definition: Track.cpp:258
A flat linked list of tracks supporting Add, Remove, Clear, and Contains, serialization of the list o...
Definition: Track.h:850
static auto SingletonRange(TrackType *pTrack) -> TrackIterRange< TrackType >
Definition: Track.h:981
MessageBoxResult ShowMessageBox(const TranslatableString &message, MessageBoxOptions options={})
Show a modal message box with either Ok or Yes and No, and optionally Cancel.
Definition: BasicUI.h:287

References DoRemoval(), EffectBase::FindProject(), FindSilences(), SyncLockState::Get(), GetType(), SyncLock::Group(), EffectBase::inputTracks(), Track::IsSelected(), SyncLockState::IsSyncLocked(), EffectBase::mT0, EffectBase::mT1, EffectBase::mTracks, BasicUI::ShowMessageBox(), TrackList::SingletonRange(), and XO().

Referenced by Process().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ ActIndex

constexpr EnumParameter TruncSilenceBase::ActIndex
staticconstexprprotected
Initial value:

Definition at line 105 of file TruncSilenceBase.h.

Referenced by LoadSettings(), and Parameters().

◆ Compress

constexpr EffectParameter TruncSilenceBase::Compress
staticconstexprprotected
Initial value:
{
L"Compress",
50.0,
0.0,
99.9,
1
}

Definition at line 129 of file TruncSilenceBase.h.

Referenced by Parameters().

◆ Independent

constexpr EffectParameter TruncSilenceBase::Independent
staticconstexprprotected
Initial value:
{
&TruncSilenceBase::mbIndependent, L"Independent", false, false, true, 1
}

Definition at line 137 of file TruncSilenceBase.h.

Referenced by Parameters().

◆ kActionStrings

const EnumValueSymbol TruncSilenceBase::kActionStrings
staticprotected
Initial value:
= {
{ XO("Truncate Detected Silence") }, { XO("Compress Excess Silence") }
}

Definition at line 100 of file TruncSilenceBase.h.

Referenced by LoadSettings().

◆ mActionIndex

int TruncSilenceBase::mActionIndex
protected

Definition at line 83 of file TruncSilenceBase.h.

Referenced by Analyze(), DoRemoval(), LoadSettings(), and EffectTruncSilence::UpdateUI().

◆ mbIndependent

bool TruncSilenceBase::mbIndependent
protected

Definition at line 87 of file TruncSilenceBase.h.

Referenced by Process(), and EffectTruncSilence::TransferDataFromWindow().

◆ mBlendFrameCount

size_t TruncSilenceBase::mBlendFrameCount
protected

Definition at line 89 of file TruncSilenceBase.h.

Referenced by DoRemoval(), and TruncSilenceBase().

◆ Minimum

constexpr EffectParameter TruncSilenceBase::Minimum
staticconstexprprotected
Initial value:
{
L"Minimum",
0.5,
0.001,
10000.0,
1
}

Definition at line 113 of file TruncSilenceBase.h.

Referenced by Parameters().

◆ mInitialAllowedSilence

double TruncSilenceBase::mInitialAllowedSilence
protected

Definition at line 84 of file TruncSilenceBase.h.

Referenced by Analyze(), DoRemoval(), and FindSilences().

◆ mSilenceCompressPercent

double TruncSilenceBase::mSilenceCompressPercent
protected

Definition at line 86 of file TruncSilenceBase.h.

Referenced by Analyze(), and DoRemoval().

◆ mThresholdDB

double TruncSilenceBase::mThresholdDB {}
protected

Definition at line 82 of file TruncSilenceBase.h.

Referenced by Analyze(), and LoadSettings().

◆ mTruncLongestAllowedSilence

double TruncSilenceBase::mTruncLongestAllowedSilence
protected

Definition at line 85 of file TruncSilenceBase.h.

Referenced by Analyze(), and DoRemoval().

◆ Symbol

const ComponentInterfaceSymbol TruncSilenceBase::Symbol
static
Initial value:
{ XO(
"Truncate Silence") }

Definition at line 32 of file TruncSilenceBase.h.

Referenced by GetSymbol().

◆ Threshold

constexpr EffectParameter TruncSilenceBase::Threshold
staticconstexprprotected
Initial value:
{
&TruncSilenceBase::mThresholdDB, L"Threshold", -20.0, -80.0, -20.0, 1
}

Definition at line 102 of file TruncSilenceBase.h.

Referenced by LoadSettings(), and Parameters().

◆ Truncate

constexpr EffectParameter TruncSilenceBase::Truncate
staticconstexprprotected
Initial value:
{
L"Truncate",
0.5,
0.0,
10000.0,
1
}

Definition at line 121 of file TruncSilenceBase.h.

Referenced by Parameters().


The documentation for this class was generated from the following files: