While recording, the HUD now shows a rough live transcript using macOS's on-device dictation model (SpeechAnalyzer + DictationTranscriber), which also supports Hungarian. It is only a preview: Whisper still produces the pasted text. The preview captures the microphone with its own AVAudioEngine, leaving the AVAudioRecorder path for Whisper untouched, so a preview failure just means no preview. Audio is buffered from the moment recording starts so the first words aren't lost while the model spins up; dictionary terms are passed as contextual strings and replacements are applied to the preview text. The dictation model for the selected language is registered/downloaded at launch and on language change, and awaited inline if needed. The HUD is wider and shows the last three lines of the transcript; after recording it stays up as "Transcribing…" until the final text is pasted. A "Live preview while recording" setting (on by default) turns it off. No extra permission is required beyond the microphone. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
56 sor
1.6 KiB
Makefile
56 sor
1.6 KiB
Makefile
# WhisperDictate macOS Build
|
|
|
|
APP_NAME = WhisperDictate
|
|
APP_BUNDLE = $(APP_NAME).app
|
|
VERSION = 1.3.1
|
|
|
|
# Directories
|
|
SRC_DIR = src
|
|
BUILD_DIR = build
|
|
BUNDLE_DIR = $(APP_BUNDLE)/Contents
|
|
|
|
# Compiler settings
|
|
SWIFT = swiftc
|
|
SWIFT_FLAGS = -O -framework Cocoa -framework AVFoundation -framework Speech -framework Carbon -framework CoreGraphics -framework ServiceManagement
|
|
|
|
.PHONY: all clean build bundle install run dmg
|
|
|
|
all: build
|
|
|
|
build: $(BUILD_DIR)/$(APP_NAME)
|
|
@echo "✓ Build complete"
|
|
|
|
$(BUILD_DIR)/$(APP_NAME): $(SRC_DIR)/main.swift
|
|
@mkdir -p $(BUILD_DIR)
|
|
@mkdir -p $(BUNDLE_DIR)/MacOS
|
|
@mkdir -p $(BUNDLE_DIR)/Resources
|
|
@mkdir -p $(BUNDLE_DIR)/Frameworks
|
|
$(SWIFT) $(SWIFT_FLAGS) -o $(BUNDLE_DIR)/MacOS/$(APP_NAME) $(SRC_DIR)/main.swift
|
|
@cp $(APP_BUNDLE)/Contents/Info.plist $(BUNDLE_DIR)/ 2>/dev/null || true
|
|
@./bundle-whisper.sh
|
|
@touch $(BUILD_DIR)/$(APP_NAME)
|
|
@echo "✓ Built $(APP_BUNDLE)"
|
|
|
|
clean:
|
|
rm -rf $(BUILD_DIR)
|
|
rm -rf $(BUNDLE_DIR)/MacOS/$(APP_NAME)
|
|
rm -rf $(BUNDLE_DIR)/MacOS/whisper-cli
|
|
rm -rf $(BUNDLE_DIR)/Frameworks/*.dylib
|
|
@echo "✓ Cleaned"
|
|
|
|
install: build
|
|
@rm -rf /Applications/$(APP_BUNDLE)
|
|
@cp -R $(APP_BUNDLE) /Applications/
|
|
@codesign --force --deep --sign - /Applications/$(APP_BUNDLE)
|
|
@echo "✓ Installed to /Applications/$(APP_BUNDLE)"
|
|
|
|
run: build
|
|
@./$(BUNDLE_DIR)/MacOS/$(APP_NAME) &
|
|
@echo "✓ Running $(APP_NAME)"
|
|
|
|
dmg: build
|
|
@rm -f $(APP_NAME)-$(VERSION).dmg
|
|
@codesign --force --deep --sign - $(APP_BUNDLE)
|
|
@hdiutil create -volname "$(APP_NAME)" -srcfolder $(APP_BUNDLE) -ov -format UDZO $(APP_NAME)-$(VERSION).dmg
|
|
@echo "✓ Created $(APP_NAME)-$(VERSION).dmg"
|