コード例 #1
0
def api_phonemes():
    """Get phonemes and example words for a profile"""
    assert core is not None
    examples_path = core.profile.read_path(
        core.profile.get("text_to_speech.phoneme_examples",
                         "phoneme_examples.txt"))

    # phoneme -> { word, phonemes }
    logger.debug("Loading phoneme examples from %s" % examples_path)
    examples_dict = load_phoneme_examples(examples_path)

    return jsonify(examples_dict)
コード例 #2
0
ファイル: app.py プロジェクト: dony71/rhasspy
def api_phonemes():
    '''Get phonemes and example words for a profile'''
    assert core is not None
    examples_path = core.profile.read_path(
        core.profile.get('text_to_speech.phoneme_examples',
                         'phoneme_examples.txt'))

    # phoneme -> { word, phonemes }
    logger.debug('Loading phoneme examples from %s' % examples_path)
    examples_dict = load_phoneme_examples(examples_path)

    return jsonify(examples_dict)
コード例 #3
0
def api_phonemes():
    """Get phonemes and example words for a profile"""
    assert core is not None
    speech_system = core.profile.get("speech_to_text.system", "pocketsphinx")
    examples_path = Path(
        core.profile.read_path(
            core.profile.get(
                f"speech_to_text.{speech_system}.phoneme_examples",
                "phoneme_examples.txt",
            )))

    # phoneme -> { word, phonemes }
    logger.debug("Loading phoneme examples from %s", examples_path)
    examples_dict = load_phoneme_examples(examples_path)

    return jsonify(examples_dict)