Endless Paradigm

Full Version: [Application Release] Sounge v1.0
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
ZiNgA BuRgA Wrote:Nice application :P  If you want a suggestion, it's be nice to statically link the libraries in, instead of using DLLs.
You could also make a "compressor" (ie MP3 » PNG) and see if it's possible to store the original file extension in some PNG metadata somewhere.

Anyways good work!

thanks zinga ^___^

This is practically the first app I've made (unless you count hello worlds), so i just made the quick dirty way on the compiling... (also is that i actually don't know how to do what you said :P)
in future versions* ill try to do that, as well as trying to use some cryptography on the exe...

as for the compressor, im working on it... but the problem is that when i rename the file to raw format, it doesn't have the image dimensions (obviously), and im having a hard time embedding that information into the raw image's metadata... yet again, i don't really know how... :P
also the fact that the image dimensions will change depending of the original filesize (obviously as well), but that can also be done with some if's and math operations :P

speaking of that, zinga, do you know how can i retrieve the filesize of a file in c++?? ive been looking around to no avail T_T
Kaiser Wrote:as for the compressor, im working on it... but the problem is that when i rename the file to raw format, it doesn't have the image dimensions (obviously), and im having a hard time embedding that information into the raw image's metadata... yet again, i don't really know how... :P
Read it in as a BMP.  Stick any appropriate image dimension (a 1x? could work, or you could try making some factorizing algorithm).
There's extensive documentation on the BMP format (it's just a header+palette(if necessary)+image data).

Kaiser Wrote:speaking of that, zinga, do you know how can i retrieve the filesize of a file in c++?? ive been looking around to no avail T_T
IDK about a pure C/C++ implementation.  I've seen people use fseek() to the end of the file, then ftell() to get the location (ie the filesize).  I haven't programmed in C/C++ much, so I can't recommend much.
If you don't mind going into the Windows API, there's the GetFileSize function (note, if you do this, you restrict your code to only be compiled for Windows).
Okay, I just tried it - found a bug - it generates 14 junk bytes at the beginning of the file (the end of the file is fine).

Here's your readme.txt file sent through the conversion process.
[Image: clipboard01lv4.jpg]
i still don't get what this app does, does it just convert mp3's into png's so you can listen to images?
amzter Wrote:i still don't get what this app does, does it just convert mp3's into png's so you can listen to images?
it converts files into png format for sharing and such...

right now it only work oneway... as in, grabbing the image and converting it back into the song it used to be...
UPDATE:

I didnt have much time during this week due to final exams and stuff, but since im done with everything, i decided to spend some time with the coding again...

So i did some research to figure out the file size in bytes of the files being used in the application... with positive results ^___^

and also i managed to implement a factorizing algorithm and a dynamic array for finding the final image dimensions...
The factorization is actually a implementation of the "Prime Factorization"
by dynamic array, i refer to an array which will increase in size accordingly to the amount of entries entered

you see, in c++, it is required to you to declare the array size when you declare it, else it'll just be a variable...

one of the issues with that is if you declare an array bigger than the amount of entries, you lose all the memory space you declared for the array and didnt used, while if you declare it smaller than the amount of entries, lets say you declared an array with a size of 15 entries and you actually have 20, you'll lose the last 5 entries, since the array will not have space for it...

so by declaring an array with a variable instead of a fixed number, it gives you the control to change the array size to suit your need and just use the necessary amount of memory space!

so i just managed to do that in like 4 hours I've been working... and compile it into an application which can be found below...

Since i still havent even thinked about the file manager, this application will only take "Song.mp3" files, and this will output 6 things:

The last value in the array (the last space of the array with an actual value inside)
The Total size of the array (the amount of entries)
The Prime factors of the file size (this are the actual values written in the array)
The width of the final image (the first value of the array times all the others except the last value)
The height of the final image (the last value of the array)
The total file size in bytes (the file size of the original image)


So, that willdo explaining all I've done...

This Application *may* have problems running on other OS'es other than windows because i had to use system("Pause") to stop the application from closing as soon as it finished...
please tell me if it works on other OS'es, and if it doesn't and someone knows how to stop it in a way other ppl can use it, please tell me :D



DOWNLOAD HERE:
[attachment=1731]
I'm not sure I got all what you said above, but for dynamically sizing arrays, look for the malloc() function ( C ) or the new keyword (C++).

It also may be more beneficial to use a linked list instead of an array.

What's the array for though?  Is it for storing previously known factors?  IDK, I generally wouldn't be bothered trying to implement something so complex - I'd probably do something like this:

C Code
int getImgHeight(int numBytes)
{
 int i = (int)sqrt(numBytes);
 while(numBytes % i)
  i--;
 return i;
}

The above gets the height of the image, then you can do a division to get the width.  It's not the fastest algorithm (O(√n)), but, even for files a few GB, it should be very fast.

Pages: 1 2 3
Reference URL's