Results 1 to 5 of 5
  1. #1
    Pals is offline Member
    Join Date
    Feb 2010
    Posts
    2
    Rep Power
    0

    Default Playing multiple wave files one after the other

    Hello,

    I am new to java and I am trying to develop a program which can accept a string as an input. Then as per each character entered it should play corresponding wav file one after the other. I just don't understand how can I play audios one after the other.

    Can anyone please help me with some sample code?

    Thank you in advance.

    Pallavi

  2. #2
    FON
    FON is offline Senior Member
    Join Date
    Dec 2009
    Location
    Belgrade, Serbia
    Posts
    366
    Rep Power
    6

    Default

    Few days ago similar post was made, if you use JMF this could help:

    JMF player.setSource

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Do you know how to play a wav file using Java. Try to do that first. Then think about the other functionality. Do you have any design for this?

  4. #4
    Pals is offline Member
    Join Date
    Feb 2010
    Posts
    2
    Rep Power
    0

    Default

    Yes I was able to play audio using java. I could also append one file to another and play but couldn't understand how to play multiple files one after the other. But I guess JMF player.setSource should be useful.

    Thank you so much

    Pallavi

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Okay, now you know how to play a wav file. Then it's matter of feeding all the file names into your functionality, kind of looping. But it's not just a simple for/while loop. You want to wait to finish one play-back to start the other. Simple loop may cause lots of trouble.

    First try this, store all the file names in an array and using for loop feed one by one to your player and see,

    JMF is a good approach.

Similar Threads

  1. Compiling Multiple Files
    By Chasingxsuns in forum New To Java
    Replies: 4
    Last Post: 02-12-2010, 02:22 PM
  2. Project containing multiple source files
    By mr smiley in forum Eclipse
    Replies: 0
    Last Post: 04-25-2009, 11:31 PM
  3. Playing an AudioInputStream multiple times
    By pmgallardo in forum Advanced Java
    Replies: 6
    Last Post: 03-09-2009, 05:29 PM
  4. multiple class files
    By nemesys571 in forum Eclipse
    Replies: 0
    Last Post: 06-26-2008, 02:58 AM
  5. Opeing multiple pdf files in different acrobat reader windows
    By shweta.ahuja in forum Web Frameworks
    Replies: 2
    Last Post: 05-07-2008, 01:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •