This repository has been archived on 2025-08-26. You can view files and clone it, but cannot push or open issues or pull requests.
Files
enginex_bi_series-sherpa-onnx/ios-swiftui/SherpaOnnxSubtitle/SherpaOnnxSubtitle/Models/SpeechSegment.swift
2023-09-25 16:36:16 +08:00

32 lines
610 B
Swift

//
// SpeechSegment.swift
// SherpaOnnxSubtitle
//
// Created by knight on 2023/9/23.
//
import Foundation
class SpeechSegment: CustomStringConvertible {
let start: Float
let end: Float
let text: String
init(start: Float, duration: Float, text: String) {
self.start = start
end = start + duration
self.text = text
}
public var description: String {
var s: String
s = TimeInterval(start).hourMinuteSecondMS
s += " --> "
s += TimeInterval(end).hourMinuteSecondMS
s += "\n"
s += text
return s
}
}