mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-18 10:44:33 +08:00
Fix postprocess in Audio (#1667)
This commit is contained in:
parent
8c9a9a9696
commit
d01da6e205
@ -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(
|
||||
|
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user