예제 #1
0
    print "Language:       ", language
    print

    c = {
        'TTS': {
            'Google': {
                'debug':
                False,
                'preprocessing':
                as_project_path("resources/tts/prep_speechtech_en.cfg"),
                'tempo':
                1.0,
                'language':
                language
            }
        }
    }
    cfg = Config.load_configs(log=False)
    cfg.update(c)

    tts = GoogleTTS(cfg)

    print 'calling TTS'
    wav = tts.synthesize(text)

    print 'saving the TTS audio in ./tmp/google_tts.wav'
    audio.save_wav(cfg, './tmp/google_tts.wav', wav)

    print 'playing audio'
    audio.play(cfg, wav)
예제 #2
0
    print

    text = 'Hello. Thank you for calling. '
    voice = 'kal'

    print "Synthesize text:", text
    print "Voice:          ", voice
    print

    c = {
        'TTS': {
            'Flite': {
                'debug': False,
                'voice': 'kal'
            }
        }
    }
    cfg = Config.load_configs(log=False)
    cfg.update(c)

    tts = FliteTTS(cfg)

    print 'calling TTS'
    wav = tts.synthesize(text)

    print 'saving the TTS audio in ./tmp/flite_tts.wav'
    audio.save_wav(cfg, './tmp/flite_tts.wav', wav)

    print 'playing audio'
    audio.play(cfg, wav)