Fix postprocess in Audio (#1667)

This commit is contained in:
Freddy Boulton 2022-06-30 09:46:50 -04:00 committed by GitHub
parent 8c9a9a9696
commit d01da6e205
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -2119,7 +2119,7 @@ class Audio(Changeable, Clearable, Playable, Streamable, IOComponent):
return processing_utils.encode_url_or_file_to_base64(y)
def deserialize(self, x):
file = processing_utils.decode_base64_to_file(x["data"])
file = processing_utils.decode_base64_to_file(x)
return file.name
def stream(

View File

@ -843,7 +843,9 @@ class TestAudio(unittest.TestCase):
},
)
self.assertTrue(
audio_output.deserialize(deepcopy(media_data.BASE64_AUDIO)).endswith(".wav")
audio_output.deserialize(
deepcopy(media_data.BASE64_AUDIO)["data"]
).endswith(".wav")
)
with tempfile.TemporaryDirectory() as tmpdirname:
to_save = audio_output.save_flagged(