Minor fixes

This commit is contained in:
Beingpax 2025-04-23 11:46:40 +05:45
parent 59a82fe77d
commit d4364c586d
4 changed files with 14 additions and 16 deletions

View File

@ -448,7 +448,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES; COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 121; CURRENT_PROJECT_VERSION = 123;
DEVELOPMENT_ASSET_PATHS = "\"VoiceInk/Preview Content\""; DEVELOPMENT_ASSET_PATHS = "\"VoiceInk/Preview Content\"";
DEVELOPMENT_TEAM = V6J6A3VWY2; DEVELOPMENT_TEAM = V6J6A3VWY2;
ENABLE_HARDENED_RUNTIME = YES; ENABLE_HARDENED_RUNTIME = YES;
@ -463,7 +463,7 @@
"@executable_path/../Frameworks", "@executable_path/../Frameworks",
); );
MACOSX_DEPLOYMENT_TARGET = 14.0; MACOSX_DEPLOYMENT_TARGET = 14.0;
MARKETING_VERSION = 1.21; MARKETING_VERSION = 1.23;
PRODUCT_BUNDLE_IDENTIFIER = com.prakashjoshipax.VoiceInk; PRODUCT_BUNDLE_IDENTIFIER = com.prakashjoshipax.VoiceInk;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_EMIT_LOC_STRINGS = YES;
@ -481,7 +481,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES; COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 121; CURRENT_PROJECT_VERSION = 123;
DEVELOPMENT_ASSET_PATHS = "\"VoiceInk/Preview Content\""; DEVELOPMENT_ASSET_PATHS = "\"VoiceInk/Preview Content\"";
DEVELOPMENT_TEAM = V6J6A3VWY2; DEVELOPMENT_TEAM = V6J6A3VWY2;
ENABLE_HARDENED_RUNTIME = YES; ENABLE_HARDENED_RUNTIME = YES;
@ -496,7 +496,7 @@
"@executable_path/../Frameworks", "@executable_path/../Frameworks",
); );
MACOSX_DEPLOYMENT_TARGET = 14.0; MACOSX_DEPLOYMENT_TARGET = 14.0;
MARKETING_VERSION = 1.21; MARKETING_VERSION = 1.23;
PRODUCT_BUNDLE_IDENTIFIER = com.prakashjoshipax.VoiceInk; PRODUCT_BUNDLE_IDENTIFIER = com.prakashjoshipax.VoiceInk;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_EMIT_LOC_STRINGS = YES;

View File

@ -17,13 +17,13 @@ enum PromptIcon: String, Codable, CaseIterable {
case briefcaseFill = "briefcase.fill" case briefcaseFill = "briefcase.fill"
// Technical // Technical
case codeFill = "chevron.left.forwardslash.chevron.right.fill" case codeFill = "curlybraces"
case terminalFill = "terminal.fill" case terminalFill = "terminal.fill"
case gearFill = "gearshape.fill" case gearFill = "gearshape.fill"
// Content // Content
case blogFill = "doc.text.image.fill" case blogFill = "doc.text.image.fill"
case notesFill = "note.text" case notesFill = "note"
case bookFill = "book.fill" case bookFill = "book.fill"
case bookmarkFill = "bookmark.fill" case bookmarkFill = "bookmark.fill"
case pencilFill = "pencil.circle.fill" case pencilFill = "pencil.circle.fill"
@ -31,7 +31,7 @@ enum PromptIcon: String, Codable, CaseIterable {
// Media & Creative // Media & Creative
case videoFill = "video.fill" case videoFill = "video.fill"
case micFill = "mic.fill" case micFill = "mic.fill"
case musicFill = "music.note.list" case musicFill = "music.note"
case photoFill = "photo.fill" case photoFill = "photo.fill"
case brushFill = "paintbrush.fill" case brushFill = "paintbrush.fill"

View File

@ -95,6 +95,7 @@ class Recorder: ObservableObject {
} catch { } catch {
logger.error("Failed to create audio file: \(error.localizedDescription)") logger.error("Failed to create audio file: \(error.localizedDescription)")
await mediaController.unmuteSystemAudio() await mediaController.unmuteSystemAudio()
stopRecording()
throw RecorderError.couldNotStartRecording throw RecorderError.couldNotStartRecording
} }
@ -161,6 +162,7 @@ class Recorder: ObservableObject {
try engine!.start() try engine!.start()
} catch { } catch {
await mediaController.unmuteSystemAudio() await mediaController.unmuteSystemAudio()
stopRecording()
throw RecorderError.couldNotStartRecording throw RecorderError.couldNotStartRecording
} }
} }

View File

@ -291,19 +291,15 @@ extension WhisperState {
recorder.stopRecording() recorder.stopRecording()
try? await Task.sleep(nanoseconds: 500_000_000) try? await Task.sleep(nanoseconds: 500_000_000)
let canCleanup = !isRecording && !isProcessing await whisperContext?.releaseResources()
whisperContext = nil
if canCleanup { isModelLoaded = false
await whisperContext?.releaseResources()
whisperContext = nil
isModelLoaded = false
}
} }
// MARK: - Helper Methods // MARK: - Helper Methods
private func logError(_ message: String, _ error: Error) { private func logError(_ message: String, _ error: Error) {
messageLog += "\(message): \(error.localizedDescription)\n" logger.notice("\(message): \(error.localizedDescription)\n")
} }
} }
@ -373,4 +369,4 @@ struct DownloadProgressView: View {
.padding(.vertical, 4) .padding(.vertical, 4)
.animation(.smooth, value: totalProgress) .animation(.smooth, value: totalProgress)
} }
} }