How To Get Java Sound

I need some help/assistance w. getting some sound to be played in a Java Applet!!! Do I use the "getCodeBase( )" and/or the "getResource( )" methods to do this?

>
I need some help/assistance w. getting some sound to be played in a Java Applet!!! Do I use the "getCodeBase( )" and/or the "getResource()" methods to do this?>getCodeBase() helps find resources relative to the codebase of the applet. If a WAV were in the same directory as the applet, it might be possible to construct an URL like this..
URL theWavURL;
try
  theWavURL = new URL( getCodeBase(), "the.wav" );
catch(MalformedURLException murle) {
  murle.printStackTrace();
// use the URL ..
AudioClip clip = getAudioClip(theWavURL);getResource() is used for resources that are on the classpath of the applet, which adds upp to 'the things in Jar's that are referenced in the archive attribute of the applet element'.
It is not especially a good idea to put things like sounds into Jar files, since they are often already compressed, and for that reason it does not make much sense to try to recompress them (the result is often bigger), and if you put them in a separate 'undeflated' Jar, it simply represents a 'bunch of uncompressed sounds' that would be just as easy to get from the same directory (or sub-directory, or relative directory) using a relative path from the the codebase, as any other way.

Similar Messages

  • HT201401 Do you know how to get my sound to work on my iphone4s, i have no sound from siri,or ringers,or music

    DO ANYONE KNOW HOW TO GET THE SOUND WORKING ON MY IPHONE 4S ?  I HAVE NO SOUND ON MY RINGERS,SIRI OR MUSIC.

    Use your side control and make sure it's not on mute.  Flip the switch to up and turn up the volume.

  • How to get your sound quality great in Vi

    Guys,
    Ive installed vista64 since i did a major upgrade along with my X-FI Gamer Fatality Soundcard, i always thought it dont sound great at all.
    Ive just figured out why, in the sound options of the control panel where you can select the quality of sound always select 48hz studio quality dont go for the 96hz studio quality.
    Do this in all the sound settings for each device and then tailor it to 5. or stereo which every you prefer, then goto the creative console and match it eg 5., stereo etc.
    If needed test the channels and see how nice it sounds. as you will notice so long as you have a decent setup it will sound more fuller in apps and games.
    I was using 96hz studio quality and always thought why it sounded so flat but as soon as i changed it to 48hz studio quality its sounding like i was using XP again, wmp sounds really good, full 5.ch and so are my games.
    You can say now im totally satisfied with vista 64/32, sounds great and it plays all my games really well. Anyways i hope this helps all you out there, let us know how you get on.

    RejZoR wrote:
    You can get best sound with this plugin for WinAMP:
    http://forums.winamp.com/showthread....readid=267586?
    Thanks for that link! That plugin brings the sound back to very close to what I had with XP.

  • How to get Surround Sound 7.1 output out of all speakers?

    Hi all...   I moved my system from Ubuntu recently and am having one small issue that I haven't been able to solve; everything else is working great and I'm about ready to move all of my other systems to Arch also, once I've solved this.  :-)
    The one nagging issue I'm having is with sound.  This is a fiber digital connection that was working on the ubuntu install and a couple other distros I play with, but I haven't been able to find the issue in Arch.  Sound comes out of only the front-left and front-right speakers.  When I do the sound test, it lists all of the other 7.1 speakers, but no sound out of anything other than the front 2 speakers.  I noticed that I don't have an asound.conf, so I was wondering if that might help or if it's not needed with Arch? 
    sound.conf contains the following:
    alias snd-card-0 snd-hda-intel
    alias sound-slot-0 snd-hda-intel
    /proc/asound/cards contains:
    0 [Intel ]: HDA-Intel - HDA Intel
    HDA Intel at 0xf9cf4000 irq 22
    arecord -L shows:
    default:CARD=Intel
    HDA Intel, ALC1200 Analog
    Default Audio Device
    front:CARD=Intel,DEV=0
    HDA Intel, ALC1200 Analog
    Front speakers
    surround40:CARD=Intel,DEV=0
    HDA Intel, ALC1200 Analog
    4.0 Surround output to Front and Rear speakers
    surround41:CARD=Intel,DEV=0
    HDA Intel, ALC1200 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
    surround50:CARD=Intel,DEV=0
    HDA Intel, ALC1200 Analog
    5.0 Surround output to Front, Center and Rear speakers
    surround51:CARD=Intel,DEV=0
    HDA Intel, ALC1200 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
    surround71:CARD=Intel,DEV=0
    HDA Intel, ALC1200 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
    iec958:CARD=Intel,DEV=0
    HDA Intel, ALC1200 Digital
    IEC958 (S/PDIF) Digital Audio Output
    null
    Discard all samples (playback) or generate zero samples (capture)
    If anyone has any pointers, it would really be appreciated.  I'm begging for help.  ;-)

    Thanks!  :LOL: - those were 2 of the url's I've been looking through (in addition to the alsa faq, some stuff on the ubuntu, gentoo and xbmc forums). 
    I've setup an asound.conf and am about to give that a test. 
    --edit--
    Well, that didn't solve it.  I'll have to keep trying.  :-(
    If anyone has managed to get surround sound working out of more than just the front 2 speakers, I'd love to hear how you did it.  ;-)
    Mine is connected via digital, so it's beginning to look like I need to set spdif up somehow.
    But... Now that I think about it, it 'should' be pretty easy since all I basically need is for it to force all raw audio out the fiber digital connection since the receiver actually handles all of the decoding (dang....it worked great in Ubuntu, now if I can just figure it out in Arch). LOL
    Thanks!!
    Last edited by jackmetal (2009-12-12 20:43:32)

  • How to get swoosh sound when mail gets sent

    How to get the swoosh sound back when mail gets sent?

    I'm talking about my iMac desktop. I have OSX 10.9.5. I used to hear the swoosh sound when I sent an e-mail. Suddenly it's gone, and I can't find out how to get it back. I miss it!

  • How to get .java files in iStore

    Hi,
    I do have .class files in my server.How do i get .java files.
    Do i need to create a .java file in jDevloper ,copy the content of the .class and paste it in jDeveloper and compile on the linux server.
    Thanks,
    Sabitha

              Set the 'keepgenerated' parameter in weblogic.xml to 'true'
              <jsp-descriptor>
              <jsp-param>
              <param-name>
              keepgenerated
              </param-name>
              <param-value>
              true
              </param-value>
              </jsp-param>
              </jsp-descriptor>
              thanks,
              Deepak
              "Chris Cooper" <[email protected]> wrote:
              >Hi,
              >
              >I wanna read the .java file compiled from JSPs in Web applications
              >deployed in Weblogic server, and I know that Weblogic delete them
              >after compiles the JSPs. how to get the java file?
              >
              >TIA
              >
              

  • How to get Virtual Sound on Satellite M50

    How do I get Virtual Sound to operate on my system Windows XP Pro (installed in place of Home Edition - English) The Machine is a Satlellite M50 (European - Italian)
    When I turn it on it has no effect! I am using a small set of external speakers (Harmon/Kardon - transparant plastic tubes containing four speaker units in a vertical arrangement) ) connected to the front Conncetion (hole - not usb).
    I downloaded English drivers from Toshiba website - Drivers are correctly installed.
    Appreciate any guidance on this..........thanks PDegenova

    Hi
    There are two important things which you have to follow.
    Firstly all the Toshiba drivers must be installed in the right order.
    And secondly all MS QFEs must be installed.
    I found an long list of the XP QFE on the Toshiba European driver page.
    Please ensure that everything was installed in the right direction .

  • How to get java

    How do I  get java on my new apple?

    You can run Java apps and applets if you subscribe to remote desktop services like AlwaysOnPC. It runs them just fine. See http://www.iphonelife.com/blog/87/how-you-will-want-watch-flash-only-videos-and- use-dynamic-flash-content for more info.

  • Im a DJ and Im trying to live broadcast from my iphone to a website I cant figure out how to get the sound from my mixer into the iphone please help...

    Cant figure out how to get sound from my mixer to my iphone to live broadcast

    Found this https://www.kvconnection.com/ProductDetails.asp?ProductCode=KM-IPHONE-43F35F-A22
    Is it any good for you.

  • How to get Java on my mobile device.

    I pretty much only have one use for Java. I go to a game site that needs Java to run the game, but I don't know what Java program to put on my phone to make it work.
    I have a Palm Treo 700wx with Windows 6. The site I go to is http://wild.ffiends.com/DCourt/Game.stm
    To make that display on my phone's internet what is the best program? J2ME? And how to get it.
    Thanks up front.

    Hi,
    I would ask does the phone have an App for getting IMs ?
    Is the setting to Forward IMs to the Phone set in iChat > Preferences > Accounts ?
    Does your Phone Service support IMs from outside their Network ?
    I presume though that you are sending text to a number (+1234567890) rather than forwarding ?
    The UK T-Mobile site has this page But needs a teelphone number to run the tool and does not answer FAQs as such
    The FAQ Page is here (UK Site)
    I would also be looking for any settings on the my account page (if I had one) to see if Accepting IMs has to be set there (And costings)
    8:41 PM Thursday; April 2, 2009

  • Compaq Presario R3000 how to get the sound to work with Windows 7 RC

    1) Download     SP29586.exe: ftp://ftp.hp.com/pub/softpaq/sp29501-30000/sp29586.exe
    2) Run it, Create a directory  c:\ swsetup 
    3) Once all the Files are extracted DO NOT INSTALL
    4) Now Goto the Start Menu  Click on Devices and Printers, the Click on the Name you have called your  machine this will be marked will a yellow triangle as the sound driver windows 7 has install already is a realtek ac 97 which is not working, 
    5) Once your Machinename  you will see a general tab and and hardware tab select the hardware tab.
    6) Look for the Realtek ac 97  under the Device functions, select that and click properties,
    7) Now tab to the Driver, now click update driver,
    8) Select the option let me pick from a list of devices drivers, now click have disk
    9) Click on Browse  select the following location Swsetup\SP29586\SMAXWDM\W2K_XP and click on  smwdmCH6.inf 
    10)Now the Soundmax Driver should come up select ok and  next. Now your Sound will work
    This question was solved.
    View Solution.

    I am basicaly having the same problem with my labtop. I tried the following above and yet I still have not been able to get my sound to work. I have had some problems with my power and sound cards before but after I reinstalled windows my graphics card and sound card have not been working to their full potential. I thaught that it was a 64 bit graphics card, but now I am not so sure. I had to jostle the power cord in the back till I mannaged to find a perfect spot to keep the computer running. Before the reinstallation I had to put pressure on the left side of the computer to get the sound to work.. but even then it still came in and out.. "The sound that is." I can see the same driver in the codex menue and it is yellow but, what you stated above did not work.
    It says (Cannot continue the hardware update) The wizard cannot find a better match for your hardware than the software that you curently have installed. and then tells me to keep the current software. My sound Icon does not show up when I go to the settings.... I can't play diablo 2 on this no idea why... But my screen is choppy when I scroll through internet sites and it did not do that before. I have a 400mbs connection .... here is my computer information. :Compaq Presario R3000 Intel pent4  2.80ghz    2.80ghz       1.12GB ram and im running on windows xp2 professional.

  • How to get java.sql.Timestamp data from database

    Hello, i'm new to EJB and i can't get java.sql.Timestamp data, but when i'm trying to get java.lang.String data it works fine.
    * @ejb.finder
    * query="SELECT OBJECT(c) FROM userSCHEMA AS c
    *      WHERE c.lastName LIKE ?1
    * AND c.firstName LIKE ?2
    * AND c.registeredDate < ?3"
    * signature="java.util.Collection findPatient * (java.lang.String lastName,
    * java.lang.String firstName,
    * java.sql.Timestamp)"
    <method-params>
    <method-param>java.lang.String</method-param>
    <method-param>java.lang.String</method-param>
    <method-param>java.sql.Timestamp</method-param>
    </method-params>
    Where i made a mistake ?

    The main problem that I'm faced with, is that the
    java.sql.Timestamp now has only one constructor, it
    takes "long", i.e., milliseconds.That's because a Timestamp is just an offset from a particular instant of time. It doesn't have a timezone.
    Please note that I'm not trying to "print", i.e., I'm
    not interested in using the SimpleDateFormat.Then what are you interested in? You appear to be trying to create a Timestamp with a particular timezone, which doesn't make sense as I already noted. Is there a reason for this?

  • How to get the sound from my Roland RD700GX keyboard through GB

    Hey everyone
    I've got a Roland RD700GX keyboard. When I plug the midi into my macbook it will play the music through GB but it won't give me the sounds from the keyboard. I was wondering if there was any way that I can get the sounds from my keyboard into GB? Let me know.
    Kia Kaha
    Bevan

    Thanks for your reply, Christoph. I did not say anything about MIDI except that the Edirol is a MIDI interface. I am using it to patch an audio "phone cable" ( a guitar cord) to a USB out to go to the Mac. This is what the interface is designed to do. You were correct that the bleeding and feedback were due to using the built-in microphone inadvertently. I was able to correct the problem by changing the "monitor settings" by double-tapping on the Record button and selecting "No Monitor" only. This does not affect my playback and recording any so my problem is solved.
    Thank you for the link to GB FAQs, that is a helpful site.
    Michael

  • How to get Java source in applet stack trace to debug Java security manager

    How can I get line numbers for Java source in stack traces for my applet? I'm having a problem with my code-signing certificate. On one of my applets, I consistently get a NullPointerException inside the security dialog code in the JDK. As a result, either the "trust this applet" dialog never appears, or even though it appears, it defaults to untrusted because of the exception, so I can't access any local files (and that's a bit of a problem for an applet whose sole purpose is to upload files to our server). I unzipped src.zip in my JDK directory and set the debug flag for my Ant <javac> task as well as set debuglevel to "lines." Anything else? Here's the trace that I'm getting so far. See that after the NullPointerException it assumes that the user has denied permission. If I could read this Java source maybe I could figure out why it hates my code-signing certificate (jarsigner, BTW, never complains when I verify my jar).
    security: Blacklist file not found or revocation check is disabled
    security: Accessing keys and certificate in Mozilla user profile: null
    security: Loading Root CA certificates from D:\Program Files (x86)\Java\jre6\lib\security\cacerts
    security: Loaded Root CA certificates from D:\Program Files (x86)\Java\jre6\lib\security\cacerts
    security: Loading Deployment certificates from C:\Users\Rich\AppData\LocalLow\Sun\Java\Deployment\security\trusted.certs
    security: Loaded Deployment certificates from C:\Users\Rich\AppData\LocalLow\Sun\Java\Deployment\security\trusted.certs
    security: Loading certificates from Deployment session certificate store
    security: Loaded certificates from Deployment session certificate store
    security: Validate the certificate chain using CertPath API
    security: Obtain certificate collection in Root CA certificate store
    security: Obtain certificate collection in Root CA certificate store
    security: Start to check whether root CA is replaced
    security: The root CA has been replaced
    security: No timestamping info available
    security: Found jurisdiction list file
    security: Start checking trusted extension for this certificate
    security: Start comparing to jurisdiction list with this certificate
    security: The CRL support is disabled
    security: The OCSP support is disabled
    security: This OCSP End Entity validation is disabled
    security: Checking if certificate is in Deployment denied certificate store
    security: Checking if certificate is in Deployment permanent certificate store
    security: Checking if certificate is in Deployment session certificate store
    java.lang.NullPointerException
         at com.sun.deploy.ui.UIFactory.showSecurityDialog(Unknown Source)
         at com.sun.deploy.security.TrustDeciderDialog.showDialog(Unknown Source)
         at com.sun.deploy.security.X509Util.showSecurityDialog(Unknown Source)
         at com.sun.deploy.security.TrustDecider.isAllPermissionGranted(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.isTrustedByTrustDecider(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.getTrustedCodeSources(Unknown Source)
         at com.sun.deploy.security.CPCallbackHandler$ParentCallback.strategy(Unknown Source)
         at com.sun.deploy.security.CPCallbackHandler$ParentCallback.openClassPathElement(Unknown Source)
         at com.sun.deploy.security.DeployURLClassPath$JarLoader.getJarFile(Unknown Source)
         at com.sun.deploy.security.DeployURLClassPath$JarLoader.access$700(Unknown Source)
         at com.sun.deploy.security.DeployURLClassPath$JarLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.deploy.security.DeployURLClassPath$JarLoader.ensureOpen(Unknown Source)
         at com.sun.deploy.security.DeployURLClassPath$JarLoader.<init>(Unknown Source)
         at com.sun.deploy.security.DeployURLClassPath$3.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
         at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
         at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    security: User has denied the priviledges to the code
    security: Adding certificate in Deployment denied certificate store
    security: Added certificate in Deployment denied certificate store
    security: Loading certificates from Deployment session certificate store
    security: Loaded certificates from Deployment session certificate store
    security: Validate the certificate chain using CertPath API
    security: Obtain certificate collection in Root CA certificate store
    security: Obtain certificate collection in Root CA certificate store
    security: Start to check whether root CA is replaced
    security: The root CA has been replaced
    security: No timestamping info available
    security: Found jurisdiction list file
    security: Start checking trusted extension for this certificate
    security: Start comparing to jurisdiction list with this certificate
    security: The CRL support is disabled
    security: The OCSP support is disabled
    security: This OCSP End Entity validation is disabled
    security: Checking if certificate is in Deployment denied certificate store
    security: Checking if certificate is in Deployment denied certificate store

    Rats, now that I look at the stack trace and compare to what's in the JDK srce.zip, it appears that most of this code is not part of the JDK source. I don't see any com/sun/deploy, etc.

  • ???????????HOW TO GET SURROUND SOUND ON MACBOOK???????????????????????

    I have a macbook osx 10.5.8. I purchased some Logitech X-540 5.1 surround sound speakers to hook up to my laptop. There are 3 cables (an orange, green, and black) that come from the different speakers/subwoofer that are supposed to plug into the computer, but i can only plug in 1 of the 3 into the headphone jack my macbook. Here's some pics of the speakers:
    http://techgage.com/print/logitechx-540_51speakers
    When I do so, only some of the speakers play, not all of them. I went to BestBuy and asked someone if surround sound is possible for a macbook, but he said "no". I have seen online many people claiming it is possible to get 5.1 surround sound for mac, but haven't figured out how. Can someone please be of some assistance????

    Since you only want to play CD's why not just use the two for the normal Left/Right channels your CD was created with?
    If you want to use ALL of your speakers, you'll need to invest in a USB or Firewire device that will connect to your Macbook and then allow you to connect all your speakers.

Maybe you are looking for