Skip to content
This repository has been archived by the owner on Nov 26, 2020. It is now read-only.

Commit

Permalink
Merge pull request #93 from FolioReader/feature/tts-voice-language-#87
Browse files Browse the repository at this point in the history
Closes #87 TTS voice language
  • Loading branch information
hebertialmeida authored Jul 12, 2016
2 parents 2398d4f + edab660 commit ef3f317
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Source/EPUBCore/FREpubParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ class FREpubParser: NSObject, SSZipArchiveDelegate {
}

if tag.name == "dc:language" {
metadata.language = tag.value ?? ""
let language = tag.value ?? metadata.language
metadata.language = language != "en" ? language : metadata.language
}

if tag.name == "dc:creator" {
Expand Down
2 changes: 1 addition & 1 deletion Source/EPUBCore/FRMetadata.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class FRMetadata: NSObject {
var creators = [Author]()
var contributors = [Author]()
var dates = [Date]()
var language = "en"
var language = "en-US"
var titles = [String]()
var identifiers = [Identifier]()
var subjects = [String]()
Expand Down
2 changes: 2 additions & 0 deletions Source/FolioReaderAudioPlayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,8 @@ class FolioReaderAudioPlayer: NSObject, AVAudioPlayerDelegate, AVSpeechSynthesiz

let utterance = AVSpeechUtterance(string: text)
utterance.rate = utteranceRate
utterance.voice = AVSpeechSynthesisVoice(language: book.metadata.language)

if(synthesizer.speaking){
synthesizer.stopSpeakingAtBoundary(AVSpeechBoundary.Word)
}
Expand Down

0 comments on commit ef3f317

Please sign in to comment.