Why I cannot open a BigClip?

Hi to everyone,
I've got a problem on using the BigClip class. Before I used it I've been working with the usual Clip class. Here's part of the code. After the debugging process I found out that the problem is when I have to get the line for the BigClip:
public BigClip sound=null;
         boolean opened=false;
       Track(String url,AudioFormat af,AudioInputStream is, String key) throws      LineUnavailableException
            info=new DataLine.Info(BigClip.class, is.getFormat(),((int)     (is.getFrameLength()*af.getFrameSize())));
            TrackLocation=url;
            try
                    sound =(BigClip) AudioSystem.getLine(info);//HERE I GET THE PROBLEM
                           sound.open(is);
                           opened=true;
                }So is that usage correct?
Thanks in advance.
Maurizio Di Vitto

mauriziodvt wrote:
I've tried to write a SSCCE code but i am not sure if i've done it right. .. That is a pretty good SSCCE. But not 'ideal'.
- A change that would make it even more suited to being an example is to either hot-link to a sound file available on the net, or generate one in the code. Given the size of sound files (e.g. 40Kb - several megabytes), I would recommend generating one.
For general readability, it is better to use the common forms of upper case. That means the class name should be Test rather than test. But since I put all these kinds of code in the same directory of my development box - I personally would prefer you give the class a more specific name like TestBigClip.
The other thing you should change in your test code is the Exception handling, you throw away valuable information if you do not print the stack trace. As it happens, the original problem was a NullPointerException because the code attempted to use a BigClip before it had been instantiated.
Try this code instead.
import javax.sound.sampled.*;
import java.io.*;
import org.pscode.xui.sound.bigclip.BigClip;//reference to the BigClip class
public class TestBigClip {
     public static void main(String[] args){
          BigClip sound=null;
              try{
               URL url = new URL("http://pscode.org/media/leftright.wav");
               AudioInputStream ais=AudioSystem.getAudioInputStream(url);
               AudioFormat af=ais.getFormat();
               try               
                    sound = new BigClip();
                    sound.open(ais);
                    sound.loop(1);
                    JOptionPane.showMessageDialog(null, "Close to continue..");
               catch(Exception e)
                    e.printStackTrace();
          catch(Exception e)
               e.printStackTrace();
}Note that I 'hacked' together this example, you might find missing imports etc.

Similar Messages

  • Why I cannot open camera raw files from camera Nikon 3200 through Adobe Bridge and/or Photoshop?

    Why I cannot open raw files (NEF) from camera Nikon D3200 through Adobe Bridge and/or Photoshop ?

    Thanks for the tip. It worked out perfectly.
    De: ssprengel [email protected]
    Enviada em: terça-feira, 14 de janeiro de 2014 19:14
    Para: Aecio Paes Leme
    Assunto: Why I cannot open camera raw files from camera Nikon 3200 through Adobe Bridge and/or Photoshop?
    Re: Why I cannot open camera raw files from camera Nikon 3200 through Adobe Bridge and/or Photoshop?
    created by ssprengel <http://forums.adobe.com/people/ssprengel>  in Adobe Camera Raw - View the full discussion <http://forums.adobe.com/message/6012775#6012775

  • Why i cannot open a PDF file even with abobe 9

    why i cannot open a PDF file even with abobe 9

    Please supply screen shot when it is asking for updates. (Do not send as email, use CAMERA icon). This is important, there are many fake updates.

  • Why I cannot open my Adobe Acrobat X Pro?

    Why I cannot open my Adobe Acrobat X Pro?

    Have no clue. You have given us no information. What OS, what happens when you try to open Acrobat X? Are you trying to open from the Acrobat icon or by double clicking on a PDF? Add screen shots if needed to show the results, particularly any error messages.

  • Why I cannot open a restored domain.sites2 file with iweb?? Message: "

    Why I cannot open a restored domain.sites2 file with iweb?? Message: "domain.sites2 couldn't be opend"

    Please supply screen shot when it is asking for updates. (Do not send as email, use CAMERA icon). This is important, there are many fake updates.

  • HT5625 why i cannot open my facetime?

    Why I cannot open my facetime?

    I mean If I try to sign in as required, it will only appear FACETIME ACTIVATION ; COULD NOT SIGN IN. PLEASE CHECK YOUR NETWORK CONNECTION AND TRY AGAIN. But I am using the same network before and it's okey.

  • HT4623 why i cannot open my iphone?

    why i cannot open my iphone?

    Because Apple simply doesn't want users going inside and possibly messing with it's innards.
    They also state that there are no user-servicable parts inside.
    That being said, if you REALLY want to get inside, you can Google or YouTube ways to get in.
    If you just want to see what's inside without actually opening the phone, sites like ifixit.com have teardowns of many devices (including hi-res photos) and will also show you how to get inside the correct way (without destroying something in the process).

  • Why I cannot open my email appendix pdf

    Why I cannot open my email appendix pdf

    What video would that be and what happenns when you try to watch it? Does the video app crash? Does the video start and then freeze? Any details? .....

  • Why I cannot open a application store

    Why I cannot open a application store in my iPhone 5??

    Hi Liza mae,
    If you are having issues connecting to the iTunes Store from your iPhone, you may find the following article helpful:
    Apple Support: Can't connect to the iTunes Store
    http://support.apple.com/kb/TS1368
    Regards,
    - Brenden

  • My account is active and paying per month for Acrobat Pro. Why I cannot open files and the screen asks for serial number?

    my account is active and paying per month for Acrobat Pro. Why I cannot open files and the screen asks for serial number?

    I don't work for Adobe but it seems to me you might be signing in to Acrobat with the wrong Adobe ID.
    Check the Adobe ID you use in Acrobat.
    Check this Adobe ID on Adobe's to make sure that it has an active subscription.

  • Why i cannot open attachment pdf

    hi....why i cannot open attachment pdf

    Hi,
    Did you try downloading the attachment separately and then opening it in Adobe Reader ? What exact issue are you facing ?
    Thanks
    Rohil

  • HT1338 Why I cannot open Mai and send mail via yahoo?

    I now cannot open my mail and send mail. I try sending photos and It says yahoo server is not available
    There shows as well MF Message Error Domain error 1032.
    No idea please help.
    Thanks

    If the app doesn't work, try removing and then re adding your mail info. Sometimes Yahoo gets their wires crossed and starting over is usually the only way to fix it.

  • Why I cannot open certain user account on Youtube????

    My Safari can't open certain user from youtube....WHY???
    and
    sometimes when i opened youtube in the middle of downloading file ... suddenly my download and the other pages stop for real... WHY???
    Mac book pro OS X
    Safari

    Reset Safari.
    Click Safari in the menu bar.
    From the drop down select "Reset Safari".
    Uncheck the box next to  " Remove saved names and passwords".
    Click "Reset".
    Empty Caches
    Safari > Preference > Advanced
    Checkmark the box for "Show Develop menu in menu bar".
    Develop menu will appear in the Safari menu bar.
    Click Develop and select "Empty Caches" from the dropdown.

  • Why I cannot open a link in a new tab, since I upgraded firefox to the latest version ?

    I can't open a google search option in a new tab, since I upgraded Firefox to version 33.0. I also cannot downgrade firefox, to solve this problem.

    Hello,
    '''Try [[Troubleshoot Firefox issues using Safe Mode|Firefox Safe Mode]]''' to see if the problem goes away. [[Troubleshoot Firefox issues using Safe Mode|Firefox Safe Mode]] is a troubleshooting mode that turns off some settings, disables most add-ons (extensions and themes). See the [[Troubleshoot Firefox issues using Safe Mode]] article for more information.
    If Open Link in new tab works in Safe mode, one of the extensions/add-ons (Firefox/Tools > Add-ons > Extensions) was causing the problem. Then let us know what extension or plugin are you using that causes this problem.
    '''You can also try the [[Reset Firefox – easily fix most problems|Reset Firefox Feature]].''' The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your bookmarks, history, passwords, cookies, and other essential information.
    See the [[Reset Firefox – easily fix most problems]] article for more information.
    To Reset Firefox:
    # Open the Troubleshooting Information page using one of these methods:
    #*Click the menu button [[Image:New Fx Menu]], click help [[Image:Help-29]] and select ''Troubleshooting Information''. A new tab containing your troubleshooting information should open.
    #*If you're unable to access the Help menu, type '''about:support''' in your address bar to bring up the Troubleshooting Information page.
    #At the top right corner of the page, you should see a button that says "Reset Firefox" that looks like this: [[Image:Button reset]]. Click on it.
    #Firefox will close and reset. After it is done, Firefox will show a window with the information that is imported.
    #Click Finish and Firefox will reopen.
    '''Did this fix the problem? Please report back to us!'''
    Thank you.

  • Why I cannot open doc. file on iWork'09?

    After I bought a new Macbook Pro(with retina diaplay and with mountain lion system), I installed the iWork'09 and transfer the files from my old Macbook. However, all doc. files and ppt. files cannot be opened. Them can be opened on my old Macbook.
    Many thanks!

    Head to System Preferences > Security > Gatekeeper and set it to "Anywhere"
    Try again or install the free/donate LibreOffice suite here
    https://www.libreoffice.org/

Maybe you are looking for