123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|687|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Off Topic -> Making Universal Tools

Sat, 02 Feb 2019, 05:20
spinal
what is a good free language to crate a simple tool to convert/create a file on as many platforms as possible? All I want is to convert a binary file to a c array while adding a few bytes here and there...

-=-=-
Check out my excellent homepage!
Sat, 02 Feb 2019, 05:20
Jayenkai
Javascript...

Over the past few months, I've come to the conclusion that if I want a "Runs on as many systems as possible" option, and I can figure out how to do it, then having it in Javascript is probably the best option. Mostly because browsers are damn near universal. This is why Foldapuz and my recent Sprite Generator exist as they do, in the browser, where things tend to "mostly" work!

The hardest part would be reading in the binary file. Unless you have a server to upload it to, it can be tricky.
Not impossible, mind, just tricky!!

-=-=-
''Load, Next List!''
Sat, 02 Feb 2019, 05:28
Jayenkai
My recent remake of my Pixelart2STL converter features all-in-the-browser functionality.
Pixelart2STL

If you ViewSource, you can see all the nasty innards, you should (maybe!) be able to figure out how I read the data from a PNG file.
I'm not sure if that's doable with binary data, but .. if it IS, then you should (*!) be able to find a way to get Javascript to do what it is you'd like doing with the binary file.

-=-=-
''Load, Next List!''
Sat, 02 Feb 2019, 06:23
spinal
Thats an interesting idea... I'll look into it

-=-=-
Check out my excellent homepage!
Sat, 02 Feb 2019, 06:41

 
Jayenkai
Created : 02 February 2019
Edited : 02 February 2019
System : Cross Platform
Language : Javascript

Javascript-based Binary File Conversion Template

Convert a file using the browser

This is a simple enough template, which should be more or less easy to understand. The hardest part will be creating the conversion itself!

But the basic idea is to take a file, and allow the javascript to convert it, before spitting it back out with the big convertor button.


 
Sat, 02 Feb 2019, 07:07
spinal
First of all, wow. All the info I have found so far, is people saying that for security reasons, javascript simply isn't allowed to manipulate offline files...

This is an excellent jumping off point Your name will surely go in the credits.

-=-=-
Check out my excellent homepage!
Sat, 02 Feb 2019, 07:54
Jayenkai
JavaScript dev tips.
F12 brings up the console. (Debuglog!)
To output to the console, use "console.log("text goes here");"
I typically add a \n to console output, as sometimes it doesn't do that!!!

-=-=-
''Load, Next List!''
Sat, 02 Feb 2019, 10:46
spinal
Here's a start, removed the output file for now, stuck in a txt box. I think it should do the job just right!




-=-=-
Check out my excellent homepage!
Sun, 03 Feb 2019, 09:41
spinal
Finished (enough for now) converter...

Will take an 8bit mono wav as input and turn it into an array that includes the samplerate and size.



Good enough for my current needs. Placed here because I will no doubt loose it in the future.
I would never in a million years have thought to do this in HTML + Javascript, thanks Jay.

-=-=-
Check out my excellent homepage!
Sun, 03 Feb 2019, 10:48
Jayenkai
Now go the whole hog, and convert other formats of wav!!

Glad my template was handy.

-=-=-
''Load, Next List!''