-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#12 ReplayGain - added custom node + fx unit + id3 parsing
- Loading branch information
1 parent
dd438e4
commit 0c53bbb
Showing
21 changed files
with
352 additions
and
18 deletions.
There are no files selected for viewing
This file contains 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
Binary file modified
BIN
+81.5 KB
(100%)
....xcodeproj/project.xcworkspace/xcuserdata/kven.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
This file contains 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
File renamed without changes.
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// | ||
// ReplayGainNode.swift | ||
// Aural | ||
// | ||
// Copyright © 2021 Kartik Venugopal. All rights reserved. | ||
// | ||
// This software is licensed under the MIT software license. | ||
// See the file "LICENSE" in the project root directory for license terms. | ||
// | ||
|
||
import AVFoundation | ||
|
||
/// | ||
/// A custom subclass of **AVAudioUnitEQ** that applies a "ReplayGain" effect through its "replayGain" and "preAmp" properties. | ||
/// | ||
class ReplayGainNode: AVAudioUnitEQ { | ||
|
||
static let validGainRange: ClosedRange<Float> = -20...20 | ||
|
||
override init() {super.init(numberOfBands: 0)} | ||
|
||
fileprivate init(_ numBands: Int) { | ||
super.init(numberOfBands: 0) | ||
} | ||
|
||
override var globalGain: Float { | ||
|
||
get {super.globalGain} | ||
|
||
// globalGain cannot be set externally | ||
set {} | ||
} | ||
|
||
var replayGain: Float = 0 { | ||
|
||
didSet { | ||
super.globalGain = (replayGain + preAmp).clamped(to: Self.validGainRange) | ||
} | ||
} | ||
|
||
var preAmp: Float = 0 { | ||
|
||
didSet { | ||
super.globalGain = (replayGain + preAmp).clamped(to: Self.validGainRange) | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
This file contains 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
This file contains 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
Oops, something went wrong.