Release 1.1.0: Add Import Audio Files feature
- New Import tab with drag-and-drop support for audio files - Support for 8 formats: MP3, MP4, WAV, M4A, FLAC, OGG, AAC, WMA - File metadata display (duration, size, format) - Editable meeting titles - Progress tracking with visual indicators - Smart template selection - Auto-navigation to Transcription view - Updated README with BlackHole requirement and Teams config - Added get_audio_metadata Rust command - Version bump to 1.1.0
This commit is contained in:
@@ -110,6 +110,9 @@ func createAggregateDevice() {
|
||||
}
|
||||
print("Found BlackHole 2ch (ID: \(blackHoleID))")
|
||||
|
||||
// --- PART 1: Hearbit Audio (Input: Mic + BlackHole) ---
|
||||
print("\n--- Creating 'Hearbit Audio' (Input) ---")
|
||||
|
||||
// Default Input
|
||||
var defaultInputID: AudioObjectID = 0
|
||||
var size = UInt32(MemoryLayout<AudioObjectID>.size)
|
||||
@@ -125,19 +128,14 @@ func createAggregateDevice() {
|
||||
}
|
||||
print("Found Default Input (ID: \(defaultInputID))")
|
||||
|
||||
// Check for existing "Hearbit Audio" by UID
|
||||
let targetUID = "hearbit_audio_aggregate_v1"
|
||||
if let existingID = findDeviceByUID(targetUID) {
|
||||
print("Found existing Hearbit Audio device (ID: \(existingID)). Destroying to recreate...")
|
||||
if AudioHardwareDestroyAggregateDevice(existingID) != noErr {
|
||||
print("Warning: Failed to destroy existing device.")
|
||||
} else {
|
||||
print("Existing device destroyed.")
|
||||
}
|
||||
// Check for existing "Hearbit Audio"
|
||||
let inputUID = "hearbit_audio_aggregate_v1"
|
||||
if let existingID = findDeviceByUID(inputUID) {
|
||||
print("Found existing Hearbit Audio (ID: \(existingID)). Destroying...")
|
||||
AudioHardwareDestroyAggregateDevice(existingID)
|
||||
Thread.sleep(forTimeInterval: 0.5)
|
||||
}
|
||||
|
||||
// Build SubDevice List
|
||||
guard let bhUID = getStringProperty(objectID: blackHoleID, selector: kAudioDevicePropertyDeviceUID) else {
|
||||
print("Error: Could not get BlackHole UID.")
|
||||
exit(1)
|
||||
@@ -147,36 +145,47 @@ func createAggregateDevice() {
|
||||
exit(1)
|
||||
}
|
||||
|
||||
// Dedup: if Mic IS BlackHole (user set BlackHole as default), don't duplicate
|
||||
var subDevicesUIDs = [bhUID]
|
||||
if micUID != bhUID {
|
||||
subDevicesUIDs.append(micUID)
|
||||
}
|
||||
|
||||
let subDevicesArray = subDevicesUIDs.map {
|
||||
[kAudioSubDeviceUIDKey: $0]
|
||||
}
|
||||
|
||||
let desc: [String: Any] = [
|
||||
let subDevicesArray = subDevicesUIDs.map { [kAudioSubDeviceUIDKey: $0] }
|
||||
let inputDesc: [String: Any] = [
|
||||
kAudioAggregateDeviceNameKey: "Hearbit Audio",
|
||||
kAudioAggregateDeviceUIDKey: targetUID,
|
||||
kAudioAggregateDeviceUIDKey: inputUID,
|
||||
kAudioAggregateDeviceIsPrivateKey: Int(0),
|
||||
kAudioAggregateDeviceIsStackedKey: Int(0),
|
||||
kAudioAggregateDeviceSubDeviceListKey: subDevicesArray
|
||||
]
|
||||
|
||||
print("Creating Aggregate Device with UIDs: \(subDevicesUIDs)")
|
||||
|
||||
var outID: AudioObjectID = 0
|
||||
let err = AudioHardwareCreateAggregateDevice(desc as CFDictionary, &outID)
|
||||
|
||||
if err == noErr {
|
||||
print("Success! Created 'Hearbit Audio' with ID: \(outID)")
|
||||
exit(0)
|
||||
var outInputID: AudioObjectID = 0
|
||||
let errIn = AudioHardwareCreateAggregateDevice(inputDesc as CFDictionary, &outInputID)
|
||||
if errIn == noErr {
|
||||
print("Success! Created 'Hearbit Audio' with ID: \(outInputID)")
|
||||
} else {
|
||||
print("Failed to create device. Error code: \(err) (\(err.fourCC))")
|
||||
exit(1)
|
||||
print("Failed to create 'Hearbit Audio'. Error: \(errIn)")
|
||||
}
|
||||
|
||||
|
||||
// --- PART 2: Cleanup Unstable "Hearbit Speakers" ---
|
||||
// The previous "Hearbit Speakers" device caused MS Teams to crash.
|
||||
// We strictly remove it here to restore stability.
|
||||
print("\n--- Cleaning up Unstable Devices ---")
|
||||
let stopOutputUID = "hearbit_speakers_aggregate_v1"
|
||||
if let existingOutID = findDeviceByUID(stopOutputUID) {
|
||||
print("Found unstable 'Hearbit Speakers' (ID: \(existingOutID)). Removing to fix Teams crash...")
|
||||
let errDist = AudioHardwareDestroyAggregateDevice(existingOutID)
|
||||
if errDist == noErr {
|
||||
print("Successfully removed unstable device.")
|
||||
} else {
|
||||
print("Warning: Failed to remove device. Error: \(errDist)")
|
||||
}
|
||||
} else {
|
||||
print("No unstable 'Hearbit Speakers' found. System is clean.")
|
||||
}
|
||||
|
||||
exit(0)
|
||||
}
|
||||
|
||||
createAggregateDevice()
|
||||
|
||||
Reference in New Issue
Block a user