plt.plot(range(15), times[3], 'y', label='MFGLA')
    plt.plot(range(15), times[4], 'm', label='ADMM')
    plt.legend(loc='upper left')
    plt.show()


def grafic_vocoder():

    time_list = list()
    index_list = list()
    for i in range(5, 100):
        t = time.time()
        data = synthesizer.tts(
            'this is a test and you should not be worried about the results',
            i)
        time_list.append(time.time() - t)
        index_list.append(i)

    plt.plot(index_list, time_list, '-bo')
    plt.xlabel('Numar iteratii Griffin-Lim')
    plt.ylabel('Timp')
    plt.show()


if __name__ == '__main__':

    #griffin_lim_timer()
    #global_timer()
    data = synthesizer.tts(
        'this is a test and you should not be worried about the results')
Exemple #2
0
from flask import Flask, Response, request, render_template, send_file

parser = argparse.ArgumentParser()
parser.add_argument(
    '-c', '--config_path', type=str, help='path to config file for training')
args = parser.parse_args()

config = load_config(args.config_path)
app = Flask(__name__)
synthesizer = Synthesizer()
synthesizer.load_model(config.model_path, config.model_name,
                       config.model_config, config.use_cuda)


@app.route('/')
def index():
    return render_template('index.html')


@app.route('/api/tts', methods=['GET'])
def tts():
    text = request.args.get('text')
	text.encode("utf-8-sig")
    print(" > Model input: {}".format(text))
    data = synthesizer.tts(text)
    return send_file(data, mimetype='audio/wav')


if __name__ == '__main__':
    app.run(debug=True, host='0.0.0.0', port=config.port)