Answer the question
In order to leave comments, you need to log in
How to write .mp3 to JSON?
Hello.
I write in python using the JSON standard library.
I need to write a .mp3 file to JSON, but the problem is that when I try to call json.dumps()
, and give it such a dict:
I get an error that it is impossible to write bytes.
How do I write .mp3 (i.e. byte value) to JSON?
{"file":b"My audio file in bytes"}
Answer the question
In order to leave comments, you need to log in
First, you don't have to do this.
Secondly: encode in base64 (or analogues), json is a text format and you cannot shove raw data there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question