Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I convert MP3 file to a Base64 encoded string? [closed]

Tags:

base64

audio

I want to convert MP3 file which is less than 10 MB to a Base64 encoded string. I can only find image converters.

Can anybody suggest me an online tool which will do this?

like image 983
vamsi Avatar asked Feb 19 '14 10:02

vamsi


People also ask

How do I get Base64 encoded strings?

In JavaScript there are two functions respectively for decoding and encoding Base64 strings: btoa() : creates a Base64-encoded ASCII string from a "string" of binary data ("btoa" should be read as "binary to ASCII"). atob() : decodes a Base64-encoded string ("atob" should be read as "ASCII to binary").

Can you convert any file to Base64?

Convert Files to Base64Just select your file or drag & drop it below, press the Convert to Base64 button, and you'll get a base64 string. Press a button – get base64. No ads, nonsense, or garbage. The input file can also be an mp3 or mp4.

How do I decode a file with Base64?

To decode a file with contents that are base64 encoded, you simply provide the path of the file with the --decode flag. As with encoding files, the output will be a very long string of the original file. You may want to output stdout directly to a file.


2 Answers

Look for "binary to base64" or "file to base64". For example, this tool.

Then precede raw base64 result with data:audio/mpeg;base64,

like image 75
user Avatar answered Nov 04 '22 00:11

user


Use Notepad++, first select the entire file (CTRL+A)) and then use the Base64 Encode option under the plugins menu:

Main Menu - Plugins - MIME Tools - Base64 Encode

like image 7
ase34 Avatar answered Nov 04 '22 02:11

ase34