mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Allow speechmarks data to be empty
This commit is contained in:
parent
3d9976e06a
commit
aad1a51da8
1 changed files with 5 additions and 4 deletions
|
|
@ -191,10 +191,11 @@ struct SpeechSynthesizer {
|
|||
let decoder = JSONDecoder()
|
||||
|
||||
if !redownloadCached {
|
||||
if let speechMarksData = try? Data(contentsOf: speechItem.localSpeechURL),
|
||||
let speechMarks = try? decoder.decode([SpeechMark].self, from: speechMarksData),
|
||||
let localData = try? Data(contentsOf: speechItem.localAudioURL)
|
||||
{
|
||||
if let localData = try? Data(contentsOf: speechItem.localAudioURL) {
|
||||
var speechMarks: [SpeechMark]?
|
||||
if let speechMarksData = try? Data(contentsOf: speechItem.localSpeechURL) {
|
||||
speechMarks = try? decoder.decode([SpeechMark].self, from: speechMarksData)
|
||||
}
|
||||
return SynthesizeData(audioData: localData, speechMarks: speechMarks)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue