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

iOS
2013-09-30 13:40 (12 years ago)
iOS7の、Text To Speech を使って、iOSに喋らせる
  • ローファイ。
  • 日本語も鳴らせる。
  • 日本語は若干歪んでる。

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];

まだ評価がありません
著者は、アプリケーション開発会社 Cyberneura を運営しています。
開発相談をお待ちしています。

アーカイブ