From 5a69b25c109d2a17b4032677bfa83790c42ae4aa Mon Sep 17 00:00:00 2001 From: Mathieu B Date: Sun, 1 Aug 2021 11:45:26 +0200 Subject: [PATCH] fixed tts audio sample rate and channels --- jarvis/utils/flask_utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/jarvis/utils/flask_utils.py b/jarvis/utils/flask_utils.py index d17fba2..57afd98 100644 --- a/jarvis/utils/flask_utils.py +++ b/jarvis/utils/flask_utils.py @@ -10,8 +10,7 @@ app = Flask(__name__) @app.route("/play_raw_audio", methods=['POST']) def play_raw_audio(): - data = get_data_in_request(request) - play_obj = sa.play_buffer(audio_data=data, num_channels=2, bytes_per_sample=2, sample_rate=44100) + play_obj = sa.play_buffer(audio_data=request.data, num_channels=1, bytes_per_sample=2, sample_rate=16000) play_obj.wait_done() return jsonify("OK")