Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: Playing Songs in Java

  1. #1
    Junior Member
    Join Date
    May 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Playing Songs in Java

    Hey everybody I'm new here and am looking for a package / addon / relatively simple way to play songs within my program. Nothing too fancy, simple yet effective. I tried the JMF (Java Media Framework) but it's pretty dated hah, is there a more up to date utility I can use to play audio, particularly one with GUI controls?


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Playing Songs in Java

    Have you tried the sound API? Been a while since I've used it but recall it being fairly straightforward to play sound.
    Overview of the Sampled Package (The Java™ Tutorials > Sound)

  3. The Following User Says Thank You to copeg For This Useful Post:

    javapenguin (May 20th, 2011)

  4. #3
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Playing Songs in Java

    I threw together an applet that plays a song, you can view it and its source here: Little Bird, Fly Away
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  5. The Following User Says Thank You to KevinWorkman For This Useful Post:

    javapenguin (May 20th, 2011)

  6. #4
    Junior Member
    Join Date
    May 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Playing Songs in Java

    copeg / Kevin, thanks for those examples. What I'm really looking for is something where I could implement play / pause buttons, a time position slider and other components a standard media player would feature. Does the sound API offer these features, or would they be relatively easy to implement myself? I'm really just getting into this want to write a basic media player.
    Last edited by obogobo; May 25th, 2011 at 10:27 PM.

  7. #5
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Playing Songs in Java

    Quote Originally Posted by obogobo View Post
    copeg / Kevin, thanks for those examples. What I'm really looking for is something where I could implement play / pause buttons, a time position slider and other components a standard media player would feature. Does the sound API offer these features, or would they be relatively easy to implement myself? I'm really just getting into this want to write a basic media player.
    I'm not sure, what have you tried? I know the program I posted supports playing/pausing.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  8. #6
    Junior Member
    Join Date
    May 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Playing Songs in Java

    To be honest I haven't tried much yet, just the JMF. I'll post my results with the Sound API soon (I hope) though

Similar Threads

  1. Off Topic: Happy Songs?
    By KevinWorkman in forum The Cafe
    Replies: 5
    Last Post: March 3rd, 2011, 09:46 PM
  2. Java error while Playing Video file.
    By ravigirismiles in forum What's Wrong With My Code?
    Replies: 1
    Last Post: September 7th, 2010, 11:09 AM
  3. Playing .wav file
    By harsha in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 27th, 2010, 11:33 PM
  4. playing sound using java
    By sdhilipan89 in forum Java Applets
    Replies: 6
    Last Post: March 25th, 2010, 08:59 AM

Tags for this Thread