From 7a216cddca18a7973994c480e7f3c8ece729f600 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 00:07:23 +0000 Subject: [PATCH 1/2] Dettatura: log degli errori della sessione audio invece di try? (#17) Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01AVhvvLeKauUpYQ63FaNN1A --- CalenTask/Services/SpeechCaptureService.swift | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/CalenTask/Services/SpeechCaptureService.swift b/CalenTask/Services/SpeechCaptureService.swift index 2d06a8d..08ba4a6 100644 --- a/CalenTask/Services/SpeechCaptureService.swift +++ b/CalenTask/Services/SpeechCaptureService.swift @@ -74,7 +74,11 @@ final class SpeechCaptureService { request = nil isRecording = false #if os(iOS) - try? AVAudioSession.sharedInstance().setActive(false, options: .notifyOthersOnDeactivation) + do { + try AVAudioSession.sharedInstance().setActive(false, options: .notifyOthersOnDeactivation) + } catch { + Log.app.error("Sessione audio: disattivazione fallita: \(error.localizedDescription, privacy: .public)") + } #endif } @@ -87,8 +91,12 @@ final class SpeechCaptureService { #if os(iOS) let session = AVAudioSession.sharedInstance() - try? session.setCategory(.record, mode: .measurement, options: .duckOthers) - try? session.setActive(true, options: .notifyOthersOnDeactivation) + do { + try session.setCategory(.record, mode: .measurement, options: .duckOthers) + try session.setActive(true, options: .notifyOthersOnDeactivation) + } catch { + Log.app.error("Sessione audio: attivazione fallita: \(error.localizedDescription, privacy: .public)") + } #endif let request = SFSpeechAudioBufferRecognitionRequest() From 1dd05c4138acb141e91e61aacb5ccf0c561d945c Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 00:10:58 +0000 Subject: [PATCH 2/2] SpeechCaptureService: import os per il logging (#17) Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01AVhvvLeKauUpYQ63FaNN1A --- CalenTask/Services/SpeechCaptureService.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/CalenTask/Services/SpeechCaptureService.swift b/CalenTask/Services/SpeechCaptureService.swift index 08ba4a6..d50ce2b 100644 --- a/CalenTask/Services/SpeechCaptureService.swift +++ b/CalenTask/Services/SpeechCaptureService.swift @@ -2,6 +2,7 @@ import Foundation import Speech import AVFoundation import Observation +import os /// Voice capture (S6/D66): dettatura on-device → testo nella cattura. /// Italiano, offline quando il modello locale è disponibile.