Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1037657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:52:40+00:00 2026-05-16T14:52:40+00:00

I want to smoothly transition between two audio clips that are loaded into an

  • 0

I want to smoothly transition between two audio clips that are loaded into an array of javax.sound.sampled.Clips in my Java applet. At the moment I stop one clip and start the next but this produces audible clicking noises due to the audio stopping and starting abruptly. I need to use the Clip interface so that I can do looping and transition between clips keeping the same track position.

I have tried turning the gain down before stopping one clip and then ramping the gain back up when I start the next using the FloatControl.Type.MASTER_GAIN. This requires flushing the buffer if I want to change the gain quickly and even then I get clicking and stuttering if I try to change the gain too quickly. Plus flushing the buffer requires that I stop and restart the clip to get back the buffer that was flushed (so I don’t jump forward over the flushed portion) and this introduces the same clicking that I am trying to get rid of.

Does anyone have experience changing gain quickly (within 200ms), say from 0dB to -60dB. I’m thinking I may have to get down to the buffer level and start manipulating the bits directly but I don’t know how to get to this from the Clip interface.

Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T14:52:40+00:00Added an answer on May 16, 2026 at 2:52 pm

    Found an awesome extension to the Clip class that lets you create a single Clip object with multiple streams and then use custom transitions, such as fade in and out, to switch between streams. This gets rid of the annoying clicking!

    I found it on the HydrogenAudio forums, written by an awesome guy who goes by the handle googlebot. It’s open source under the GNU licence.

    Here’s a link to the forum posts describing the program the class was created for:
    hydrogenaudio.org/forums/index.php?showtopic=80673 (spam bot says I can only post one link :P)

    Here’s a link to the Google code page where you can grab the Java class files:
    http://code.google.com/p/advancedabx/source/browse/#hg/AdvancedABX/src/de/uebber/sound/lib

    If you end up using these classes you might find some array bounding errors in the open and addstream functions in the SwitchableArrayClip.java class.

    You will need to change:

    // Fill it
        int numRead = 0;
        int offset = 0;
        while (numRead != -1) {
            numRead = stream.read(audioData[0], offset - numRead, len - numRead);
        }
    

    to:

    // Fill it
        int numRead = 0;
        int offset = 0;
        while (numRead != -1) {
            numRead = stream.read(audioData[0], offset, len - offset);
            offset += numRead;
        }
    

    There are some other issues, such as using setFramePosition, due to the fact that the player is threaded. But I will let you figure those out or you can ask here and I will show you what I did to fix them.

    Hope this helps someone!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UIWebView that is sandwiched in between a UINavigationController (top) and a
I have a space ship that I want to turn to a destination angle.
Say, I want to write a desktop application that will heavily use SVG. What
I have an ImageView which I want to smoothly zoom on double tap. Currently
I want to insert images into my SDCard.So I used below code m_cImagePath =
I want to create a small delay so that my 1st set of codes
Assume you want to add some methods to all Iterables. That can look like
What method should I use to smoothly move my sprite that responds to a
I have a bit gantt chart that i want to be visible on an
I want to to scroll up and down a page with javascript smoothly. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.