AVSpeechSynthesizer change voice

Related searches

Is it possible to use another person's voice within the same accent?

For example, when I do AVSpeechSynthesisVoice(language: "en-US"), it automatically uses a woman's voice, but I wanted a man instead, with the same accent.

Is it possible to change the voice within the same accent or the only way is to try another voice of another accent (eg: us-AU)

(note I want to change the whole voice, not properties of it, like pitch, speed, etc)

Thank you


You can use AVSpeechSynthesisVoice(identifier: "com.apple.ttsbundle.siri_male_en-GB_compact")

The identifiers can be found when you print AVSpeechSynthesisVoice.speechVoices()

[AVSpeechSynthesisVoice 0x6080000097d0] Language: ar-SA, Name: Maged, Quality: Default [com.apple.ttsbundle.Maged-compact]
[AVSpeechSynthesisVoice 0x608000009780] Language: cs-CZ, Name: Zuzana, Quality: Default [com.apple.ttsbundle.Zuzana-compact]
[AVSpeechSynthesisVoice 0x608000009440] Language: da-DK, Name: Sara, Quality: Default [com.apple.ttsbundle.Sara-compact]
[AVSpeechSynthesisVoice 0x608000009670] Language: de-DE, Name: Anna, Quality: Default [com.apple.ttsbundle.Anna-compact]
[AVSpeechSynthesisVoice 0x6080000092e0] Language: el-GR, Name: Melina, Quality: Default [com.apple.ttsbundle.Melina-compact]
[AVSpeechSynthesisVoice 0x608000009310] Language: en-AU, Name: Karen, Quality: Default [com.apple.ttsbundle.Karen-compact]
[AVSpeechSynthesisVoice 0x6080000098d0] Language: en-GB, Name: Daniel, Quality: Default [com.apple.ttsbundle.Daniel-compact]
[AVSpeechSynthesisVoice 0x6080000094e0] Language: en-IE, Name: Moira, Quality: Default [com.apple.ttsbundle.Moira-compact]
[AVSpeechSynthesisVoice 0x6080000096b0] Language: en-US, Name: Samantha, Quality: Default [com.apple.ttsbundle.Samantha-compact]
[AVSpeechSynthesisVoice 0x608000009480] Language: en-ZA, Name: Tessa, Quality: Default [com.apple.ttsbundle.Tessa-compact]
[AVSpeechSynthesisVoice 0x6080000093d0] Language: es-ES, Name: Monica, Quality: Default [com.apple.ttsbundle.Monica-compact]
[AVSpeechSynthesisVoice 0x6080000096c0] Language: es-MX, Name: Paulina, Quality: Default [com.apple.ttsbundle.Paulina-compact]
[AVSpeechSynthesisVoice 0x608000009550] Language: fi-FI, Name: Satu, Quality: Default [com.apple.ttsbundle.Satu-compact]
[AVSpeechSynthesisVoice 0x6080000094f0] Language: fr-CA, Name: Amelie, Quality: Default [com.apple.ttsbundle.Amelie-compact]
[AVSpeechSynthesisVoice 0x608000009880] Language: fr-FR, Name: Thomas, Quality: Default [com.apple.ttsbundle.Thomas-compact]
[AVSpeechSynthesisVoice 0x608000009290] Language: he-IL, Name: Carmit, Quality: Default [com.apple.ttsbundle.Carmit-compact]
[AVSpeechSynthesisVoice 0x608000009570] Language: hi-IN, Name: Lekha, Quality: Default [com.apple.ttsbundle.Lekha-compact]
[AVSpeechSynthesisVoice 0x608000009510] Language: hu-HU, Name: Mariska, Quality: Default [com.apple.ttsbundle.Mariska-compact]
[AVSpeechSynthesisVoice 0x608000009040] Language: id-ID, Name: Damayanti, Quality: Default [com.apple.ttsbundle.Damayanti-compact]
[AVSpeechSynthesisVoice 0x6080000096a0] Language: it-IT, Name: Alice, Quality: Default [com.apple.ttsbundle.Alice-compact]
[AVSpeechSynthesisVoice 0x6080000092b0] Language: ja-JP, Name: Kyoko, Quality: Default [com.apple.ttsbundle.Kyoko-compact]
[AVSpeechSynthesisVoice 0x608000009540] Language: ko-KR, Name: Yuna, Quality: Default [com.apple.ttsbundle.Yuna-compact]
[AVSpeechSynthesisVoice 0x6080000090e0] Language: nl-BE, Name: Ellen, Quality: Default [com.apple.ttsbundle.Ellen-compact]
[AVSpeechSynthesisVoice 0x608000009380] Language: nl-NL, Name: Xander, Quality: Default [com.apple.ttsbundle.Xander-compact]
[AVSpeechSynthesisVoice 0x608000009240] Language: no-NO, Name: Nora, Quality: Default [com.apple.ttsbundle.Nora-compact]
[AVSpeechSynthesisVoice 0x6080000090f0] Language: pl-PL, Name: Zosia, Quality: Default [com.apple.ttsbundle.Zosia-compact]
[AVSpeechSynthesisVoice 0x608000009250] Language: pt-BR, Name: Luciana, Quality: Default [com.apple.ttsbundle.Luciana-compact]
[AVSpeechSynthesisVoice 0x6080000094d0] Language: pt-PT, Name: Joana, Quality: Default [com.apple.ttsbundle.Joana-compact]
[AVSpeechSynthesisVoice 0x608000009210] Language: ro-RO, Name: Ioana, Quality: Default [com.apple.ttsbundle.Ioana-compact]
[AVSpeechSynthesisVoice 0x608000009130] Language: ru-RU, Name: Milena, Quality: Default [com.apple.ttsbundle.Milena-compact]
[AVSpeechSynthesisVoice 0x608000009620] Language: sk-SK, Name: Laura, Quality: Default [com.apple.ttsbundle.Laura-compact]
[AVSpeechSynthesisVoice 0x608000009730] Language: sv-SE, Name: Alva, Quality: Default [com.apple.ttsbundle.Alva-compact]
[AVSpeechSynthesisVoice 0x608000009740] Language: th-TH, Name: Kanya, Quality: Default [com.apple.ttsbundle.Kanya-compact]
[AVSpeechSynthesisVoice 0x6080000095e0] Language: tr-TR, Name: Yelda, Quality: Default [com.apple.ttsbundle.Yelda-compact]
[AVSpeechSynthesisVoice 0x608000009010] Language: zh-CN, Name: Ting-Ting, Quality: Default [com.apple.ttsbundle.Ting-Ting-compact]
[AVSpeechSynthesisVoice 0x608000009660] Language: zh-HK, Name: Sin-Ji, Quality: Default [com.apple.ttsbundle.Sin-Ji-compact]
[AVSpeechSynthesisVoice 0x608000009860] Language: zh-TW, Name: Mei-Jia, Quality: Default [com.apple.ttsbundle.Mei-Jia-compact]

Changing Voices in Swift for iOS, When your phone speaks to you, what voice is it using? Changing Voices in Swift for iOS. 30 December 2015. When your phone speaks to you, "Hello from iOS.") utterance.voice = voiceToUse let synth = AVSpeechSynthesizer() synth. The second view controller will be used to specify various settings regarding the speech. More specifically, through this view controller we’ll be able to change the values of the rate, pitch and volume properties, but furthermore we’ll be able to pick a different voice for the speech, other than the default one.


As of Xcodee 8.3.2 a male voice now seems to be available

import UIKit
import AVFoundation

class ViewController: UIViewController {

    let speaker = AVSpeechSynthesizer()
    let dialogue = AVSpeechUtterance(string: "Hello I am clearly a man")

    override func viewDidLoad() {
        super.viewDidLoad()
    }

    @IBAction func speakText(sender: AnyObject) {

        dialogue.rate = AVSpeechUtteranceDefaultSpeechRate;
        dialogue.voice = AVSpeechSynthesisVoice(language: "en-gb") 

        guard speaker.isSpeaking else
        {
            speaker.speak(dialogue)
            return
        }
    }
}

language en-gb speaks with a male voice

Cheers

AVSpeechSynthesisVoice, In speech synthesis, voices are distinguished primarily by language, locale, and quality. Use this class to select a voice appropriate to the language of text to be� You can omit the rate property entirely to have a natural-speed voice, or change the language to "en-US" (English, American accent), "en-IE" (English, Irish accent), "en-AU" (English, Australian accent) or whichever other accents Apple chooses to add in the future.


No you can't change voice AVSpeechSynthesisVoice(language: "en-US") here. Because it is predefine BCP-47 Code used by apple and can't be manipulated. For your reference Does in iOS 7.0 AVSpeechSynthesizer have US male voice?

And it doesn't change in ios8 and ios9

AVSpeechSynthesizer, If an utterance string and voice aren't in the same language, speech synthesis fails. Not all languages are preloaded on the device, and may have� member this.Voice : System.Speech.Synthesis.VoiceInfo Public ReadOnly Property Voice As VoiceInfo Property Value VoiceInfo. Returns information about the current voice of the SpeechSynthesizer object. Examples. The following example initializes an instance of SpeechSynthesizer and gets information about the current voice.


Well, The voice can be set using identifier name directly, like below.

    func speak(say: String) {
        let utterance = AVSpeechUtterance(string: say)
        utterance.voice = AVSpeechSynthesisVoice(identifier: "Karen")
        utterance.rate = 0.4
        utterance.pitchMultiplier = 0.5
        utterance.preUtteranceDelay = 0
        utterance.volume = 1


        synth.speak(utterance)
    }

How to use a specific voice for text-to-speech in iOS, io. A simple online voice changer app to transform your voice and add effects. Voice Changer can make your voice deeper, make your voice sound like a girl/guy, change and distort your voice so it's anonymous, make you voice sound like a robot, darth vader, a monster, and a tonne of other - best of all, Voice Changer is free!


A voice changer can be an app, a software for pc, it can be integrated in a mask (if it is going to be used in a costume, for example) or it works as a toy for children. Voice changers are also considered instruments such as talkbox or vocoder, VST audio effects such as autotune or didgeridoo.


class AVSpeechSynthesizer: NSObject Overview The AVSpeech Synthesizer class produces synthesized speech from text, provides methods for controlling or monitoring the progress of ongoing speech, and route where the speech plays.


You can change the button's title or change its appearance by adding an image in the Attributes Inspector. 4. Import AVFoundation. To use the text to speech API, we'll need access to the AVSpeechSynthesizer class, which is part of the AVFoundation framework.