mesolitica / malaya-speech

Speech Toolkit for Malaysian language, https://malaya-speech.readthedocs.io/
https://malaya-speech.readthedocs.io/
MIT License
236 stars 42 forks source link

need to fix speaking #30

Open vqoley opened 1 year ago

vqoley commented 1 year ago

word: isa = bot reading sound "i.s.a" itulah = bot reading sound "skim"

tested using osman

huseinzol05 commented 1 year ago

share code

vqoley commented 1 year ago

sure. below is simple code:

import os
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
import malaya_speech
import numpy as np
import soundfile as sf

def vits(model: str = 'mesolitica/VITS-osman', **kwargs):
    return malaya_speech.tts.vits(model=model)

string1 = 'itulah'

def predict(string):
    osman = vits()
    r_osman = osman.predict(string)
    r_osman.keys()

    # Save the output to a WAV file
    sf.write('sound.wav', r_osman['y'], samplerate=22050)

predict(string1)

just change string1 value with "itulah" and "isa"