Skip to content

Commit a4cd163

Browse files
committed
Address feedback
1 parent a6f615f commit a4cd163

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Sources/StreamVideo/Utils/AudioSession/AudioDeviceModule/AudioEngineLevelNodeAdapter.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ protocol AudioEngineNodeAdapting {
2525
/// analytics consumers.
2626
final class AudioEngineLevelNodeAdapter: AudioEngineNodeAdapting {
2727

28+
enum Constant {
29+
// The down limit of audio pipeline in DB that is considered silence.
30+
static let silenceDB: Float = -160
31+
}
32+
2833
var subject: CurrentValueSubject<Float, Never>?
2934

3035
// private let publisher: (Float) -> Void
@@ -62,7 +67,7 @@ final class AudioEngineLevelNodeAdapter: AudioEngineNodeAdapting {
6267
if let mixer = inputTap, mixer.engine != nil {
6368
mixer.removeTap(onBus: 0)
6469
}
65-
subject?.send(-160)
70+
subject?.send(Constant.silenceDB)
6671
inputTap = nil
6772
log.debug("Input node uninstalled", subsystems: .audioRecording)
6873
}

0 commit comments

Comments
 (0)