MCPcopy Create free account
hub / github.com/altic-dev/FluidVoice / exportAudioZip

Method exportAudioZip

Sources/Fluid/UI/SettingsView.swift:1676–1698  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1674 }
1675
1676 private func exportAudioZip() {
1677 do {
1678 guard TranscriptionHistoryStore.shared.entries.contains(where: {
1679 DictationAudioHistoryStore.shared.audioFileExists(for: $0)
1680 }) else {
1681 throw DictationAudioHistoryError.noAudioEntries
1682 }
1683
1684 let panel = NSSavePanel()
1685 panel.canCreateDirectories = true
1686 panel.allowedContentTypes = [.zip]
1687 panel.nameFieldStringValue = DictationAudioHistoryStore.shared.suggestedAudioExportFilename()
1688
1689 guard panel.runModal() == .OK, let url = panel.url else { return }
1690 try DictationAudioHistoryStore.shared.exportAudioArchive(
1691 entries: TranscriptionHistoryStore.shared.entries,
1692 to: url
1693 )
1694 self.presentInfoAlert(title: "Audio Export Saved", message: "Saved your dictation audio export to:\n\(url.path)")
1695 } catch {
1696 self.presentErrorAlert(title: "Audio Export Failed", message: error.localizedDescription)
1697 }
1698 }
1699
1700 private func presentInfoAlert(title: String, message: String) {
1701 let alert = NSAlert()

Callers 1

audioHistoryControlsMethod · 0.95

Calls 5

presentInfoAlertMethod · 0.95
presentErrorAlertMethod · 0.95
audioFileExistsMethod · 0.80
exportAudioArchiveMethod · 0.80

Tested by

no test coverage detected