Post Reply 
[Application Release] Sounge v1.0
Author Message
Kaiser
The Average Lucky Bastard

Posts: 2,512.2567
Threads: 296
Joined: 13th Apr 2007
Reputation: 0.38918
E-Pigs: 43.7138
Offline
Post: #21
RE: [Application Release] Sounge v1.0
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
14/05/2008 05:15 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA
Smart Alternative

Posts: 17,023.4213
Threads: 1,174
Joined: 19th Jan 2007
Reputation: -1.71391
E-Pigs: 446.0333
Offline
Post: #22
RE: [Application Release] Sounge v1.0
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).
14/05/2008 06:11 PM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA
Smart Alternative

Posts: 17,023.4213
Threads: 1,174
Joined: 19th Jan 2007
Reputation: -1.71391
E-Pigs: 446.0333
Offline
Post: #23
RE: [Application Release] Sounge v1.0
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]
15/05/2008 03:11 AM
Visit this user's website Find all posts by this user Quote this message in a reply
amzter
The bird stole my shoe.

Posts: 1,830.3066
Threads: 342
Joined: 3rd May 2007
Reputation: -4.56241
E-Pigs: 54.7074
Offline
Post: #24
RE: [Application Release] Sounge v1.0
i still don't get what this app does, does it just convert mp3's into png's so you can listen to images?

[Image: 494851774.png]
Search:
17/05/2008 01:43 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Kaiser
The Average Lucky Bastard

Posts: 2,512.2567
Threads: 296
Joined: 13th Apr 2007
Reputation: 0.38918
E-Pigs: 43.7138
Offline
Post: #25
RE: [Application Release] Sounge v1.0
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...

COLEGIOOOOOOOOOOOOOOOOOOOOOOO!!!!!!!!!!!!!!!!!!!!!!
FEEL THE POWER   \(m)/ (@_@) \(m)/
Vi Veri Veniversum Vivus Vici
20/05/2008 03:25 PM
Find all posts by this user Quote this message in a reply
Kaiser
The Average Lucky Bastard

Posts: 2,512.2567
Threads: 296
Joined: 13th Apr 2007
Reputation: 0.38918
E-Pigs: 43.7138
Offline
Post: #26
[Application Release] Sounge v1.0 UPDATE
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:

.rar  FileInfo.rar (Size: 7.66 MB / Downloads: 201)

COLEGIOOOOOOOOOOOOOOOOOOOOOOO!!!!!!!!!!!!!!!!!!!!!!
FEEL THE POWER   \(m)/ (@_@) \(m)/
Vi Veri Veniversum Vivus Vici
(This post was last modified: 20/05/2008 04:57 PM by Kaiser.)
20/05/2008 04:57 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA
Smart Alternative

Posts: 17,023.4213
Threads: 1,174
Joined: 19th Jan 2007
Reputation: -1.71391
E-Pigs: 446.0333
Offline
Post: #27
RE: [Application Release] Sounge v1.0
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
1
2
3
4
5
6
7
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.

(This post was last modified: 21/05/2008 06:06 PM by ZiNgA BuRgA.)
21/05/2008 06:05 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

 Quick Theme: