Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (612)
Games in Android Showcase (173)
games submitted by our members
Games in WIP (659)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Play mp3 files?  (Read 17976 times)
0 Members and 1 Guest are viewing this topic.
Offline P0jahn

Senior Devvie

Projects: 3

« Posted 2013-11-11 13:34:14 »

I am looking for a library that can play mp3 files. Also, the library must be able to set the position of the sound and as well as handling end events(for looping and starting point).
Offline ClickerMonkey

JGO Coder

Medals: 20

Game Engineer

« Reply #1 - Posted 2013-11-11 13:38:19 »

Look at mp3transform specifically..

Offline Mads

JGO Ninja

Medals: 26
Projects: 3
Exp: 6 years

One for all!

« Reply #2 - Posted 2013-11-11 13:53:22 »

Are you sure you need mp3 specifically? For game development and distribution, it is really not recommendable.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline P0jahn

Senior Devvie

Projects: 3

« Reply #3 - Posted 2013-11-11 14:34:03 »

ClickerMonkey: Thanks, I will check it out soon.

Mads: The problem with wav files is that they are do damn big! For instance, the resources used in my game is about 300 mb. The music files, all wavs, make up to 80% of the files size. Each song is about 40-50 mb. Converting it to a mp3 would shrink the file size down to 3-5mb. Thats a big difference!

So in the end, its all about space and download time. People are lazy/have slow connections and dont want to download a unknown game that is 300+mb. So using mp3 files instead of wav for music is a must for me.
Offline gouessej
« Reply #4 - Posted 2013-11-11 14:38:08 »

I agree with Mads. Why not using ogg instead? You won't have any problem of licensing, no fee to pay, it is more widely supported by Java (look at Jogg, Jorbis and Paul Lamb Sound Library), ogg files are smaller than wav files.

Offline P0jahn

Senior Devvie

Projects: 3

« Reply #5 - Posted 2013-11-11 14:40:15 »

What? Wait! Pay? Do I have to buy some licence for mp3 files? Shocked
Note that my game is 100% free(from abs as well) and open source.

Ogg = piss quality. So its not an option.
Offline jonjava
« Reply #6 - Posted 2013-11-11 14:41:06 »

Ogg isn't bad quality, what are you talking about? :V

Offline Danny02
« Reply #7 - Posted 2013-11-11 15:22:23 »

What? Wait! Pay? Do I have to buy some licence for mp3 files? Shocked

Yes, mp3 is patented(in the US until 2017). In the case that you use the oracle implementation(JavaFX) Oracle will have paid the license fee for you I guess.

Also the quality of ogg is better than the one of mp3, i.e. id-Software uses it for its games. The best codec would be opus atm, but because of its young age you won't find that many Java wrappers/implementations.
Offline gouessej
« Reply #8 - Posted 2013-11-11 21:46:51 »

Ogg = piss quality
This is probably the most silly thing I have read on JGO this year, sorry.

Online Opiop
« Reply #9 - Posted 2013-11-11 21:50:52 »

Ogg is probably the most supported music file type out there for Java. I have no idea where you pulled that ridiculous statement from!

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline P0jahn

Senior Devvie

Projects: 3

« Reply #10 - Posted 2013-11-11 23:09:09 »

The reason I said ogg was bad is because the only times I have tried it was when I had converted a mp3 to an ogg, which is a bad idea. The quality loss is huge.
Most of my music files have been converted to wav from a mp3 file. So they are fake wavs. Converting these fake wavs to ogg will result in quality loss as well. High quality ogg can be archived by converting true wav files into ogg.

I will check javaFXs media player.
Offline wessles

JGO Kernel

Medals: 213
Projects: 4

Enthusiast of amusement. Lover of code.

« Reply #11 - Posted 2013-11-12 00:08:16 »

If you want to use openAL, there is paulsound. I have not used it before, but minecraft uses it, so it seems pretty good!

Online Opiop
« Reply #12 - Posted 2013-11-12 02:01:00 »

Well, there's a simple solution; don't convert your files that much. Its not fair to denounce the Ogg file type after you actively and knowingly sabotaged your experience with it.

Offline P0jahn

Senior Devvie

Projects: 3

« Reply #13 - Posted 2013-11-17 23:24:53 »

I am not converting anything. Most sound files are already in mp3 format.

Is it a bad idea to convert a mp3(lossy) to ogg(lossy)? Are the quality loss in the converting process noticeable? Is it really that significant?
Offline bilznatch

JGO Coder

Medals: 9
Projects: 2
Exp: 4 years

I'm bad, I'm bad, I'm really... really bad T_T

« Reply #14 - Posted 2013-11-18 00:43:00 »

Converting from one lossy format to another is basically like replacing a your ruined tire with a ruined spare tire.

Your quality loss is as bad as going from a lossless to lossy, except it's a lossy to a lossy, which means if you lose say 30% of your quality from lossless -> lossy, then you'd lose another 30% of the lossy, and you'd end up with only 49% initial quality, basically half artifact, half actual sound.

to quote some random guy in a forum that I found on google "When an already lossy audio format such as MP3 is transcoded to another lossy format such as AAC (or even to the same format) then there is an additional level of lossy data compression applied during the conversion. This is called generational loss and it results in further audio quality degradation. The more it's done the worse it gets."

That's basically the best way to explain the problem with lossy to lossy conversion.
Offline P0jahn

Senior Devvie

Projects: 3

« Reply #15 - Posted 2013-11-18 01:15:43 »

I converted a mp3 file to an ogg and the difference between the two files are so small that I am not sure if I am imagining it or not.

Please download and compare:
4.49mb Zip file:
Offline P0jahn

Senior Devvie

Projects: 3

« Reply #16 - Posted 2013-11-22 18:14:58 »

I found an excellent way of "converting" a mp3 to ogg without any  quality loss. You can record sound output with Audacity and export the sound to an ogg.
So I play the mp3 file in winamp or any other player, record the sound, export it to an ogg and done Smiley
Offline jmguillemette
« Reply #17 - Posted 2013-11-22 20:39:03 »

I've been using for my audio file conversion. Its web based, free and has worked great for me so far.


-=Like a post.. give the author a medal!=-
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

Coldstream24 (5 views)
2015-09-03 00:41:28

Andrew_3ds (22 views)
2015-09-01 19:08:10

afikri (15 views)
2015-08-31 09:30:22

afikri (23 views)
2015-08-31 09:30:07

afikri (11 views)
2015-08-31 09:27:24

afikri (15 views)
2015-08-31 09:26:40

Roquen (21 views)
2015-08-29 11:30:54

GamerC4 (33 views)
2015-08-22 20:38:50

GamerC4 (29 views)
2015-08-22 20:37:18

GamerC4 (35 views)
2015-08-22 20:37:01
HotSpot Options
by Roquen
2015-08-29 11:33:11

Rendering resources
by Roquen
2015-08-17 12:42:29

Rendering resources
by Roquen
2015-08-17 09:36:56

Rendering resources
by Roquen
2015-08-13 07:40:51

Networking Resources
by Roquen
2015-08-13 07:40:43

List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!