FAQ Database Discussion Community


Playing multiple sound clips using Clip objects

java,swing,audio,javasound,clip
I am developing a program that has numerous JButton objects, and I want each one to correspond to its own .wav file. Also, I want the sounds to work in a way such that they can overlap with other buttons' sounds, but it cannot overlap with itself (clicking a button...

Clip a BufferedImage to an Area

java,image,bufferedimage,clip
I'm trying to draw an image within a certain area. Right now I have code that fills an area with a RadialGradientPaint. Area lightArea = ... // fill the polygon with the gradient paint g.setPaint(light.paint); g.fill(lightArea); I would like to draw a BufferedImage in that area instead of drawing a...

CSS Child Hover, Rotate & Clip: Pie Chart Issues

html,css,css3,hover,clip
I have a 3-section pie chart where all 3 sections are virtually identical, yet :hover does not trigger on the first section, and does on the other two. There is an identical number of overlapping parent divs for every element, yet the other two work perfectly fine, so that shouldn't...

Using CLIP command within a Batch File

batch-file,cmd,command-prompt,clip
I am trying to write a batch file to do the following: Copy a given file (drag and drop or through "send to" option) to a predefined network drive Build a file path string Copy the file path to the clipboard Here is what I have so far: @ECHO OFF...

Clip child to parent element with border-radius

css,overflow,css-animations,rounded-corners,clip
How do I force clip a child to a parent element that has rounded corners. <div class="item" > <div class="top"> <h1>Tile</h1> <h2>Click me</h2> </div> <div class="behind"> <h3>Details</h3> </div> </div> When animating the child, its ignores the border-radius of the parent element. Is there a way to fix the two corners...

NullPointer on Clip after Clip was initialized in for loop

java,foreach,nullpointerexception,clip
I have some code here and it's confusing me; I'm trying to figure out why I'm getting a null pointer exception. I set up a for-each-loop to initialize each clip. If I initialize each one by itself, it works just fine, and the clips play. musicArr[0]=menuMusic; soundArr[0]=shotSound; try { for(Clip...

Restarting a Clip object - flush() method

java,flush,javasound,clip,javax.sound.sampled
The Javadoc for DataLine.flush() states Flushes queued data from the line. The flushed data is discarded. In some cases, not all queued data can be discarded. For example, a mixer can flush data from the buffer for a specific input line, but any unplayed data already in the output buffer...