mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Fix duration estimation based on word count
This commit is contained in:
parent
66ea008f05
commit
8a9c1f4100
1 changed files with 2 additions and 6 deletions
|
|
@ -34,7 +34,7 @@ struct Utterance: Decodable {
|
|||
struct SpeechDocument: Decodable {
|
||||
public let pageId: String
|
||||
|
||||
public let averageWPM: Double = 150
|
||||
public let averageWPM: Double = 195
|
||||
public let wordCount: Double
|
||||
|
||||
public let language: String
|
||||
|
|
@ -42,12 +42,8 @@ struct SpeechDocument: Decodable {
|
|||
|
||||
public let utterances: [Utterance]
|
||||
|
||||
public func approxDuration(forSpeed speed: Double) -> Double {
|
||||
wordCount / averageWPM * speed / 60.0
|
||||
}
|
||||
|
||||
public func estimatedDuration(utterance: Utterance, speed: Double) -> Double {
|
||||
utterance.wordCount / averageWPM * speed / 60.0
|
||||
utterance.wordCount / averageWPM * speed * 60.0
|
||||
}
|
||||
|
||||
var audioDirectory: URL {
|
||||
|
|
|
|||
Loading…
Reference in a new issue