not to mention that ogg has 200kbps over the 320kbps limit mp3 does.
The only reason I use mp3 is for music I get off itunes or opensource music.
However, a lot are using flac which does get a bit big.
ogg at full is quite big but still.


At 08:10 PM 1/6/2013, you wrote:
Hi,

Well, that definitely gives me a clearer picture of what your aiming
for. Before I get into the technical details of working with audio in
Java I would like to point out that ogg might be a better choice than
mp3. The reason I say that is I'm not sure if you are aware of this
but mp3 is a copyrighted and proprietary format and if you intend to
use it in a commercial game or similar you have to pay money to use
the mp3 file format. That's one major reason many game developers etc
are moving to ogg which has the same or better quality and is licensed
under an open source license. The other reason I point out ogg is that
many audio libraries are now supporting ogg and moving away from mp3
do to those same licensing issues.

Now, one thing you did not indicate is what OS you are developing this
game for. Windows, Mac, and Linux all have different audio APIs
available to you so I'm going to be shooting in the dark on which API
would be best for your specific needs here so I'll give you a list of
pros and cons for each possibility.

As of Java 1.4.2 and later Java ships with a basic sound API in the
javax package that is well suited for most games. It can not handle
compressed file types such as wma, mp3, or ogg, but for wav files its
a decent enough API for what you want to do. Using the
javax.sound.sampled.Clip class you can load sound clips, pan them,
control gain, change pitch/frequency, and even handle some simple DSP
effects like echo too. Besides shipping with the Java runtime
environment it works out of the box with Windows, Mac, and Linux JRE
implementations so its really the way to go for anyone wishing to
write a cross-platform game using Java. If you need I can probably
whip up some code samples to show you how to initialize the sound
system and load and play a sound clip using the Java Sound API.

Next is Joal which I've mentioned before. Joal is a Java wrapper for
the OpenAL cross-platform library. The principle advantage of Joal is
that you can write applications that have 5.1 and 7.1 surround sound
audio, have 3d virtualization, as well as handle pitch, gain, and so
forth using OpenAL. The downside here is that it looks like overkill
for your application and OpenAL doesn't have a basic 2d pan control.
Its all 3d audio or nothing. :D

Another option is JSDL which is a Java wrapper for the SDL libraries.
I don't know if it is actively being maintained, is up to date, but
one thing JSDL can do for you is help you access SDL Mixer. SDL Mixer
isn't a really advanced audio library but it is usually very simple to
work with. It has basic 2d stereo panning, allows you to change the
volume/gain of files, and supports a number of compressed file types
such as ogg and mp3 as well as wav, aif, and so on.  I've recently
began using SDL Mixer in my own projects and the only disadvantage is
that you can't change the pitch of files on the fly and it doesn't
have many DSP effects. Otherwise its a decent audio library for a 2d
side-scroller etc.

Finally, there is FMOD Ex. This library is a commercial API so it may
cost depending on weather or not you intend to use it commercially.
The advantage here is FMOD has everything you could want including 2d
stereo panning, 3d audio virtualization, ability to change the pitch
and gain of the sounds, handles several audio formats such as mp3,
ogg, wma, wav, aif, and has many built in DSP effects. If you are
developing this game for Windows you can access FMOD via a standard
com wrapper. If you are writing a game for Mac OS or Linux you will
have to write a Java wrapper for FMOD using the Java native interface
or hunt around for an existing wrapper. The only disadvantage to using
FMOD I have ever found is that it is only free for free games. If you
want to use it in a commercial game you will have to pay licensing
fees.

There are a lot of other options here besides those mentioned above
but you'd probably have to dig up documentation for Java or write
custom JNI wrappers for them as I don't know if there are any existing
Java wrappers out there for them. So I decided to give you the most
common options available for you.

Cheers!


On 1/5/13, Felipevr <fvrlis...@gmail.com> wrote:
> Thanks very much.
>
> Well, my real idea is develop a sidescroller audiogame, using three
> tracks. central, left e right (with this arrowkeys) to move and up-key
> to each step.
>
> in this fight game, problably with three or four weapon, maybe use some
> atributs - strength and dexterity for example - to define the results of
> commands.
>
> the sounds will be used to ambience sound, action song e, I want,
> background music.
>
> The itens or npc's can appears in any of this tracks, so, the sound need
> to move right, left or right and closer than the sound is, higher need
> to be.
>
> I need to controll all this sounds simultaneously, off course.
>
> just the background music need to be in mp3 format, the others wav.
>
> any way, I rope that I could show a little of my ideas.
> My Mother Language isn`t English, so if someone was wrong or couldn't be
> understand, just tell me.hehe.
>
> thanks again!
>

---
Gamers mailing list __ Gamers@audyssey.org
If you want to leave the list, send E-mail to gamers-unsubscr...@audyssey.org.
You can make changes or update your subscription via the web, at
http://mail.audyssey.org/mailman/listinfo/gamers_audyssey.org.
All messages are archived and can be searched and read at
http://www.mail-archive.com/gamers@audyssey.org.
If you have any questions or concerns regarding the management of the list,
please send E-mail to gamers-ow...@audyssey.org.



---
Gamers mailing list __ Gamers@audyssey.org
If you want to leave the list, send E-mail to gamers-unsubscr...@audyssey.org.
You can make changes or update your subscription via the web, at
http://mail.audyssey.org/mailman/listinfo/gamers_audyssey.org.
All messages are archived and can be searched and read at
http://www.mail-archive.com/gamers@audyssey.org.
If you have any questions or concerns regarding the management of the list,
please send E-mail to gamers-ow...@audyssey.org.

Reply via email to