Code Monkey home page Code Monkey logo

Comments (8)

gkbrk avatar gkbrk commented on June 3, 2024

You can't just delete lines from code when you run into errors. That assertion is there for a reason.

How are you running the code? Can you post the commands you use?

from apt-encoder.

AZDevelopsLMAO avatar AZDevelopsLMAO commented on June 3, 2024

I tried 2 different ways, i tried running it through g++ in command prompt, didn't work, even as admin. Antivirus detected it false positive first time though. Just now I tried using cygwin, the c++ compiler that in closed issues used. Still the same error, assertion failed. On cygwin, to compile I used $ gcc apt-encode.cpp -o apt-encode.exe and to encode it I used ./apt-encode ./image1.pgm ./image2.pgm > encode.raw it didn't work and I had the same error before when I used g++.

from apt-encoder.

gkbrk avatar gkbrk commented on June 3, 2024

I doubt the compiler or running as admin would change much. Can you share the PGM files you used, if they are not sensitive content?

from apt-encoder.

AZDevelopsLMAO avatar AZDevelopsLMAO commented on June 3, 2024

Here, image 2 is just a duplicate: nope

from apt-encoder.

gkbrk avatar gkbrk commented on June 3, 2024

This should not be failing on line 78 assert(buf[0] == 'P'); but instead on line 79 assert(buf[1] == '2');.

You need your image to be of the P2 (text) format, but yours is in the P5 format. You can try to save it with Gimp and choose the text option of PGM when you save.

In the end, if you open your image file with Notepad, it should start with P2 rather than P5 or something else.

from apt-encoder.

AZDevelopsLMAO avatar AZDevelopsLMAO commented on June 3, 2024

Well apparently the file name was wrong because I just copied and pasted the commands from a previous issue in cygwin. But in G++ I did type the file name correctly, and it failed on line 79.

from apt-encoder.

AZDevelopsLMAO avatar AZDevelopsLMAO commented on June 3, 2024

Well it certainly worked, but now I have another problem. If I try to decode it in Wxtolmg, the program that someone used to decode in a closed issue. All I get is noise. I tried changing the oversample settings and I changed the importing settings in audacity (I was following the steps in a previous closed issue here) but nothing seems to work.

from apt-encoder.

AZDevelopsLMAO avatar AZDevelopsLMAO commented on June 3, 2024

So basically I had to install sox and move it into the folder I installed it, Create encode.raw (it doesn't matter it detects that it's there), and I had to do some experimenting. The sample rate for both values in the sox command needs to be 12480 like this: sox.exe -t raw -b 8 -e unsigned -c 1 -r 12480 encode.raw -r 12480 apt.wav Then I had to go to Audacity, import it then export it again this time with the sample rate of 11025. And then I import it into wxtolmg. That's quite complicated but it works. Tysm gkbrk.

from apt-encoder.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.