Serious-Engine icon indicating copy to clipboard operation
Serious-Engine copied to clipboard

First encounter music (MP3 support)

Open DanielGibson opened this issue 9 years ago • 17 comments
trafficstars

TFE uses MP3 for music, unlike TSE which uses .ogg and is happy to use libogg and libvorbis.

It only works if an appropriate libamp11lib.so is available. For 32bit Linux the one from icculus' original Linuxport work, for 64bit Linux not, obviously (and neither for other platforms like OSX or FreeBSD).

I just found the original source on archive.org: https://web.archive.org/web/20060203121222/http://marvin.cc.fer.hr/~elf/amp11lib/

I created a github repo with the source: https://github.com/DanielGibson/amp11lib

I haven't tried to build the source yet and I have no idea if it's 64bit-clean, but at least it's not lost anymore :-)

DanielGibson avatar Apr 20 '16 19:04 DanielGibson

You know the audio files in the gro's from steam have ogg and not mp3 for TFE?

EDIT But they do have .wav files for sound.

ericwomer avatar Apr 20 '16 20:04 ericwomer

no I don't, I have the CD version

DanielGibson avatar Apr 20 '16 20:04 DanielGibson

Why not put amp11lib under External/ in SeriousSam and have a option(... to build it or not depending on weather or not the user is using the CD version or Steam version.

ericwomer avatar Apr 21 '16 00:04 ericwomer

A very, very hacky port of the libamp source to modern FreeBSD and maybe Linux can be found here: https://github.com/Yamagi/amp11lib/tree/cleanup Yes, it's dirty and should be done right. And yes, it may eat your dog. ;)

Yamagi avatar Apr 21 '16 13:04 Yamagi

And Daniel just merged it into his branch.

Yamagi avatar Apr 21 '16 13:04 Yamagi

after very minor fixes it works on Linux, too (tested 64bit). just build it and copy the resulting libamp11lib.so into your serious-sam-tfe/Bin/ dir, ssam-tfe then should be able to find and use it to play the mp3 music

DanielGibson avatar Apr 21 '16 13:04 DanielGibson

CC @SLAwww, just making sure having the source to amp11lib in revision control doesn't cause problems for Croteam (I assume it was MP3 patent concerns that had it removed before...?)

--ryan.

icculus avatar Apr 21 '16 16:04 icculus

IANAL, but afaik distributing source code that violates mpeg patents is fine (that's what the x264 project does). With binaries it might be different, but there might be a difference between libs and programs there, as libs alone can't do anything? Absolutely unsure about that detail, though.

Even Debian (which is pretty anal about licenses) has been distributing mp3 decoders (as binary) since forever, and even encoders (lame, even in the "main" section, not only "non-free" or contrib) for several years, so I think it's safe :-)

DanielGibson avatar Apr 21 '16 16:04 DanielGibson

Amp11lib was removed from commercial game version long time ago. Since the engine is open-source now, I suppose you are free to use any code under GPL. And if it was already done as @DanielGibson said, then why not?

SLAwww avatar Apr 21 '16 20:04 SLAwww

ok, it's cool with me then, too.

icculus avatar Apr 21 '16 20:04 icculus

Cool, thanks! :-)

(I still have the original Serious Sam cardbord box.. the big US version :-) So I like having MP3 support so I can continue to use the game data from that came with it)

DanielGibson avatar Apr 21 '16 20:04 DanielGibson

@SLAwww could you possibly make a patch to supply them with the .ogg/vorbis files instead of using the mp3 files?

ericwomer avatar Apr 21 '16 22:04 ericwomer

And yeah I forgot about licensing issues having a third party lib in this repo, even if they were the ones to create it.

ericwomer avatar Apr 21 '16 22:04 ericwomer

even if they were the ones to create it.

Strictly speaking, I think Alen wrote it externally and it was convenient to grab when Serious Engine needed it.

amp11lib is LGPL'd, it should be okay to include here. We are always going to build it as a shared library that the engine wants to dlopen() anyhow, so I don't think there's a licensing concern.

icculus avatar Apr 22 '16 04:04 icculus

Where can I find the sources of this lib? I only find this link: http://marvin.cc.fer.hr/~elf/amp11lib/ but I cannot access it (site must be down now, or something similar).

ptitSeb avatar Apr 23 '16 20:04 ptitSeb

here: https://github.com/DanielGibson/amp11lib

DanielGibson avatar Apr 23 '16 21:04 DanielGibson

Ah, thanks!

ptitSeb avatar Apr 24 '16 06:04 ptitSeb