Audio Api

Community Forums/Showcase/Audio Api

Ploppy(Posted 2015) [#1]
Hello all blitz users, I need a hand if anyone can help me out here. I am still in the process of fully converting over the Blitz3d/Plus source to a newly compilable version. It's all done apart from the sound related functions.

You may or may not be aware that blitz relies on fmod for all sound oriented commands/functions. Fmod is included in the original B3D/B+ release as part of the blitz runtime library. However for the recently released B3D/B+ sources, the usage of fmod has now been changed from a static library usage to a dynamic library usage. The functions themselves of course still work like before but you will always will need the fmod.dll to accompany any exe file using a compiler created with this newly released blitz source. I believe that Mark Sibly changed this due to his own licence restrictions with the usage of fmod. His licence allowed only himself (I am speculating here, btw) to include a static library. Mark to my knowledge has not confirmed this but it seems logical.

In any case, what I would like to do is continue to be able to compile all-in-one exe files, with having to add an additional dll for music/sound needs. It is not a necessity of course, but it would be great not having to rely on a dll for such functionalities. Since I do not personally intend to buy an fmod licence or even a bass(great api) licence since I do not have that kind of money, I was wondering if any of you guys are aware of a good sound api out there that is free, has no licence restrictions, is capable of loading streaming mp3/wav/ogg AND is downloadable as either c++ source or as a static lib. This may well be a tall order. Please let me know on this thread if anyone does.

Thanx

additional - oops, I should've put this in the 'general discussion' forum, not showcase (I only just noticed, sorry)....


Iamhere(Posted 2015) [#2]
As far as I know you need for mp3 a license, Audacity did not give a compiled mp3 version, because the license problems with mp3.

I know about OpenAL, Audiere (my favorite bcause it's easy), PortAudio.

Audiere did not have 3D Sound, but it's easy to make a function with pan for it.

SFML did have much other functions too.


GfK(Posted 2015) [#3]
The issue of MP3 licencing is a complete ballache - nobody seems to know what the rules are any more, or who's meant to be enforcing them.

Just forget about MP3 - as a format it sucks anyway. It's the GIF of the audio world.

Use OGG format. You know where you are with that.


videz(Posted 2015) [#4]
I agree with Iamhere. You can use OpenAL as replacement.

Off Topic: I have mentioned this before Ploppy, why not totally replace the new DX commands with your HW DX9/D11 capabilities? If the move of having sound as a static library, why not do the same with Hardwired?

instead of

dxGraphics3d..

just use the standard naming instead since you have made this mod your own :-)

Blitz source has a permissive license so you should take advantage of this freedom. It's not taking away credits of what the authors have done. In fact they are allowing it now by choosing this specific license.

just my honest opinion. thank you


GfK(Posted 2015) [#5]
You can use OpenAL as replacement.
Except you can't, not really. CreativeLabs seem to have washed their hands of it, and development seems to have ceased probably ten years ago.


videz(Posted 2015) [#6]
Yes I have read about that GfK. But still a good replacement if no option exists (per Ploppy's requirement). Torque3D and most current gen engines still uses it as one of it's drivers but not out of the box.

FMOD
OpenAL
DirectSound

http://www.garagegames.com/community/forums/viewthread/136403

Of course there's some work needed to be done in porting to Blitz.


and development seems to have ceased probably ten years ago.


no problem. looks stable enough and it's open source so you can improve it.


What do you suggest?


Derron(Posted 2015) [#7]
rtAudio
http://www.music.mcgill.ca/~gary/rtaudio/

It is more an audio driver which requires you to stream it your audio data. Means you should have something like "pub.mod/ogg.mod" to decode ogg on the fly and send data to the driver for "streamed audio".


All in all it also depends on the licence you want to use for your product ... there are some libs out there ... but I assume "GPL" is not an option for you.


bye
Ron


Ploppy(Posted 2015) [#8]
@videz, about what you were saying about replacing the dx7 commands with my dx9 ones. This has already been done, this is what Hybrid is all about and is part of the Hardwired release package. A Graphics3D command for example will call my dx9 routine using Hybrid.


videz(Posted 2015) [#9]
Ploppy, downloading the latest version I still see "dxGraphics3D" ... as one of the commands.

What I am suggesting is make the DX9/DX11 as the default with "Graphics3D" and other stuff and have the old dx7 stripped out or renamed that way since you are moving forward with the engine.

Just a suggestion though.


Ploppy(Posted 2015) [#10]
I know, videz. Check out the Hybrid folder in the hardwired release. This is a converted b3d source that totally replaces dx7. You don't need hardwired.dll if you use Hybrid as it is already part of the Hybrid runtime functions. The good thing about using Hybrid as opposed to Hardwired is precisely that you don't need any additional dll and a compiled exe should be all-in-one. I have also taken out all the unneeded redundant dx7 stuff of course.

You have essestially two versions of Hardwired in my release, one is the classic userlib and the other is the compiler version, essentially making it a Hybrid child of B3D and Hardwired; hence the name.


videz(Posted 2015) [#11]
Ah thanks! now I see that :D awesome!!


Ploppy(Posted 2015) [#12]
However, Hyrbid for the moment has all sound functions disabled. This is why I'm looking for a reasonable replacement for fmod.


videz(Posted 2015) [#13]
I understand. I don't see it as a problem since you are updating the codebase constantly.

It is still not a big issue to use the required fmod.dll unless you have finally decide to replace with what you think will work for the best.


P.S. I still suggest to go for OpenAL. It's been proven and most new engines uses it such as this one (Castle Engine), it even has a separate how-to page for it :-)

http://castle-engine.sourceforge.net/openal.php


Ploppy(Posted 2015) [#14]
I had a quick glance at openal and yes it looks promising. I will check it out in detail a little later. Thanks for that. Hope it workx


Ploppy(Posted 2015) [#15]
I see that openal is under a lgpl licence. What does this kind of licence entail?


videz(Posted 2015) [#16]
thats great Ploppy.

Just in case, here's a reference link I found on gamedev on how to statically link it:

http://www.gamedev.net/topic/641049-how-to-statically-link-openal-soft-for-vc/#entry5048385

I know you could have taken care of this easily but I'd like to help somehow as a way of saying thanks :-)


Derron(Posted 2015) [#17]
I think you might not be aware of my post above (suggesting "rtAudio").

Concerning "openal" you might read this thread:
Community/posts.php?topic=61781

It is about the LGPL-static-linking-issue (your app should be LGPL then too).


bye
Ron


Ploppy(Posted 2015) [#18]
Thanks Ron. Just what I need info-wize. :-)


videz(Posted 2015) [#19]

It is about the LGPL-static-linking-issue (your app should be LGPL then too).



Not exactly. Yes only the end user's app will be affected, which is there choosing, and also not all user or app code..

Some quote/ reference to StackOverflow about LGPL and that issue:

http://stackoverflow.com/questions/139251/do-i-have-to-make-my-code-lgpl-if-i-use-modified-third-party-lgpl-library


LGPL means, for libraries, you can include them in your projects (as linked libraries) without having to [L]GPL your whole code-base.

The only code you have to open up is direct changes to the library source.




You can keep your code proprietary, but you must release the modifications you made to the LGPL library.



Again, not the codebase of the user's app, just the OpenAL library.


You can also provide a DLL build version if some user likes this kind of setup and completely have nothing to worry with LGPL.


videz(Posted 2015) [#20]
There's a reason why there's GPL and LGPL.. LGPL is less restrictive.

Another good explanation mentioned by this SL forum member:

http://community.secondlife.com/t5/General-Discussions/GPL-vs-LGPL-what-s-the-real-story/m-p/350334#M152860



" LGPL relaxes that insanity, in that if you incorporate someone's LGPL code, they would have no claim to your code. LGPL will not "cause" your code to be open-source, if you choose to protect your code and not release it to the public. It will not violate any licensing agreement.


LGPL usually applies to "library" code only. As such, code library can be considered operating "independent" of your own code. Therefore, the open-source code library can never lay any claims on anybody's code. So if you link someone's public LGPL library, it will not cause your own code to become public, unlike GPL. That is why it is called Lesser GPL. "




I suggest you do some research how LGPL works as it's not restrictive as most people think :-)

So the app or game that the user will be creating with your hardwired version does not need to open his/her source and can keep it proprietary.

cheers.


videz(Posted 2015) [#21]
but then again, IANAL and I would also go for rtAudio or any other very loose licensing libraries out there just to be on the safe side..

and just give it some time to think about what you would like to use at the end :-)


Ploppy(Posted 2015) [#22]
I am presently weighing up and testing pros and cons..