iOS7の、Text To Speech を使って、iOSに喋らせる

投稿者: ytyng 10年, 6ヶ月 前
  • ローファイ。
  • 日本語も鳴らせる。
  • 日本語は若干歪んでる。

AVFoundationフレームワークが必要

#import <AVFoundation/AVFoundation.h>

AVSpeechUtterance *utterance = [AVSpeechUtterance
                              speechUtteranceWithString:@"The quick brown fox"];
// 言語、省略時はiOS設定に従う
utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"en-US"];
utterance.rate = 0.2;
utterance.volume = 0.8;

AVSpeechSynthesizer *synth = [[AVSpeechSynthesizer alloc] init];
[synth speakUtterance:utterance];
現在未評価

コメント

アーカイブ

2024
2023
2022
2021
2020
2019
2018
2017
2016
2015
2014
2013
2012
2011