• safesyrup@lemmy.hogru.ch
    link
    fedilink
    arrow-up
    50
    arrow-down
    1
    ·
    edit-2
    4 months ago

    I am assuming it inputs the byte stream of the file to the text parser and only glibberish comes out

  • bleistift2@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    28
    ·
    4 months ago

    The app will find the file incomprehensible and will tell you that the file is corrupted or in a format the app can’t understand.

    An app that works with raw next (Windows’ Editor or notepad++ or any IDE) will try to parse the binary data as text and fail miserably, showing you lots of undecodable-unicode characters.

    Example:

    %.š/BûT¹Ò;lŠ^œ{åúvž’Û X“—دa%“9HúU”¿ú¦¥N̉Čԝ¿†«dd’º•©“ÜÈê*è9$mÕ lfN‹„‘ª$bÿû°@§  gÂqâ`tŒøn<cm-‰ Ljmð3¡|ñ°k§û–ÿîo<©ªxgTZ¯óT†"x¦1Q®ÔÚóI# 3édgþ™>´dʶ̏þB…o™ÜË7bMûö”]«ê|= ®©w„Ïɳ²NdÅh˜Ñ#´¦ïÕ®ºAd`‹®«R²•]‡ÐÏE päX 0PÛnE”Ø΋şçÒñD]îbwNðèB$¤“nnzráiqÖ›XåÄvØÉË\ø\¦P¼¶Xæ‰Â6…”ææ†?äÖåœ:m|?B3C+dW»f†`Ê$Lˆmìóz¯xK>‘)ƒÜÉTÝ ¨@‘Š£Ð:¨õ¹|!„D QC#£öªJ¼×u›³ÕÒ©˜gV"!V«; áäi³EJ…3;zã[±0&ËsÖ_Ë·³‡ ó8MaTô”ÖBïKßïùl4zHJE’N¢ìo™iÒg$½›—U.ºtÉW›SXGÓÐŒ§N¢–L¨YþïZOPNìÌÙŸN ŽŠióyÄ,QÍfÙ¬

      • Rob@lemmy.world
        link
        fedilink
        arrow-up
        11
        ·
        4 months ago

        Imagine you have a book that’s written in Korean. If you gave it to me and asked me to read it out loud, I wouldn’t be able to make sense out of it. If you gave it to a Korean person, however, they could read it perfectly fine.

        The book itself hasn’t changed — just the person reading the book. And that person has a different set of skills (or instructions, if you will).

      • u/lukmly013 💾 (lemmy.sdf.org)@lemmy.sdf.org
        link
        fedilink
        English
        arrow-up
        7
        ·
        edit-2
        4 months ago

        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:
        T2dnUwACAAAAAAAAAAAypxK0AAAAAG4HHqwBE09wdXNIZWFkAQGcAMBdAAAAAABPZ2dTAAAAAAAAAAAAADKnErQBAAAAWb8XtAG5T3B1c1RhZ3MNAAAATGF2ZjU3LjU2LjEwMQYAAAAdAAAAZW5jb2Rlcj1MYXZjNTcuNjQuMTAxIGxpYm9wdXMdAAAAVElUTEU9TmV2ZXIgR29ubmEgR2l2ZSBZb3UgVXASAAAAQVJUSVNUPVJpY2sgQXN0bGV5IAAAAEFMQlVNPVdoZW5ldmVyIFlvdSBOZWVkIFNvbWVib2R5CQAAAFlFQVI9MjAwNw8AAABEQVRFPTIwMDctMDYtMTFPZ2dTAACAuwAAAAAAADKnErQCAAAAKjsEJTIQFA8SERISFBQTEBARDxAUEhoQEw4SEQ8MDxETERESExgSEQ8LDxANCw0MDxAREhEREAiFgrfBwpjwLVZcCVgqmGAImEP/bxA+LnLkHbRYkSA5ZpTmIAiYQFTPtTNZFp3Z6utyQAiYDl7gsRKYWq8Xvkjie5T9oAiXmJQHdPPon60oDHQSImrECJf5qIXFWDf19lZemxKQRGdjCL0cZ2ArYBQwWThfc14JZmLgCL0c9XXa8WkXUeY16P6UCTutLsgIvRdo2sChsZd8GXao22NBdmw3gAiX4+0TwmGf+tNeAQVubRTNUTQIl4wJTHzJ+ahzgb9S4HNgCJdJZieBkXIV3TBQnlDn5AiYQyxiLbwoJOQ1PMkCs994CIXqR2jXreOteWcOEDSQCIXoiq24lEVfa2aWDzIDwAiYOTvHHfOs80gRhiiaRSI/IYjACJfD2Yh5/my3kw97vQarOqJ8CLzRs2OU4wAUOysUIipNg43epqfSv9MrE6AIhemYmtZV3I15XB0EeNSACJhMOrgqmX79NzifpntZnjmHOgiYQvk3LZ5CXUjRES+mCJg/zveP4hk/ChO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YBNJgAiYHXfRKpaUeVGmX1b+E512CJgdVUGsH4L1WqqRY/ulecAImCs3IkXV5qYqoLJjq8eG4AiYNzw2qK/XrPFiv1sAtdYrQAiYEgdj3jIre7Qv5Ndqrf8RoAiYN25s8MaPLLdVmO0h5zCepgiYH26t376eV1Ti3UzByfgIvO3ddkCI3awYTtEA7CD6J7o5mVDACLzIvnerP+iLSBGWpE7/Pp0gCLy+Zam4p4w2TXLcTR2xsGofBwi8qBFWA26uwJf6wAiYPXis+lJaUdx9yEfN5gIIcTyyCJgfF5Ye2gjg4NvkNp3t0TwImBsdrOW46dbAxv815ydACLzyTK6YvBKbmMR4ooXLCL/2ZN5MR8qAdpZPAiC5pz1HwiAIvJTAzDB12AlfQa3RgayuCLx1WURkB9TzegsGTEu8hAi8do94abB6QAEdtF/zBmPFgAi8VWFPLdwVsm3JLUKVsnL+gAg/rSMGtwix5fVYC0chCJdE/GKTaNrGM65nrEAIP57C75inzTAv2pNxQAg/nt4Ng0NicXIVewXjaggGdIPFO1Bz9ONQCD+spQ38pmv0v/z+vJgIP6Q/CbA8S66sdmw6RAg/lxCY1Pz4o40esMI46QiXT2orWwQTzlm1yi1xCJdm5HpuqfXi+2ecMoAIl0BYxASzK8u8/IVytQg/pOSmSHqD1dPmz8Cg

        Is that what you are looking for?

          • dohpaz42@lemmy.world
            link
            fedilink
            English
            arrow-up
            7
            ·
            edit-2
            4 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.

          • BZ 🇨🇦@lemm.ee
            link
            fedilink
            arrow-up
            2
            ·
            4 months ago

            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.worldOP
              link
              fedilink
              arrow-up
              3
              ·
              edit-2
              4 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)

      • bleistift2@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        2
        ·
        edit-2
        4 months ago

        @[email protected] is right. I’ll interpret your question as “can I send this to someone and they will be able to play it” – then the answer is yes. You can take a binary file like mp4, pretend it’s text like I did above, and send it via chat or a lemmy post. The recipient will need to copy that text, enter it in, for instance, notepad++ and save the file on their disk. Renaming the file from the-text.txt to the-text.mp4 should be sufficient for any audio player to pick the file up and play it.

        Edit: doesn’t actually work

        • dohpaz42@lemmy.world
          link
          fedilink
          English
          arrow-up
          2
          ·
          4 months ago

          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.

      • MentalEdge@sopuli.xyz
        link
        fedilink
        arrow-up
        2
        ·
        edit-2
        4 months ago

        What do you even mean by that?

        The text program obviously can’t process and play the audio, it will try to open the file as if it contains text.

        But it’s not like opening the file destroys it. You can still just close the text program, and then open the file using a suitable media program instead.

    • TachyonTele@lemm.ee
      link
      fedilink
      arrow-up
      9
      ·
      edit-2
      4 months ago

      I feel like there’s a very large number of people that are afraid of trying things on their computer just to see what happens. And it correlates pretty closely with the type of person that doesn’t know where anything is on their computer.

      OP is at least asking questions, and that’s a great step towards learning by yourself.

      • u/lukmly013 💾 (lemmy.sdf.org)@lemmy.sdf.org
        link
        fedilink
        English
        arrow-up
        2
        ·
        4 months ago

        Eeh, they’ve got a point though. This is the result of accidentally cating an image in TTY:

        Fixable with a reboot. Shouldn’t cause issues with any normal text editor, but because it shouldn’t doesn’t mean it necessarily won’t.

    • hendrik@palaver.p3x.de
      link
      fedilink
      English
      arrow-up
      1
      arrow-down
      6
      ·
      edit-2
      4 months ago

      Isn’t that also what you say about your dog? Like moments before it’ll bite someone? (…It just wants to play…)

  • Zappotek@feddit.uk
    link
    fedilink
    arrow-up
    15
    ·
    4 months ago

    my afternoon project recommendation is to open a jpg or bmp in audacity, cut the first bit off to save the header then apply random audio effects to the rest. you can create really cool trippy glitch art this way

  • neidu2@feddit.nl
    link
    fedilink
    arrow-up
    14
    ·
    edit-2
    4 months ago

    It’ll “work”. A motivated and forgiving text editor will take the binary data and show it to you in the form of text, but this text will look like someone threw a hand grenade into a unicode cosplay convention.

    Binary to text is possible in theory, but as everyone who has accidentally sent the output of a binary file to the terminal can tell you, it rarely works very well.

    If you really want to “read” the file as text, it’s best to run it through a base64 decoder, so that the output will be limited to characters that are actually readable. The resulting text can then be encoded again and sent to a new file, and you will have a reproducible text string that represents your original file.

  • slazer2au@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    4 months ago

    MS word and whatever Open/libre Office equivalent will likely throw a format error and show the encoded data as question marks inside a diamond.

    Nothing horrible will happen, the MP3 will be fine the word processor will spaz out a bit.

  • rob64@startrek.website
    link
    fedilink
    arrow-up
    4
    ·
    4 months ago

    All files are made up of “text”, or rather, numbers. How each program interprets those numbers differs depending on the kind of work they do. Any program can open any file, but the way it translates those numbers won’t make any sense if the file wasn’t intended to be opened by that kind of program. So, if you opened an MP4, you might see a little bit of metadata that was encoded in a way the text editor can understand, and then you’d get a ton of random symbols, some that are numbers and letters you recognize, but a lot of them would be specialized characters from farther on in the list of characters whatever font is being used might have.

    Think of it this way: take two human languages that use the same writing system, like German and French. Suppose you ask a Frenchman who also speaks English to translate and write down a few specific sentences. You then take those sentences to a German who also speaks English (but not French) and ask her to translate it into English. Obviously she can’t. She might be able to sound out the words, but neither of you will know what it means, and it probably wouldn’t sound right to a French speaker. Or better yet, you can ask her to try and guess what each word means. She’d likely come up with mostly nonsense (minus a few cognates and loanwords). This isn’t an exact analogy, but that’s basically what’s going on.

  • AwkwardLookMonkeyPuppet@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    4 months ago

    It’ll likely crash the editor, but if it doesn’t then you get cool Matrix code. That’s actually how we used to make Matrix backgrounds back in the day, open an image in a text editor, copy the code, transform it to vertical, change it to green, eureka!

    • cheese_greater@lemmy.worldOP
      link
      fedilink
      arrow-up
      3
      arrow-down
      2
      ·
      4 months ago

      But what is all that crap? Is that the literal machine code or something? Like what is it and in the eff does it actually goid-enough approximate its subject content?

      • DisguisedJoker@lemmy.world
        link
        fedilink
        arrow-up
        5
        ·
        4 months ago

        Every file is made up of zeroes and ones, what’s different between the formats is how those zeroes and ones are interpreted. When you open a mp4 in a text editor what you see is the result of the text editor interpreting the data as if it were text. Since the data doesn’t actually represent text, the result is meaningless garbage.

      • JakenVeina@lemm.ee
        link
        fedilink
        English
        arrow-up
        3
        ·
        edit-2
        4 months ago

        All any file is is just numbers. Opening a file in a program is just interpreting those numbers. To over-simplify, in a plain text file, for example, the number 32 means “space character”, and the number 10 means “move down to a new line”. In an audio file, the numbers are going to have meaning related to volume and frequency of sound, at points in time.

      • stoy
        link
        fedilink
        arrow-up
        3
        ·
        4 months ago

        Every single file on a computer is stored as zeros and ones, the difference between opening a file in VLC or in Notepad is how the program decode the data.

        I actually have a very good analogy to explain the issue of decoding data, this happened to me in a shop.

        I am a Swede, I consider myself being bilingual Swedish/English, I live and work in Sweden.

        After work one day I decided that I wanted some Itallian food so I walked by Eatatly in Stockholm.

        As I got to the cashier to pay, I thought I heard her speak Swedish, but as she started talking to me, I only heard gibberish, I could not understand her at all, it took me 2-3 sec to realize that she was speaking English, and when that clicked, I suddenly understood everything.

        It was so weird, it was like my English comprehension was just turned off and needed to restart.

        Now, this is bascially what happens when you try and open a music file in Notepad, only it can’t understand music at all and doesn’t have the option to give up unless it hits a hard limit.

        So it uses what it knows to try and decode thw file, it takes the birnary data and decodes it as a text file, and since the music data does not corespond to proper text standards it will just do it’s best and give you a long document of incomprehensable characters.

        There are some interesting ways to mess with files and different programs to find/do interesting stuff.

        For instance, you can hide a zip file in a JPG file: https://www.howtogeek.com/119365/how-to-hide-zip-files-inside-a-picture-without-any-extra-software/

        This would only really work in hiding small ammounts of data, and will not prevent detection by law enforcement.

        .docx, .xlsx, .pptx and other new office documents are actually zip files, you can open the file in 7zip and examine the file that way.

        This is interesting, but I haven’t found a real use for it.