Applet / Application Sound problem

Hey everyone,
I'm programming a game named None Left, and the main file (NoneLeft.java) contains a constructor :
public class NoneLeft extends javax.swing.JApplet implements Runnable, ContextListenerIt also contains a main method:
    public static void main(String s[]) {
        JFrame f = new JFrame("NoneLeft");
        f.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {System.exit(0);}
        JApplet applet = new NoneLeft();
        f.getContentPane().add("Center", applet);
        applet.init()        f.pack();
        f.setSize(new Dimension(800,600));
        f.setVisible(true);
AudioClip music;
music = applet.getAudioClip(new URL("file:///K:/BinaryFinary2.wav"));
music.loop();The problem is that whenever I try to use the applet's method getAudioClip,
i get the following error:
Exception in thread "main" java.lang.NullPointerException
        at java.applet.Applet.getAppletContext(Applet.java:187)
        at java.applet.Applet.getAudioClip(Applet.java:295)
        at noneleft.NoneLeft.main(NoneLeft.java:865)The code at line 865 is:
music = applet.getAudioClip(new URL("file:///K:/BinaryFinary2.wav"));
music.loop();The NullPointerException is really what has me puzzled. The applet is there: It's created in the public static void main method, but it just won't work. Anyone have a clue about why that is?
I have a feeling it's because of the Applet inheritance and the application; it's not sure which one is which...or maybe not.
Thanks so much!
Edited by: simpavid on May 27, 2008 4:11 PM

Thank you so much for your help so far;
However, I still haven't gotten this to work.
I now have the code:
JFrame f = new JFrame("NoneLeft");
JApplet applet = new NoneLeft();
f.getContentPane().add("Center", applet);
applet.init();
f.pack();
f.setSize(new Dimension(800,600));
f.setVisible(true);
AudioClip music = applet.getAudioClip(applet.getCodeBase(), "BinaryFinary.wav");
music.loop();but my error still exists:
Exception in thread "main" java.lang.NullPointerException
        at java.applet.Applet.getCodeBase(Applet.java:152)
        at noneleft.NoneLeft.main(NoneLeft.java:861)The strange part is that getAudioClip no longer gives me a null pointer but getCodeBase() does. I also tried getDocumentBase() and it gives me an error. I'm wondering if this has to do with the fact that this is called on an applet from a main method? The applet is instantiated as a NoneLeft object, which extends JApplet, so that shouldn't be the problem. Do you have a clue on how to fix that?
Again, thanks so much for the help.

Similar Messages

  • Q10 Software 10.2.1.537, Application Sound and Speakerphone Problem

    Hi
    Several days after I updated my BB Q10 with 10.2.1.537 Software Release, I experienced two problems:
    a.  when I make or receive phone call, the Speakerphone mode is always turned ON automatically.  I cannot turn it OFF.  So I cannot make phone conversation in private.
    b.  the applications' sound becomes very small.  
         Ex: sounds from receiving email, BBM, SMS messages.  Reminder sound from calendar
         Exception: only Alarm application sound is still normal
    After I reboot the phone, the applications' sound becomes normal.  But as soon as I make or receive phone call, the applications' sound becomes very small again.
    I have performed Reload Device Software with Blackberry Link, install the latest 10.2.1.537 Software Release, and restore the backup file.  Same problems still persist.
    Please advice how to fix these problems.
    Thanks

    My Q10 has a similar problem that seems to happen only when driving over 40 Kph. sound cuts in and out, whether i am on speaker phone, earphone or blue tooth. I've gotten a replacement Q10 and its doing the same. Any solutions?

  • I have sound problem in My Cq40-144TU Laptop

    Hi,
    I have Cq40-144tu laptop. i am't hearing sound from internal speaker but sound is hearing from headphone. I have configured my system many time. Last got to shop and they also format it and reconfigured but still this problem is showing. 
    But I was hearing sound from speaker when i chat in gtalk and then i heared sound from window media player and other application also for 5 to 10 second only. every time some text is recieved i hear sound for 5 to 10 second.
    please tell me what is problem in My Laptop. i have window 7 ultimate operating system.
    Please help me sir

    What sound problem - no sound on anything, no sound on some apps ?
    Have you got notifications muted ? Only notifications (including games) get muted, so the iPod and Videos apps, and headphones, still get sound.
    Depending on what you've got Settings > General > Use Side Switch To set to (mute or rotation lock), then you can mute notifications by the switch on the right hand side of the iPad, or via the taskbar : double-click the home button; slide from the left; and it's the icon far left; press home again to exit the taskbar. The function that isn't on the side switch is set via the taskbar instead : http://support.apple.com/kb/HT4085
    And for future info typing in all capitals is considered to be SHOUTING

  • Why are system and application sound files appearing in itunes?

    Suddenly, over 900 system and application sound files, each about a second or 2 long, have appeared in my iPhone 4S music player. They've also appeared in my iTunes on my desktop iMac. Not sure whether they appeared on the computer first or on the phone first. I can't figure out why they appeared there or how to get rid of them (without also removing them from the system and applications which, of course, I don't want to do).
    I searched through the discussions here and found several other people complaining about the same thing, going back a couple of years, but no solutions offered. I hope someone can offer a clue.

    Thanks for the suggestions and help. While the cause of this problem is still obscure, we've managed, with an Apple tech's help, to remove the system/application sound files from both the iPhone and iTunes. We used Time Machine to backtrack to the point at which the sound files first appeared in the iTunes folder, then moved back one more day and restored the iTunes Media folder (where all the music was stored) and 2 iTunes files: iTunes Library.itl and iTunes Music Library.xml (we could also have simply restored the entire iTunes folder with the same effect). Then we synced the iPhone.
    As for the cause, that's still a puzzle. From Time Machine, we were able to determine that the files were added between midnight and 12:47 AM on a particular day, but that computer was not in use at that time (the user was asleep in bed, and the only other person in the house at the time was me -- and I don't touch that computer).

  • TS2090 Apple TV mirroring - sound problem. Tried everything. It's ****.

    I'm feeling totally exasperated. I've tried every 'solution' to the inherent Apple TV mirroring sound problem. Why don't Apple just fix it?? All I want to do is be able to view my computer video with sound when i want to. I don't feel that I should have to spend up to and over an hour trying repeated combinations of turning things on and off, entering code into Terminal, etc. EVERY TIME THAT I TRY TO MIRROR THROUGH APPLE TV. It's ridiculous, aside from the cost of buying the unit, I had to upload Mountain Lion despite the fact that my new (Early 2012) imac should have been on spec. That took hours and it still doesn't work. Very dissappointed, Apple have lost my brand loyalty for such an obviously fixable thing. ( I don't think that they read these comments). hope this makes you think twice before buying.  Yours, m

    I found a fix for this problem thanks to a friend of mine who I can only assume did a little research online!!
    The problem I had was having AirParrot once installed, and after the recent 10.9.2 update, the third party app messed up the way Mirroring was working..
    Here is the fix:
    1. Open Terminal in /Applications/Utilities.
    2. Run these commands respectively:
    sudo rm -rf /System/Library/Extensions/APExtFramebuffer.kext
    sudo rm -rf /System/Library/Extensions/AirParrotDriver.kext
    sudo rm -rf /Library/Extensions/APExtFramebuffer.kext
    sudo rm -rf /Library/Extensions/AirParrotDriver.kext
    This will uninstall kernel extensions related to AirParrot. Other solutions around the web being posted are missing the extensions within /Library/Extensions.
    3. Enter your administrative password when prompted.
    4. Restart your computer.
    I tried it once again and it worked like a dream!!!
    Here is the article for reference:
    http://9to5mac.com/2014/02/28/os-x-10-9-2-breaks-airplay-mirroring-and-desktop-e xtensions-to-external-monitors-for-some-users/
    Many Thanks for all who tried to help, and especially Wasim!!
    Hope this helps anyone with the same problem in the future!!

  • OSMF  Flex 4 VideoPlayer sound problem

    Hi,
    It seems that there is a problem with sound in the Spark VideoPlayer in video that's been encoded in H.264.
    If I set 'autoPlay' to 'true' or start playing from the very beginning of the clip, everything works fine.
    But if I set 'autoPlay' to 'false' and start the video not from the beginning, i.e. click somewhere in the seekBar, video is playing, but there is no sound. Once I jump back to the very beginning of the clip the sound appears, and from that point I can play the clip from any section and sound is there.
    Once I reload the video, the story is repeated.
    This happens ONLY with H.264 files and does NOT happen with flv files.
    Also, I don't believe that this problem existed back in the beta version of Flex 4 (previous version of FlashPlayer 10.x.xx.xx), even after the VideoPlayer became OSMF based.
    FTQuest

    Good evening Brian,
    After installing the latest Flash Player from the Adobe labs and switching to the latest nightly build of Flex SDK the sound problem is gone.
    But I've run into another one: I make a simple OSMF player in Flash CS5 and it works fine within the Flash and also when I open the resulting SWF in stand alone Flash Player.
    Yet, when I try to open the swf from within the Flex 4 application, using mx:SWFLoader I get the following error: VerifyError: Error #1053: Illegal override of synthesizer in org.osmf.layout.LayoutMetadata.
    Any advice on that?
    Thanks,
    FTQuest
    P.S. Also, for some reasons setting the 'autoPlay' on MediaPlayer to 'false' doesn't prevent the video from instant playing.

  • Recording application sound

    I want to make a captivate recording of a multimedia
    application.
    It works fine to record the movie-elements in the
    application, but i also want to record the application sound.
    As a work around, I now put my microphone in fron of a
    loudspeaker. The result is not to bad, but it would be much better
    If I could record the application sound electronically into
    Captivate. Is this possible? How?

    Hi Paul,
    Unfortunately this isn't really any thing else that you can
    using Captivate to capture the audio. I've used the old sticking
    the microphone in front of the speaker from some projects in past.
    If volume of the recorded audio is a problem then you could
    probably improve on this using an audio editing application such as
    Adobe
    Soundbooth (Beta 2) or
    Adobe Audition.
    Failing that, could you always contact the developers and can them
    if they could provide you with the application sounds.
    Regards,
    Mark

  • Sound problems with iPhone 6 plus

    I have sound problem with my iPhone 6 plus.
    Some apps have sound, others no.
    For exemple the app minipiano has no sound (it works fine on my ipad mini)
    Does anyone has the same problem ?

    Hello there,  .applefan.
    When having performance issues with an application installed on your iOS device, the following Knowledge Base article offers up some practical steps for troubleshooting your issue:
    iOS: An app you installed unexpectedly quits, stops responding, or won’t open - Apple Support
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • Sound problem + high temperature

    I own phone
    sony xperia z1
    Since the update the phone to Android 5.0.2 system and I have two problems, namelyFirst / chopping sound problem during normal call ... the other party does not hear my voice clearly
    Note that the sound is excellent and there are no any problems when talking across other applications such as Alaska Bi skype or viber
    The second problem, a phone degree temperature rise significantly and unnatural when surf the Internet or watch a video over phone
    I hope to help me

    Hi AhmedAbdeen & RobinZ1, welcome to the community!
    I agree with @Uliwooly - here are some additional instructions on running the actual repair: 
    (Note: A software repair will delete all user data, to back up your data before the repair on a mac just click on Backup my Xperia device and follow the on-screen instructions and on a PC just click Start under Backup & Restore and follow on screen instructions). 
    Running the software repair on PC Companion:
    1. Install and open PC Companion then select Support Zone.
    2. Phone Software Update.
    3. Start.
    4. Repair Phone
    5. Continue
    6. Accept data removal
    7. Next
    8. Wait for prepare
    9. Select Phone
    10. Follow the connection steps
    Running the software repair on Bridge for Mac:
    1. Launch Bridge for MAC without the handset connected.
    2. On the Main Window select "Xperia > Repair Xperia Device".
    3. Ensure the phone is charged and select "Ok" in the following window.
    4. Select Continue on the following page.
    5. Wait until the initialising step is finished the continue as below.
    6 . Select your model of phone from the list that appears
    7. Follow the connection steps that appear, ensuring that you are holding the relevant button down before during and after the connection phase until the update/repair begins.
    Hope this helps! Keep us updated. 

  • Kde4: sound problems

    Hello,
    I recognize 2 sound problems with kde4 here: The kde startsound is not fully played (cut after 2-3 seconds) and in general the sound is very quiet although the mixer controls are at the top, e. g. when playing an internet video.

    I think the login in sound cuts out if you are logging into a session and another program steals sound focus.  I only say this because the same thing happens on my desktop and it happens as pidgin and my systray apps start coming up.
    On your mixer applet see what the label is, the default on mine after I upgraded was PCM I would move that up to about 80 and then right click on the applet itself and choose Select Master Channel
    I was able to choose Front which seems to another way of saying main or master, as once I chose that the volume levels were more satisfactory.

  • Applications sound doesn't work

    The applications sound is muted even though it's turned on and the ringer's sound works normally, what could be the problem?

    Do all other apps have sound, or just the Music and Videos apps, and do those apps have sound if you use headphones ? If they do then have you got notifications muted - that would mute notifications (including most app), so the Music and Videos apps, and headphones, still get sound.
    Depending on what you've got Settings > General > Use Side Switch To set to (mute or rotation lock), then you can mute notifications by the switch on the right hand side of the iPad above the volume switch, or via the taskbar : double-click the home button; slide from the left; and it's the icon far left; press home again to exit the taskbar. The function that isn't on the side switch is set via the taskbar instead : http://support.apple.com/kb/HT4085
    If that isn't the case then have you tried deleting one of them and then re-downloading it via the Purchased tab in the App Store app to see if it then works ?

  • L505D-S5983 Sound Problem/Fix

    Hi,
    Have had the PC for about a month. Really like it! Good price $399 at Best Buy!
    Started having Audio problems. Sound would stop emit a loud static sound then start working OK.
    Tried many of the suggestions on this forum but none helped.
    I started noticing that if music was playing and the PC started taxing the CPU (Running other applications), the problem would come back.
    I had recently installed the CA Internet Suite that Roadrunner offers. I remembered that this application seemed to be a resource hog on our desktop. I uninstalled it, loaded Avast and the problem has not come back. I ended up with the Micro$oft driver installed after troubleshooting. Unless I have any further issues, I will leave it as is.
    Hope this helps others!

    ps hp if you keep ignoring the users and not fixing the driver then people wont buy from you oh  and its been sence july get your thing right...

  • Battlefront WARPED SOUND problem

    Hi,
    Im baffled by this one, hopefully someone can help me ?
    I loaded Battle front for my G5. I downloaded their(aspyr) latest update/patch.
    I also check their Forum for discussion regarding sound problems
    I also am running a G5. 2.8 ghz, 2gig ram, ati 9600 pro with UPDAED DRIVERS, and LATEST QUICKTIME for my current OS.
    PROBLEM::::
    When i launch the game the SOUND is WARPED, in sound OPTIONS i click on sounds to adjust and sounds are DELAYED and WARPED.
    It sounds like a cassette tape player with dead batteries
    In game play its the same, WARPED SOUND all over the place.
    Please, how can I fix this ?
    Thank You

    Hi,
    After weeks of no bother, I had a similar issue, with the same game, on my G5 iMac...
    It was resolved after the disc permissions were verified and then repaired.
    Applications - Utilities - Disc Utility...
    Hope this helps
    Tony

  • K7N2D-L Sound problem with Audio CDs

    Hi there , i have the following problem. Whenever i want to play an audio CD , the firts track will play fine , with no audio problems BUT if i skip to the next track .. , the sound will suddendly play at slow speed , like slow motion sound . The thing is , after this happens , every windows or applications sounds will play as well in slow speed. The only way to solve it is to reboot my pc . This ONLY happens when i use an AUDIO CD , and only after the first track . Does anyone experienced anything like this ? . thx a lot.

    Resetting the PRAM did not work for me. Last week, the optical drive was waiting a few seconds and then ejecting all media (CDs, DVDs, Installation disks...)
    The guy at the local Apple store ran diagnostics and reset the DVD region. Although I have never had Mac OS ask what region I wanted to use, it is supposed to ask the first time you insert a DVD. If you switch regions (such inserting DVDs formatted for North America-1 and then Europe-2,) you will be asked for the Region each time you insert a different region. For once the region has been changed five times, it is locked in at the last region you selected and the user cannot change it again. There is some Pirateware that will allow you to change it but let the buyer beware.
    At any rate, whatever the "Genius" did at the store made my optical drive accept anything but an audio CD.
    Anyone have any ideas?

  • Output Sound Problem

    Has anyone noticed that output sound on the itunes is distorted and after opening and playing the same file in QuickTime that the problem is gone?
    I am using iTunes to open and play a sound file, say an imported CD song, and the sound is distorted.
    Checking the preferences option to perform a Sound Check helps but does not completely solve the problem. After opening Quicktime and opening the same file, the output sound is fine, in both applications?
    It seems that all was well before my update of the applications and the Firmware. Should I be suspicious of that as the culprit or is this some other symtom of impending doom?
    The sound problem is on internal speakers, earbuds, or a set of sennheiser headphones.
    itunes 7.0 updated a few days ago
    QuickTime 7.1.3 updated recently
    SMC Firmware update a few days ago
    White MacBook 2Gz   Mac OS X (10.4.7)   First Mac

    I might have the same problem. Playing audio occasionally becomes very scratchy, to the point that I have to stop listening. It usually lasts a few minutes. It's maddening.
    It happens via the internal speakers or through headphones.
    Occurrence isn't very consistent. I notice it most in iTunes (v7), but that's probably only because I play most audio in iTunes. I've had it happen now when playing video in VLC, too. It seems to only happen after playing audio continuously for at least 10 minutes. I haven't been able to reproduce it at will, so I haven't bothered taking it to my local Genius bar yet (at least not for this problem).
    MacBook   Mac OS X (10.4.8)  

Maybe you are looking for

  • MBA not always recognizes external display after sleep

    Hi, I have a 2011 MBA and use it on a external display (Dell 2709w) with the lid open. The issue with this MBA is that after sleep it often (every second time I wake it up) doesn't show anything on my external monitor. In order that the external moni

  • Inserting flash in Dreamweaver.

    now I have seen tutorials over and over and I have done this website 3 times now. I do the div's first at then I do make an editable region and save the template. Then I do the pages. Then I go to the left middle div to insert the flash (in the templ

  • Cash flow code

    Hi, My client wants to enter the cash flow code on business transaction entry level like Business area and cost centers. He wants the complete cash flow statement for the same (Not a Legal Cash flow statement S_ALR_87012271 - Cash Flow (Direct Method

  • Photos duplicating on their own

    Hi, I had around 300 photos on my iMac, (running OS X Mavericks), and whenever they I open them, or sometimes on random, they will duplicate themselves. I started with 300 original photos and by the end of 3 month, i had 5000 photos!!!! I have taken

  • Can I disable App Store?

    App Store keeps bothering me to install OS X 10.10, but I want to stay at 10.9. Can I disable App Store, or otherwise ignore the update? I miss the old Software Update utility -- you could select "Ignore this update" and was less intrusive and annoyi