Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (533)
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 13026 times)
0 Members and 1 Guest are viewing this topic.
Offline P0jahn

Senior Member


Projects: 3



« Posted 2013-11-11 14: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 14:38:19 »

http://stackoverflow.com/questions/6045384/playing-mp3-and-wav-in-java

Look at mp3transform specifically..

Offline Mads

JGO Ninja


Medals: 26
Projects: 3
Exp: 6 years


One for all!


« Reply #2 - Posted 2013-11-11 14: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 Member


Projects: 3



« Reply #3 - Posted 2013-11-11 15: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.
Online gouessej
« Reply #4 - Posted 2013-11-11 15: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 Member


Projects: 3



« Reply #5 - Posted 2013-11-11 15: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 15:41:06 »

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

Offline Danny02
« Reply #7 - Posted 2013-11-11 16: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.
Online gouessej
« Reply #8 - Posted 2013-11-11 22:46:51 »

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

Offline opiop65

JGO Kernel


Medals: 153
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #9 - Posted 2013-11-11 22: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 Member


Projects: 3



« Reply #10 - Posted 2013-11-12 00: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 Wizard


Medals: 65
Projects: 4
Exp: 3 years


Radirius Software Developer


« Reply #11 - Posted 2013-11-12 01: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!

Offline opiop65

JGO Kernel


Medals: 153
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #12 - Posted 2013-11-12 03: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 Member


Projects: 3



« Reply #13 - Posted 2013-11-18 00: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

Senior Member


Medals: 8
Projects: 2
Exp: 1 year


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


« Reply #14 - Posted 2013-11-18 01: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 Member


Projects: 3



« Reply #15 - Posted 2013-11-18 02: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:
http://www.mediafire.com/download/a425mqyiqkxa3e7/Music+Test.zip
Offline P0jahn

Senior Member


Projects: 3



« Reply #16 - Posted 2013-11-22 19: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 21:39:03 »

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

j.

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

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

pw (24 views)
2014-07-24 01:59:36

Riven (24 views)
2014-07-23 21:16:32

Riven (18 views)
2014-07-23 21:07:15

Riven (21 views)
2014-07-23 20:56:16

ctomni231 (50 views)
2014-07-18 06:55:21

Zero Volt (45 views)
2014-07-17 23:47:54

danieldean (36 views)
2014-07-17 23:41:23

MustardPeter (39 views)
2014-07-16 23:30:00

Cero (54 views)
2014-07-16 00:42:17

Riven (55 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org 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‑gaming.org
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!