Avatar

dohpaz42

dohpaz42@lemmy.world
Joined
18 posts • 1.2K comments

Web Developer by day, and aspiring Swift developer at night.

Direct message

Not entirely true. There are bits in binary files that cannot be rendered correctly by text editors. In fact, if a text editor cannot read a bit, it might omit it or substitute it with a generic placeholder. Instead, what you would do is encode the file into a text format and the transmit it to somebody, who would then decode the text back into its original file format.

This is how email attachments and uploading/downloading files from the web work. Usually that text format is called base64. In email attachments, they go one step further and typically limit the encoded data to fixed length lines called chunks.

But yeah, sending raw binary data as text requires special formatting first. Opening it up in a text editor and copying and pasting is not enough.

permalink
report
parent
reply

This is not unique to just audio files. What you’re seeing is a readable representation of binary (or raw) data. This will happen if you open an image, zip, or other non-text files.

Fun Fact: Microsoft Office’s .docx file is actually a zip file containing mostly plain text files in the XML format (XML is a markup language similar to HTML, and is used for describing data). You could theoretically unarchive a .docx file and modify the texts files by hand, and then rearchive the files back to .docx. Just be sure to back the file up before doing so. 😉

Data essentially are 1’s and 0’s (zeros) that are arranged in such a way that a program can interpret the data to be used by the program.

You’ve already seen the format that audio files get saved in. They are meant for music players, and as long as the codecs (a way to encode and decode data into a specific format for storage and playback) are supported, your music player will have no problem reading the contents of the file. Text editors will do their best to display plain text, and because text has a limited range of characters it can render, a lot of the data of raw files cannot be displayed. This is why if you opened an audio file in a text editor, and edited it, the file would be ruined. Same for images, zips, and exes.

If you want to see your binary data as text, you should use a hex editor. A hex editor will render each bit of data in hexadecimal format (0 through 16, where 11 - 16 are shown as the letters A - F). Hex editors also then attempt to show the raw data as text too, so you get to see the data in a safe way. They also allow you to change the values of the data, but unless you know what you’re doing, you risk damaging the file and making it unreadable by its application.

permalink
report
parent
reply

Whoa whoa whoa. Don’t over promise.

permalink
report
parent
reply

I will keep that in mind going forward. So thank you for the good mood. 😊

permalink
report
parent
reply

Spending money on projects you either won’t ever do, or you won’t start for at least a year, so the materials sit around collecting dust.

Fun fact: I once was going to build this kick-ass workbench/cabinet for my garage. I bought the cabinet-grade plywood and lean backing, as well as the very expensive soft-closing drawer slides. That was probably 5 years ago, I think? I still haven’t opened the UPS package of drawer slides.

permalink
report
parent
reply

But you get to check off one of those items on your long list of todos… if you think about it.

permalink
report
parent
reply

No but he did sit down and have a beer with a guy once.

permalink
report
parent
reply

Eat the rich and you are fed for a day; compost the rich and you’re fed for a lifetime.

permalink
report
reply

I call it vim, because Vee Eye is typically an alias of vim to begin with, and if you’ve ever actually used Vee Eye, you’d throw your computer out the window. 😁

permalink
report
reply