fixed tts audio sample rate and channels

This commit is contained in:
Mathieu B 2021-08-01 11:45:26 +02:00
parent 284353a99a
commit 5a69b25c10

View File

@ -10,8 +10,7 @@ app = Flask(__name__)
@app.route("/play_raw_audio", methods=['POST']) @app.route("/play_raw_audio", methods=['POST'])
def play_raw_audio(): def play_raw_audio():
data = get_data_in_request(request) play_obj = sa.play_buffer(audio_data=request.data, num_channels=1, bytes_per_sample=2, sample_rate=16000)
play_obj = sa.play_buffer(audio_data=data, num_channels=2, bytes_per_sample=2, sample_rate=44100)
play_obj.wait_done() play_obj.wait_done()
return jsonify("OK") return jsonify("OK")