From 43966ec573494fe08a43955f06bbd25f09f5b5c7 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Fri, 23 Jun 2023 00:21:59 +0800 Subject: [PATCH] sync pyglet update --- libs/pyglet/media/codecs/base.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/libs/pyglet/media/codecs/base.py b/libs/pyglet/media/codecs/base.py index d65b23a..652a8a8 100644 --- a/libs/pyglet/media/codecs/base.py +++ b/libs/pyglet/media/codecs/base.py @@ -135,17 +135,6 @@ class AudioData: self.duration -= num_bytes / audio_format.bytes_per_second self.timestamp += num_bytes / audio_format.bytes_per_second - def get_string_data(self): - """Return data as a bytestring. - - Returns: - bytes: Data as a (byte)string. - """ - if self.data is None: - return b'' - - return memoryview(self.data).tobytes()[:self.length] - class SourceInfo: """Source metadata information. @@ -409,7 +398,7 @@ class StaticSource(Source): audio_data = source.get_audio_data(buffer_size) if not audio_data: break - data.write(audio_data.get_string_data()) + data.write(audio_data.data) self._data = data.getvalue() self._duration = len(self._data) / self.audio_format.bytes_per_second