Jump to content
AggrorJorn

Ogg support

Recommended Posts

Were we able to set the zip pw via Leadwerks function that does that, from Lua? I know it does that in c++ and Leadwerks is the thing that needs to know the zip pw as it's the one that unzips and reads the data in its functions.

 

Currently that's all done "magically" via the le package process.

 

In the C++ main file is where it loads zipped files. Looks like Package::Load(). I don't see any pw being out in there so guessing Josh hides all that. I'm guessing he might be using the same pw for all LE packaged files that is in his library. Not at my pc atm to see if that function has an overload to take a custom pw but wouldn't that require pro version then since you're doing it in the C++ app?

 

That's a good point, if someone figure out what the password is :o , can we change the password and the package process in the Pro version? tongue.png

 

But maybe this is a subject to another thread, we should focus on the ogg support smile.png

Share this post


Link to post

You could make a copy of data.zip, rename it, and delete everything except the sound files.

 

The zip passwords are pretty much impossible to figure out. Each file within the zip even has a different password.

Share this post


Link to post

I found it really hard to make your own zip. In fact I was unable to make my own.

 

If someone has a tutorial of how to do this, it would be great!

 

-------------

 

In other news, am working on implementing Ogg audio files. I've separated the Sound::Reload function that Josh sent into two different code paths for audio importing.

 

I wrote a test script to import two audio files and compare their data to make sure the decompression is working.

 

I've also just compiled libogg and libvorbis to be used into my program.

 

I should have a working version some time tomorrow hopefully.

Share this post


Link to post

So here is what I have at the moment.

 

http://martyj.net/OggSound.zip

 

The sample program is in the OggSound folder.

 

The ogg decoding code basically comes from this link https://svn.xiph.org/trunk/vorbis/examples/decoder_example.c

 

With some slight modification to improve readability a tiny bit and to integrate it with Leadwerks Streams.

 

The sample program requires two static libs. libogg_static.lib and libvorbis_static.lib

 

The way it works is that ogg is the container format and vorbis is the actual compressed audio data format.

 

They can be found at this path relative to that folder. libvorbis-1.3.5\libvorbis-1.3.5\win32\VS2010 and libogg-1.3.2\libogg-1.3.2\win32\VS2010

 

Just open the project in VS2015, fix the include and linking paths. Build and Profit!

 

When I run my demo app for some reason OpenALSound isn't initialized with my example Sound class using ogg file, but it works great for wave.

 

I've compared the output in Sound->data, and it matches an expected decompressed audio file using 16 bit little endian PCM @ 44100hz.

 

So hopefully Josh can figure that out to get it to actually play.

 

If there's anything else I can do to help implement this, let me know.

  • Upvote 7

Share this post


Link to post

Why use an external library when it can be added to the engine itself?

 

That way nobody else has to add their own support for the audio. Also it could work in 3D whereas that library is 2d only.

Share this post


Link to post

Thanks man, that was really easy to add into the sound loader. I have it working right now. I'm sure many people will find that useful.

 

You should add your shirt size and shipping info by editing your profile.

  • Upvote 1

Share this post


Link to post

It will be 4.3, if MartyJ gives me permission to freely use his code.

  • Upvote 7

Share this post


Link to post

It will be 4.3, if MartyJ gives me permission to freely use his code.

It would be so nice to finally have this in! In theory this will be ready for the next tournament but that's up to Josh when 4.3 comes out. Fingers crossed.

Share this post


Link to post

You should add your shirt size and shipping info by editing your profile.

 

I've updated my info in my profile, although you really don't have to send me anything. It was no trouble at all :P. Just happy to have this support.

Share this post


Link to post

So, it took like allmost three years before this gets added by a member, lol?? I remember asking for it, allmost three years ago. Great job, martyj!

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...