How to clone AudioClip object

Discussion in 'Java' started by Mike Mimic, Jan 11, 2004.

  1. Mike Mimic

    Mike Mimic Guest


    How can I clone (copy) AudioClip object. The problem is that I need
    to play the same sound many times in a program (and that can also
    be simultaneously). If I use only one object it does not play it
    simultaneously - as it is written in the documentation:

    Starts playing this audio clip. Each time this method is called, the
    clip is restarted from the beginning.

    But if I create new object every time I play it (and that means read
    file) I get delay.

    And I think it is bad idea to make a queue full of AudioClip objects
    because I do not know how many I will need.

    So how can I make new AudioClip from previous AudioClip?

    Mike Mimic, Jan 11, 2004
    1. Advertisements

  2. ....
    | How can I clone (copy) AudioClip object.

    Don't. Use two instances of the AudioClip object,
    using the same filename, and be done with it.
    Andrew Thompson, Jan 12, 2004
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.