• Welcome to Battlezone Universe.
 

News:

Welcome to the BZU Archive dated December 24, 2009. Topics and posts are in read-only mode. Those with accounts will be able to login and browse anything the account had access granted to at the time. No changes to permissions will be made to be given access to particular content. If you have any questions, please reach out to squirrelof09/Rapazzini.

Main Menu

Please don't beat me, what would it take for MP3 suport? ok, Ogg in game?

Started by Nielk1, March 10, 2006, 12:43:38 PM

Previous topic - Next topic

Nielk1

I mean if we did that then mods could have music, and the no CD patch could still make music available...
So what's the damage to do this aside from getting some nice mp3 code, break everything in sight?
The part that controls the CD tracks for maps would have to be expanded :roll:.
I know the easiest thing to do would be make MP3 supported shell music, but cant we trick the game into playing that?

As in the subject, PLEAZE don't hurt me! :cry:

Click on the image...

Commando

I don't believe mp3 support will ever be added.  OGG support has been added, you should find some info in the changelog and maybe in my modlog.

BZZERKER


Red Devil

OGG goooood.  MP3 baaaaad.

Battlefield 2 uses OGG too.
What box???

Commando

Yeah, I believe the cost of royalties is one of the reasons mp3 support hasn't and won't be added.  The amount of work needed to add it is most likely another reason.

Nielk1

ogg...

Can we get oggs to play instead of CD music or during a mission, oh no, It's not an ivar is it?

Click on the image...

Red Devil

From the CL:

- Initial support for Ogg (compressed) audio, thanks to the Ogg
Vorbis team (see http://www.vorbis.com/ ). Ogg is a type of compressed
audio, much like mp3 files, but unlike mp3, decompressors are available
with full source code, no restrictions on using it in commercial projects.
BZ2 will treat any audio file ending in ".ogg" as an ogg file. Some notes
on using oggs within the game:

1) At most 4 ogg streams may be active at once. Decompressing ain't
    free.
2) You may not used oggs for any sfx in 3D.
3) There's a 3-second stream buffer per stream. Thus, don't use them
    for anything shorter than 3 second samples.
4) Oggs may be looped (shell background music)
5) Oggs may be stereo. Bitrates at or under GamePrefs.ini::AudioMixRate
    is preferred. I've not really tested insane bitrates.
6) Oggs are always played thru software buffers. Trust me on this one,
    the programming is a LOT harder to do HW buffers.
7) You do not have to change all filenames -- if a .wav file is not
    found, it looks for a .ogg file with otherwise the same name. E.g.
    'shell.backgroundsound mire22_5.wav' will look for mire22_5.wav
    and plays that if found. If not found, it looks for mire22_5.ogg,
    and plays that if found. If neither is found, it'll complain.

   Really, the only thing you should be using oggs for are shell
music
, and really long voiceovers during missions (more than 5-6
seconds). Things like "unit under attack" are best left in .wav
format.  Like jpeg images, oggs are lossy, so you should *NOT* edit
them, resave, or convert from mp3 <-> ogg. Do all your editing on .wav
files, and convert to ogg as the last step. Free programs like
Audacity ( http://audacity.sourceforge.net/ ) can save as ogg, or
there are commandline conversion tools available on the net.  In
Audacity, look under Preferences -> File Formats for the ogg export
quality level, which is the amount of compression applied. FE and
audio-heavy MODs better be smaller now. :) [NM]
What box???

GSH

If you want to listen to your own personal soundtrack during play, then fire off Winamp or the like in the background. Compatible with all BZ2 versions. Zero effort for me. Deal with it.

-- GSH

Nielk1

I do do that, I was just trying to see if music tracs could be added to specific missions, I think there is a way to get a shell wav loop to play, so an ogg should also work :)


Click on the image...

Huscar

I once made a dll script to do that I think... that was back in the days of wav, I think ogg loads a heap load faster.

EDIT: that was a very basic script and such, didn't preload anything and things like that, also didn't have randomness in it, basicvally it just played 5 tracks one ofter the other, it also had a very long time (about 10 secs I think) in which it stopped the game to load a new file.

Nielk1

So if it had reloading that 10 seconds would be at the load screen right? :-D
And as you said oggs are faster, so it might not even need a reload, but I think a little loading Background Music would be nice to add to the bar, I wonder how you do that?

I can do a little in almost every area of BZ2, except mission DLLs, gotta learn that :).



Can't we get a, what is it called, asynchronous? loading for music files.  By what I hope that word means, I am saying: loads without disrupting gameplay.  Being music files, there is no need to make the engine stop and wait like if it was an important voice over.

He, maybe a nice little change to the DLLs will allow us to make a var that is true or false, set through the sound option panel.  Change "Music from CD: On/Off" to "Background Music: OGG/CD/Off".  OGG setting the var true and the CD off, CD setting the opposite, and off leaving both as false or off.

Now I have a reason to learn to make DLLs, I got a nice C++ compiler if I can't do it with the scriptor (shudder), I just would need to learn C++ :lol:.  Can and ivar, or cvar, or whatever it is, cvar is true false I think, be modified In the shell be for a map is even pointed at?  Can  it even be set to have an option to use ogg if the var is present and true, CD if the var is not present.

This has some nice promis don't it?  Time to install the scriptor, pop in the 1.3pb2 dll source, if you can do that?, and add a function.  Who knows, mabey if it works well, we might be talking 1.3 stock option? :roll:


PS: Can you find that code :) ?

Click on the image...