mirror of
https://github.com/chidiwilliams/buzz.git
synced 2026-03-14 22:55:46 +01:00
Add csv export (#368)
This commit is contained in:
parent
5d2ac6a3fa
commit
c9045dc376
6 changed files with 12 additions and 13 deletions
Binary file not shown.
|
|
@ -860,8 +860,8 @@
|
|||
filePath = "Buzz/TranscriptionExporter.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "70"
|
||||
endingLineNumber = "70"
|
||||
startingLineNumber = "75"
|
||||
endingLineNumber = "75"
|
||||
landmarkName = "export(transcription:format:)"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
|
|
@ -870,14 +870,14 @@
|
|||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
uuid = "1140C7DF-92BB-4FE0-B2D7-85617DBA41DC"
|
||||
shouldBeEnabled = "Yes"
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Buzz/TranscriptionExporter.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "71"
|
||||
endingLineNumber = "71"
|
||||
startingLineNumber = "76"
|
||||
endingLineNumber = "76"
|
||||
landmarkName = "export(transcription:format:)"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ struct ContentView: View {
|
|||
transcriber.start() { segment in
|
||||
DispatchQueue.main.async {
|
||||
line = segment.text
|
||||
currentRecordingTranscription?.segments.insert(segment, at: 0)
|
||||
currentRecordingTranscription?.segments.append(segment)
|
||||
}
|
||||
}
|
||||
self.transcriber = transcriber
|
||||
|
|
|
|||
|
|
@ -8,5 +8,5 @@
|
|||
import Foundation
|
||||
|
||||
enum ExportFormat: String, CaseIterable {
|
||||
case TXT, SRT, VTT
|
||||
case CSV, SRT, TXT, VTT
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,6 +64,11 @@ class TranscriptionExporter {
|
|||
.appending("\(toTimestamp(ms: startMS)) --> \(toTimestamp(ms: endMS))\n")
|
||||
.appending("\(segment.text)\n\n")
|
||||
}
|
||||
case .CSV:
|
||||
output = output.appending("Start time (ms), End time (ms),Text\n")
|
||||
transcription.segments.forEach { segment in
|
||||
output = output.appending("\(segment.startMS ?? 0),\(segment.endMS ?? 0),\"\(segment.text)\"\n")
|
||||
}
|
||||
}
|
||||
|
||||
do {
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
# Buzz.swift
|
||||
|
||||
## TODO
|
||||
|
||||
- Save transcriptions to disk
|
||||
- Export transcription to TXT, SRT, VTT
|
||||
Loading…
Add table
Add a link
Reference in a new issue