Skip to content

Commit

Permalink
Fixing more Periphery issues
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanRakutoBell committed Feb 13, 2025
1 parent c9e97ff commit 8a51cdc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CoughSync/CoughDetection/SoundAnalysisManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ final class SoundAnalysisManager: NSObject, @unchecked Sendable {
request.overlapFactor = overlapFactor
}

self.subject = subject
// self.subject = subject
try startAnalysis((request, observer))
} catch {
print("Unable to prepare request with Sound Classifier: \(error.localizedDescription)")
Expand Down Expand Up @@ -113,6 +113,7 @@ final class SoundAnalysisManager: NSObject, @unchecked Sendable {
self.streamAnalyzer = streamAnalyzer
try streamAnalyzer.add(requestAndObserver.request, withObserver: requestAndObserver.observer)
retainedObserver = requestAndObserver.observer
useObserver()
self.audioRecorder?.inputNode.installTap(
onBus: inputBus,
bufferSize: UInt32(bufferSize),
Expand All @@ -129,4 +130,8 @@ final class SoundAnalysisManager: NSObject, @unchecked Sendable {
print("Unable to start AVAudioEngine: \(error.localizedDescription)")
}
}

private func useObserver() {
_ = retainedObserver
}
}

0 comments on commit 8a51cdc

Please sign in to comment.