From da3c154560b56a00f33df722b24ac22f5fe96c7a Mon Sep 17 00:00:00 2001 From: Clay Anderson <469582+supersonicclay@users.noreply.github.com> Date: Thu, 4 Feb 2021 22:51:11 -0700 Subject: [PATCH] Use tobytes() instead of tostring() Fixes #418 --- .../googlesamples/assistant/grpc/audio_helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-assistant-sdk/googlesamples/assistant/grpc/audio_helpers.py b/google-assistant-sdk/googlesamples/assistant/grpc/audio_helpers.py index 1a337fa..d41f7bb 100644 --- a/google-assistant-sdk/googlesamples/assistant/grpc/audio_helpers.py +++ b/google-assistant-sdk/googlesamples/assistant/grpc/audio_helpers.py @@ -54,7 +54,7 @@ def normalize_audio_buffer(buf, volume_percentage, sample_width=2): arr = array.array('h', buf) for idx in range(0, len(arr)): arr[idx] = int(arr[idx]*scale) - buf = arr.tostring() + buf = arr.tobytes() return buf