this post was submitted on 20 Jul 2024
55 points (91.0% liked)

Ask Lemmy

26271 readers
1529 users here now

A Fediverse community for open-ended, thought provoking questions


Rules: (interactive)


1) Be nice and; have funDoxxing, trolling, sealioning, racism, and toxicity are not welcomed in AskLemmy. Remember what your mother said: if you can't say something nice, don't say anything at all. In addition, the site-wide Lemmy.world terms of service also apply here. Please familiarize yourself with them


2) All posts must end with a '?'This is sort of like Jeopardy. Please phrase all post titles in the form of a proper question ending with ?


3) No spamPlease do not flood the community with nonsense. Actual suspected spammers will be banned on site. No astroturfing.


4) NSFW is okay, within reasonJust remember to tag posts with either a content warning or a [NSFW] tag. Overtly sexual posts are not allowed, please direct them to either !asklemmyafterdark@lemmy.world or !asklemmynsfw@lemmynsfw.com. NSFW comments should be restricted to posts tagged [NSFW].


5) This is not a support community.
It is not a place for 'how do I?', type questions. If you have any questions regarding the site itself or would like to report a community, please direct them to Lemmy.world Support or email info@lemmy.world. For other questions check our partnered communities list, or use the search function.


Reminder: The terms of service apply here too.

Partnered Communities:

Tech Support

No Stupid Questions

You Should Know

Reddit

Jokes

Ask Ouija


Logo design credit goes to: tubbadu


founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] user224@lemmy.sdf.org 7 points 2 months ago* (last edited 2 months ago) (1 children)

I feel like you want to but binary data into text. You may be interested in base64, or base32 for easier human processing.

Example of short low bitrate Opus audio in base64:
T2dnUwACAAAAAAAAAAAypxK0AAAAAG4HHqwBE09wdXNIZWFkAQGcAMBdAAAAAABPZ2dTAAAAAAAAAAAAADKnErQBAAAAWb8XtAG5T3B1c1RhZ3MNAAAATGF2ZjU3LjU2LjEwMQYAAAAdAAAAZW5jb2Rlcj1MYXZjNTcuNjQuMTAxIGxpYm9wdXMdAAAAVElUTEU9TmV2ZXIgR29ubmEgR2l2ZSBZb3UgVXASAAAAQVJUSVNUPVJpY2sgQXN0bGV5IAAAAEFMQlVNPVdoZW5ldmVyIFlvdSBOZWVkIFNvbWVib2R5CQAAAFlFQ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BmPFgAi8VWFPLdwVsm3JLUKVsnL+gAg/rSMGtwix5fVYC0chCJdE/GKTaNrGM65nrEAIP57C75inzTAv2pNxQAg/nt4Ng0NicXIVewXjaggGdIPFO1Bz9ONQCD+spQ38pmv0v/z+vJgIP6Q/CbA8S66sdmw6RAg/lxCY1Pz4o40esMI46QiXT2orWwQTzlm1yi1xCJdm5HpuqfXi+2ecMoAIl0BYxASzK8u8/IVytQg/pOSmSHqD1dPmz8Cg

Is that what you are looking for?

[–] cheese_greater@lemmy.world 6 points 2 months ago (3 children)

Ya, I'm just amazed at how audio is able to be digitally represented

[–] dohpaz42@lemmy.world 7 points 2 months ago* (last edited 2 months ago)

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.

For the second time in a few days I'm compelled to recommend a series on digital audio and CDs done by Alec on his youtube channel Technology Connections. He explains quite well how digital audio works.

[–] bzarb8ni@lemm.ee 2 points 2 months ago (1 children)

You've hit on half the magic!

You're talking about how the information is encoded, and the other side is how it can be decoded and turned back into analog sounds.

There's quite a bit at play here, but it's pretty well documented out in the world. You might want to read about audio encoding, or codecs

[–] cheese_greater@lemmy.world 3 points 2 months ago* (last edited 2 months ago)

Its just so incredible to me that plaintext can actually represent a real piece of sound to be rendered and that can be rendered exactly the same by any device (speaker quality/processing power aside)