fix: preserve transcription failures and audio diagnostics
This commit is contained in:
@@ -63,6 +63,10 @@ final class ProcessTap {
|
||||
@ObservationIgnored
|
||||
private(set) var tapStreamDescription: AudioStreamBasicDescription?
|
||||
@ObservationIgnored
|
||||
private(set) var tapAdvertisedStreamDescription: AudioStreamBasicDescription?
|
||||
@ObservationIgnored
|
||||
private(set) var aggregateInputStreamDescription: AudioStreamBasicDescription?
|
||||
@ObservationIgnored
|
||||
private var invalidationHandler: InvalidationHandler?
|
||||
|
||||
@ObservationIgnored
|
||||
@@ -249,6 +253,7 @@ final class ProcessTap {
|
||||
do {
|
||||
logger.debug("Attempting to read audio tap stream basic description for tapID #\(tapID)...")
|
||||
let advertisedDescription = try tapID.readAudioTapStreamBasicDescription()
|
||||
self.tapAdvertisedStreamDescription = advertisedDescription
|
||||
|
||||
// The aggregate device may adapt the tap to the active hardware's
|
||||
// sample rate. Its input stream is the format actually delivered
|
||||
@@ -256,7 +261,9 @@ final class ProcessTap {
|
||||
// advertisement. Using the latter can halve the written duration
|
||||
// when, for example, a 48 kHz tap is delivered at 24 kHz.
|
||||
do {
|
||||
self.tapStreamDescription = try aggregateDeviceID.readInputStreamBasicDescription()
|
||||
let aggregateDescription = try aggregateDeviceID.readInputStreamBasicDescription()
|
||||
self.aggregateInputStreamDescription = aggregateDescription
|
||||
self.tapStreamDescription = aggregateDescription
|
||||
logger.info("Using aggregate input stream description: \(String(describing: self.tapStreamDescription), privacy: .public); tap advertised: \(String(describing: advertisedDescription), privacy: .public)")
|
||||
} catch {
|
||||
self.tapStreamDescription = advertisedDescription
|
||||
|
||||
Reference in New Issue
Block a user