Putting sound files in

I have a sound playing in an application, using the following code:
File file = new File("cocacola.midi");
clip = Applet.newAudioClip(file.toURL());
clip.loop();
it works fine, except when I put all the classfiles into a jar format, the program insists on taking the sound file from the root folder (the j2sdk.../bin folder with javac, java, etc programs). How can I force the program to take the sound file from the jar file, or the folder that the program is held in, without that folder being the root? thanks

Never mind. I figured out the reason, and another reason why I'm an idiot :)

Similar Messages

  • I recorded audio with Quicktime player and the sound files won't disappear from the desktop no matter how I try to put them in the trash...

    I recorded audio with Quicktime player and the sound files won't disappear from the desktop no matter how I try to put them in the trash...tried xing out the red x, putting them in the trash...right clicking to make them disappear...nothing works...

    Just got rid of them... I closed Quicktime and was asked to delete. So I deleted them. Problem solved.

  • The .Mac sound files: Can I put them on a web page?

    Well, now that I have all those sounds files (Thank you, Diane Cayton!), I would like to put them onto some iWeb pages for atmosphere. I refer to the sound files of the squeaky door, the horse whinny, the typewriter clicking etc).
    1) Would I have to convert the sound files the same way that I did for my .mp3 music files? (From .mp3 files to .mov files)
    2) Would they be edited in the same way as the other sound files that I got from Michael Wong's website? (height 16px, controller False, Loop True, and Automatic Start True) If so, then I assume that they would be treated the same way in MassMoveIt as the other .mov files.
    Thank you -----
    Lorna in Southern California

    My new reason for uploading photos to a photo sharing site is: backup security for my photos, and simply an alternate way to show photos/slideshows/videos.
    I liked the LOOK of Picasa a lot, but then I discovered that Picasa system requirements are PC; I didn't see Mac anywhere. I sent an email and the response was to send me to a page where I surmised the above. They do not say, "We don't work with Macs." They only list PC jargon in system requirements.
    Another photo sharing site I found: Dropshots, where you can upload your VIDEOS. They play all kinds of video formats. I am considering uploading my videos to Dropshots or some such site and then putting hyperlinks onto a "Movie" page template in iWeb. That way ALL of my friends can see my videos, not just those who have QuickTime. I did an informal survey among people in my email group, and enough of them said that they don't have QuickTime to make me think twice.
    There is another site which has My Space in the title, and it mentions slide show creations.
    WHAT I MIGHT DO TO DECIDE WHICH ONE I LIKE:
    I will choose a folder of photos (probably Nancy's African Safari) and join those sites, which are free. See how difficult or easy each site makes it for me to upload photos. See what options are offered for formatting and making the page look good. See what the final outcome is. How good do the photos look? I am old, those photo sites make the photos look better than iWeb slideshows do. Then after researching it to death and beyond, I will choose the site that satisfies my requirements.
    I am going to a funeral today; yet another light in the universe has blinked out forever. I know that it is balanced out by some baby being born somewhere, but theoretical and philosophical constructs are no solace for personal loss.
    Lorna in Southern California

  • How do I get a handle on embedded sound files?

    From the Sound Class information, it says to use the SoundMixer Class to handle embedded Sound Files.  I have two sound files embedded, that I have setup in 2 separate layers, starting at frame one in the main timeline.  I needed to do this so I could see the wave files, and coordinate text with the waves.  I do not want to load these files into the .swf file at runtime using URLRequest.  How do I get a handle on those as they exist, to make each controllable by separate volume and mute controls for each sound?
    This will be a challenging question, because, "it can't be done" doesn't work for me.  I managed to create a way to use an external classfile to control the main timeline, the ROOT timeline, without having to create a sub movie to root.  I can use my component to call play(); as though it were in code in a frame.  But it isn't, it's in an external classfile.  I passed root to the classfile and told the classfile to think of it as a movieclip - that put the handle on it.  I tried similar way with root as a Sound, but that isn't detailed enough - I need to get a handle on the frame that contains the embedded sound file.  I embedded, attached it, using the properties view for the frame.
    I've attached, or whatever you want to call it, these sound files to a frame, and this frame is or should be attached to the layer I've created.  So, under the assumption that the ROOT has everything attached to it in some manner (it is after all the foundation for the COM), the stage of the root contains the visual components, so ROOT has to have the layer objects attached to it, which should have the frame objects attached to the layers.  I have two layers that each have a .wav file attached to frame one.  Somehow Flash keeps track of that - I want to know how Flash does it so I can read what flash reads.
    If this seems redundant, it probably is.  I want to paint the best picture I know how so I can get detailed feedback.  Please, if you have questions ask them so we can clarify, and get this resolved!  Thanks for reading!

    lol.
    ok, it can be done.  keep working on it.

  • Can't put a file in DW

    I manage a bunch of sites in DW, and just recently when I put a file it seems to go OK, no error message, but it doesn't show up on the site. This only happens with one site, that I've been doing for a couple years. All other sites OK. So I tried Filezilla, and that doesn't work either with this one site. When I look at the files in the cpanel they aren't there, but I can upload them OK using cpanel. Perms are 0644 or 0755. Checked all the options in DW, manage sites, test server etc, all OK. I did upgrade to Lion recently. What gives with this one site?

    Sounds like an ownership issue which is different from a permissions issue.  On a Unix system, including your Mac, there are read/write permissions which you looked at and then there are ownership permissions, usually defined with a group and a user.  More than likely these are wrong.  If you are in a dedicated or VPS environment, you should be able to make things changes through a dedicated FTP client like Filezilla or Transmit.  However, if you are in a shared environment, more than likely you do not have system permissions to modify file ownership, in which case you would need to contact your host who should be able to easily verify and fix this on your account.

  • Error while playing sound file in Applet

    Hi!!
    I am trying to play sound file in the applet which produces sound continuously, when it goes above certain set value. When i run the sound file individually it runs perfectly fine but when i try to call that class in diff. program its giving me some security error..i am trying to solve this problem from last so many days..i dont know whether i have to make some change in Security file policy or java policy..the error is like..
    java.security.AccessControlException: access denied (java.util.PropertyPermissio
    n user.dir read)
    at java.security.AccessControlContext.checkPermission(AccessControlConte
    xt.java:269)
    at java.security.AccessController.checkPermission(AccessController.java:
    401)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:524)
    at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:12
    76)
    at java.lang.System.getProperty(System.java:573)
    at SoundApplication.startLoadingSounds(SoundApplication.java:52)
    at SoundApplication.<init>(SoundApplication.java:42)
    at TempSet.actionPerformed(TempSet.java:103)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:17
    86)
    at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
    ctButton.java:1839)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
    .java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
    istener.java:245)
    at java.awt.Component.processMouseEvent(Component.java:5100)
    at java.awt.Component.processEvent(Component.java:4897)
    at java.awt.Container.processEvent(Container.java:1569)
    at java.awt.Component.dispatchEventImpl(Component.java:3615)
    at java.awt.Container.dispatchEventImpl(Container.java:1627)
    at java.awt.Component.dispatchEvent(Component.java:3477)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
    at java.awt.Container.dispatchEventImpl(Container.java:1613)
    at java.awt.Window.dispatchEventImpl(Window.java:1606)
    at java.awt.Component.dispatchEvent(Component.java:3477)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
    read.java:201)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
    ad.java:151)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
    Please suggest some solution for this..its kinda urgent..
    Thanks in advance.
    Regards,
    Amish

    Are you loading your Applet from a webserver? You could make the sound file available through the same webserver.
    Alternatively, you could package the sound with the code in a JAR. It does mean a bigger download for your Applet users though, but the Applet would be able to access the file quickly.
    If you put your file in the JAR, say in /sound/myfile.ext , then you can get access to it from your code like this:
    URL soundURL = getClass().getResource( " /sound/myfile.ext" );

  • We transferred purchases / synced an iPod touch to a toshiba laptop, and then updated the ipod. we can no longer put the files back onto the ipod. what are we doing wrong]

    we transferred purchases and synced from a iPod touch to a toshiba laptop, after it updated and synced again we have been unable to put the files back onto the ipod. the computer will not let us drag or copy paste files, and when we tried to " export" the library to the documents folder, it only showed up in code.  we have books and music we would like to reload to the ipod.

    Hello Jean164,
    Thank you for using Apple Support Communities!
    It sounds like you are unable to manually put your content back on your iPod Touch.
    It seems like you may need to re enable Manually Manage Music now that the device has been updated, and this article should help with that.
    Managing content manually on iPhone, iPad, and iPod
    http://support.apple.com/kb/HT1535
    Cheers,
    Sterling

  • Problem with playing a sound file.

    Hi,
    I simply want to play a sound by a button click. I imported
    <AVFoundation/AVAudioPlayer.h>. The code block is here:
    In .h file:
    #import <UIKit/UIKit.h>
    #import <AVFoundation/AVAudioPlayer.h>
    @interface PlaySoundViewController : UIViewController <AVAudioPlayerDelegate>
    in .m file:
    -(IBAction)btnPlay:(id)sender
        //Get the filename of the sound file:
        NSString *path = [[NSBundle mainBundle] pathForResource:@"REC001" ofType:@"MP3"];
        AVAudioPlayer* thePlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];//error here as it will compile if I commented it (and two line after) out.
        thePlayer.delegate = self;
        [thePlayer play];   
    Everything looks fine but it failed when I tried to run it. Looks like it cannot find my sound file "REC001.MP3". I put it in folder ".../PlaySound/Resource Files/SoundFiles/REC001.MP3", and "PlaySound" is my project name. However the path returned is ".../PlaySound/REC001.MP3". I guess this is why it cannot find the object. But it didn't work even I put the sound file under "PlaySound" directly. Anyone has a solution?
    Thanks.
    Regards,
    Taizhi

    Hi Mark,
    Thanks for the reply. Based on your instruction, I checked and I can see the sound files in Build Phases. The location is ".../PlaySound/SoundFiles/REC001.MP3". I don't know why it ignores folder "Resource Files". I guess that is the way it is as I also can see other images in different folders which are shown properly in the project.
    The detailed error message is here:
    Ld "/Users/greatzhi2001/Library/Developer/Xcode/DerivedData/PlaySound-anydnuuxbpxz lqfodwbuqqjwjzcd/Build/Products/Debug-iphonesimulator/PlaySound.app/PlaySound" normal i386
        cd "/Users/greatzhi2001/Desktop/iProjects/PlaySound"
        setenv MACOSX_DEPLOYMENT_TARGET 10.6
        setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr /bin:/usr/bin:/bin:/usr/sbin:/sbin"
        /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3 .sdk -L/Users/greatzhi2001/Library/Developer/Xcode/DerivedData/PlaySound-anydnuuxbpx zlqfodwbuqqjwjzcd/Build/Products/Debug-iphonesimulator -F/Users/greatzhi2001/Library/Developer/Xcode/DerivedData/PlaySound-anydnuuxbpx zlqfodwbuqqjwjzcd/Build/Products/Debug-iphonesimulator "-F/Users/greatzhi2001/Desktop/iProjects/PlaySound" -filelist "/Users/greatzhi2001/Library/Developer/Xcode/DerivedData/PlaySound-anydnuuxbpxz lqfodwbuqqjwjzcd/Build/Intermediates/PlaySound.build/Debug-iphonesimulator/PlayS ound.build/Objects-normal/i386/PlaySound.LinkFileList" -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -framework UIKit -framework Foundation -framework CoreGraphics -o "/Users/greatzhi2001/Library/Developer/Xcode/DerivedData/PlaySound-anydnuuxbpxz lqfodwbuqqjwjzcd/Build/Products/Debug-iphonesimulator/PlaySound.app/PlaySound"
    Undefined symbols for architecture i386:
      "_OBJC_CLASS_$_AVAudioPlayer", referenced from:
          objc-class-ref in PlaySoundViewController.o
    ld: symbol(s) not found for architecture i386
    collect2: ld returned 1 exit status
    Is the framework AVFoundation I added wrong? Thanks.
    Regards,
    Taizhi

  • Sound file is not uploading to server

    I am trying to upload a sound file to my remote server and it is saying the following:
    Life_is_a_ Highway.mp3 - error occurred - An FTP error occurred - cannot put Life_is_a_ Highway.mp3.  Access denied.  The file may not exist, or there could be a permission problem.   Make sure you have proper authorization on the server and the server is properly configured.
    Does anyone know how to fix this?
    I have tried passive ftp and that doesn't help
    I have the underscores between the words in the file name
    I cant figure it out.
    Any help would be wonderful
    Thanks

    Can you upload a plain HTML file or JPG to your server?
    Have you tried using a 3rd party FTP app like Filezilla?
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb
    http://alt-web.blogspot.com/

  • What is the best way to integrate a sound file (mp3) into a PDF?

    I saw that its possible to do it by Tools->Multimedia->Sound. This works fine on a computer but not a tablet. So what is the right way to embed a sound file into a PDF of maybe by Indesign? What i want is that people can easily open a document (PDF) on a tablet and when they click on a (play)icon that they hear a sound file. The best thing is that they can stop or put it on pause.

    I think this functionality relies on Flash, so it's not likely it's going
    to work on mobile devices, certainly not on iOS ones.

  • D11.5 Projector gets stuck on encountering first sound file

    My projector runs fine on my PC (where I have D11.5) but when pack up all the files and try to play it from a new machine, the projector plays the opening screen and as soon as it has to make the first sound, it freezes. It seems as if it can not find the sound. I tried putting the sound file right next to the projector and even that does not work.
    My usual method is to call the sound  files with the path such as
    sound playfile 1, the moviepath & "sounds\"  & "playThisSound.aif"
    This works just fine on my machine. The projector does not hang up.
    Any ideas?

    You are using ancient and deprecated Lingo to play sounds. Try importing them into a castLib and use sound(channel).play() or a new mixer object (consult the docs)

  • Where to embed the Sound File, which will be accessible everywhere?

    Hello Again
    Im here with a stupid question.
    I have an application which has a component.
    Both have Buttons.
    Where should i embed the sound file which will be accessible
    in both places?
    second question is about embeding sound files in css. I know
    how to embed in <mx:script> tag, but couldnt find an example
    about css!
    Thanks in advance.

    Well best practice as to coding may influenced by the
    architecture in this case.
    It may be expedient if this sound file is a one time use and
    will only be in a component, to put it there and leave it.
    If it may be used by multiple components, then you could
    consider passing it as a var to each. However your component then
    is limited because it cannot be contained in a new component
    without the new component also exposing this variable to get the
    data down to its children. Thus the problem with passing data down
    a composition pattern. Add to that the need to get another variable
    to a component that is now deep in a composition pattern.
    So as I had mentioned a model containing this data might be a
    best practice in a MVC architecture.
    So I would say more information would be required for me to
    make a judgment as to best practice.

  • How to put sound in Application

    Hi guys,
    I am tryin to put sound in Java application but I can't figure out how to do that. It is totaly different than on JApplet.
    Can you guys tell the steps to put sound?
    Thank you

    Hi,
    He doesn not work i tried all the way but no compiling errors but it gives error when the sound need to be played.
    Here is my code
    private AudioClip clipEat;
    File fileEat = new File("SnakeGameApplication\\potato_c.wav");
    try {
                   AudioClip clipEat = Applet.newAudioClip(fileEat.toURL());
              } catch (IOException err) {
    clipEat.play();Cheers

  • Can I use a sound file on Pages?

    I want to create a picture book for kids to run on iPad and Iphone -- it will have a voiceover -- so the user can turn the voice on or off.
    Would Pages be a suitable program for this?
    Can I put a sound file in a Pages doc for this purpose?

    You can drag in any media into Pages, but be aware that it is only accessible in the .pages document itself.
    Why not have a look at iBook Author which is based on Pages and much more suitable for what you want?
    Peter

  • Can't open Safari - but can hear sound files when a link is selected

    I can't open Safari from either the desktop icon or through Finder. However, when I click on a web link, through an email I can hear the sound file.
    I have another Mac that can still access the internet (i.e what I'm on now) They are networked.
    How can I fix this? In the meantime could I put up another web browser to use? How do I do this though?

    Safari's preference file may be corrupt. In the Finder, drag to the desktop the com.apple.safari.plist folder found in your User Account>Library>Preferences folder.
    Restart Safari. If this works, you'll need to reset your custom preferences, plus any custom settings in the Edit (spelling) or View (status bar, bookmarks bar, custom icons etc.) menus.
    Otherwise, move the file back to its original location. The alternative would be to try Safari from another User Account. Here is guidance from Apple on how to set up the account. You can ignore step 7 in the article.
    Also, on the system preference>Accounts panel, click on "log-in" options. There, select "fast user switching". This allows you to go back and forth between user accounts via an icon in your Menu Bar at the top of the computer screen.
    Log-on to the new account and start Safari. If the sites are accessible in the new account, then your problem is specific to your regular user account. Otherwise, similar response means a system-wide problem.
    Post back with results.

Maybe you are looking for

  • How can I make my application as webservice

    Hi All, I'd like to know ,how can I make my application as webservice which has built on strut framework. with regards Babu H

  • FileLock is not working in Mac OS

    In my application, there is pause & resume functionality on the file download. To achieve this, we used java.nio.channels.FileLock to lock the file. It is working fine in Windows, not in Macintosh OS 10.8. We are using JRE 1.7 u 15 to run the applica

  • Bash prompt vs Zsh prompt problem [SOLVED]

    I have set up my .zshrc and it works perfectly function bat1() echo $(( $(awk ' /remaining/ {print $3} ' /proc/acpi/battery/BAT0/state) * 100 / 71590 )) # 71590 is the capacity of my #1 bat in mWh function bat2() echo $(( $(awk ' /remaining/ {print $

  • OS new install

    Hi I'm planning to move from XP to Windows 7 shortly. This implies a clean install of the OS. What effect will this have on Computer / eBook reader authorization ? Should I de-authorize before changing OS ? Thanks

  • Flex Compile Problems

    Hi, I'm getting a very strange error in my project that seemed to suddenly start happening out of nowhere. I was simply adding functions to a class and now whenever I compile I get the error: An internal build error has occurred. Right-click for more