Text to speech

This example shows pipeline for basic text to speech task

Coplete source code for example can be found in programs.audio_processing.text_to_speech.

Imports that will be used

import pathlib
PATH = pathlib.Path(__file__).parent.resolve()

from utca.implementation.tasks import (
    TransformersTextToSpeech
)
from utca.implementation.datasources.audio import (
    AudioWrite
)

Pipeline

pipeline = (
    TransformersTextToSpeech() | AudioWrite()
)

ImageRead is used to open image file.

For image classification used TransformersImageClassification.

For more, see:

Run program

pipeline.run({
    "text_inputs": "Hello world!",
    "path_to_file": f"{PATH}/test.wav"
})

Inputs

  • "text_inputs": Text that will be converted to audio sample.

  • "path_to_file": The path directs to a file where the generated audio will be written.

Results

The result should be written to the desired destination.

Last updated