Play audio file in Java

This is very cute example.
I want to do this: In JTextPane I have some audio files (.au) and what I want to do is that vhen I duble clicked to the file that this file will be opened in some program (like CoolEdit). And this program (with file, which is played) I want to insert to my application. If someone know how to do this, pleasse tell.
I know that with applet player can play audio file, but this is not good enough for me:)
Thanks a lot.

You can use some static methods in the Applet class to play AudioClips, but these only play short sound files. Try reading this thread to play long sound files:
http://forum.java.sun.com/thread.jspa?forumID=513&threadID=450768

Similar Messages

  • How to import and play audio files in java

    Hi, I'm pretty new to java and im trying to make an application that can import and play simple audio clips (mp3, wav, etc formats) when a button is clicked. If any one can help me it would be greatly appreciated.

    hi,
    i'm not a professional with java sound but it may be possible that you will find something good at this link:
    http://www.jsresources.org/examples/
    peace

  • I write a program to play audio file, it use sun.audio.*, but it can play

    i write a program to play audio file, it use sun.audio.*, but it can play ,can you tell me what error is it ?
    import sun.audio.*;
    import java.net.*;
    import java.io.*;
    import java.io.FileInputStream;
    public static void alertAudio(String fileName)
    try{
    InputStream in = new FileInputStream(fileName);
    AudioStream audio = new AudioStream(in);
    AudioPlayer.player.start(audio);
    catch(Exception e)
    System.out.println(e);
    public static void main (String argv[])
    String fileName = "test.au";
    alertAudio(fileName);
    System.out.println("close");

    help help me

  • Recording and playing audio files

    hi, is there a way by which one can record and play an audio file in java ?? I am doing a project in Voip but I can't find any help in this matter(actually i am a newbie in java ) .. can anyone please tell me how to proceed?
    Edited by: streetfi8er on Jun 28, 2009 2:47 AM

    >
    hi, is there a way by which one can record and play an audio file in java ?? I am doing a project in Voip but I can't find any help in this matter(actually i am a newbie in java ) .. can anyone please tell me how to proceed?>You could not find anything on ['java audio'|http://lmgtfy.com/?q=java+audio]? Where did you look, underneath the bed and in the back yard?
    Note that you might help dispel my impression that you are lazy, by applying the shift key once at the start of each sentence.

  • Play Audio File in application

    Hello all.
    Can anybody tell me how can I play some Audio File from my application?
    I think that it's impossible. (I can play Audio File only if i will use java.applet.AudioClip).
    I know that some classes in sun.*.*... can play Audio File.
    And I want to know why developers cann't make them easy of access.
    Thank you,
    Dmitry

    There are 2 ways you can play audio in an application. The of audio tools packaged with applets can be adapted to work in an application. Unfortunately, I do not know how to do this. I have had more success with sun.audio.*, but have been unable to find any documentation on it, which makes it very limiting.

  • Playing Audio Files in the Finder-any tips?

    Something I've been meaning to ask for ages... and hopefully an easy one to answer!
    When playing audio files in the Finder (in 10.5.8), it's really annoying when the file stops playing when you click on another window or application (or even just the Desktop). Is there any way around this?
    Someone recommended Snapper, but it's the same story - file stops playing when you click on any other area. Is this problem confined to Leopard (ie. has it been fixed in Snow Leopard?) - never used to be like this in Tiger.
    Some of us like to multi-task when listening to audio. The only solution I can see is importing the file into itunes. Any other suggestions?

    I assume you're talking about QuickLook?
    That's not the Finder, that's QuickLook.
    QuickLook is a function that can only work with the foremost selected item, and that makes sense, as you can, for example, QL a PDF within Mail.app, as well.
    Why not just use column view (doesn't everybody?) and play it in the Preview pane at the right?
    It will keep playing until you close the window or select another object within it.
    I use QuickLook when I want to give an audio file a quick once-over - skip here and there, but for actually playing it through, I use the column view preview.
    Message was edited by: spheric

  • TS1717 I can play audio files in iTunes but I can't play downloaded tv shows or movies.  Everytime I attempt to play them, iTunes stops working and closes.

    I can play audio files in iTunes but I can't play downloaded tv shows or movies.  Everytime I try to play them, iTunes stops working and closes.  Any information will help.

    Is QuickTime installed? If not it might help to install it.
    If so is Direct3D Video Acceleration enabled? If so it might help to disable.
    tt2

  • Playing audio file while Downloading

    Hello all,
    Can anyone give me an idea on how can I play audio file while downloading.
    Thanks

    Connect the external drive and then launch Disk Utility found in Applications/Utilities. Your external drive while show up in Disk Utility's side bar. It should be Mac OS Extended or OS Extended (Journaled).
    If it isn't:
    Then select it and click the 'Erase tab' at the top.
    Select Mac OS Extended-Journaled formatting from the Volume Format menu.
    Then click the oval Erase button at the lower right. Just remember-this will erase the drive!
    http://danslagle.com/mac/iMovie/usage/5006.shtml
    Sue

  • The audo files do not play from websites instead ask for download. This has occured from the time I have updated Firefox 4 to Firefox 5. Why? And how can i play audio files?

    The audo files do not play from websites instead ask for download. This has occured from the time I have updated Firefox 4 to Firefox 5. Why? And how can i play audio files from websites?

    You have a <b>general.useragent.override</b> pref that identifies you as Firefox/3.5.7
    *Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7 (.NET CLR 3.5.30729)
    See:
    *https://support.mozilla.com/kb/Websites+or+add-ons+incorrectly+report+incompatible+browser
    *http://kb.mozillazine.org/Resetting_your_useragent_string_to_its_compiled-in_default

  • Can anybody explain me how to sample and play audio files with logic's EXS2

    can anybody explain me how to sample and play audio files with logic's EXS24 Sampler???
    i cant find a way to upload and manage my own audio content on this sampler...

    i uderstand , thanx...
    i managed to open an audio file and placed it in the sampler,i can play t sample in the little keyboard in the zones section, howver i dont know how to play it with my controller... the sample shows in C1 on logic's keyboard but if i play C1 on my controller nothing happens... how can i fix this?
    Also, i noticed the sample plays from beginning to end once i click on it, how do i do to just make it last until i release the key? like a logic sound??? (in case i want to play a small portion of the sample only)
    Thanx

  • Play audio files in Bridge CS6

    Hi,
    I used to be able to play audio files created with my Mk4 right in the preview window in CS4 which was easy for renaming files after their description was recorded when taking the shot.
    Does anyone know how I can do this in CS 6 - there are no play/pause controls under the preview like there was in CS4.
    Thanks Heaps for any help.

    Hi ,
    yes , MK4 and .wav files
    I have Mac 10.7.5 & Bridge CS6
    I have selected "Play audio files automaticly when selected" in the preferences but it doesnt do it.
    In previous versions of bridge you could get a play and pause buttons below the .wav icon view in the preview
    but this doesnt happen.
    It is really inconveinent as it defeats the purpose of having the .wav file and the I have to go back to Bridge CS4 to play the files.
    Thanks

  • I am having trouble with my speakers not working while online in particular on windows.My audio works when playing audio files

    I am having trouble with my speakers not working while online particular on facebook. My audio works when playing audio files.

    Hi,
    Did it happen all the time or sometime?
    Please check online browser status:
    Click Volume icon in the taskbar, click Mixer link button as below:
    If it's fine, follow this guide to run troubleshooter to detect and fix the issue:
    Tips for fixing common sound problems
    http://windows.microsoft.com/en-in/windows/tips-fixing-common-sound-problems#tips-fixing-common-sound-problems=windows-7
    Meanwhile, this similar thread also could be referred:
    https://social.technet.microsoft.com/forums/ie/en-US/a4a1cfe5-93a5-4c0b-9bf6-f7db0304f2ba/no-sound-on-youtube-or-any-other-webpage
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • IOS 6.0.1 Safari won't play audio files. Error: "Cannot play audio file."

    I recently updated my iPad to iOS 6.0.1, now Safari won't play audio files in any format. Error: "Cannot play audio file." Previously, it worked fine. I tried downloading and using GoogleChrome and Opera Mini, and these also won't play audio. What's up??

    Solved the problem. It seems that once iOS 6.0.1 installed, it caused all of my browsers to mishandle audio files. When I reset the iPad, that cleared up the problem.
    Before upgrading to iOS 6, my browsers would "autoplay" the sound files. After iOS 6, "autoplay" is disabled so you have to manually click play to play them.
    Nonetheless, everything is working fine again except for "autoplay," which I can live with.

  • Downloading images and audio file using java

    Dear All
    I have a directory on my webserver which contains images,audio files and many other data files.
    I want to download all the file but the problem is when i download image and save it, it is not viewable. I dont want to use Image class as i may have to downlaod audio files too. Please guis which stream shouldi open to download any kind of content using same code.
    Thanks in advance. And if u have some example please let me know
    Regards
    Jafery

    downloading images and audio file using java -------------------------------
    how to write it back to dataoutputstremI don't understand what you are talking about.
    Server: DataOutputStream -> Client: DataInputStream -- the two is a pair.

  • Play Audio Files in Pro7

    I loaded QT Pro 7 in Win2K and I can't play audio files. The progress pointer slides across but no audio and no indication on the little bar graphic thingy.
    Is it the file association? The sound card seems to be set up properly.
    Thanks,
    Bill

    Safe Mode,Wave out only should release so it could be a indication of the problem.
    If you go to C:\Documents and Settings\All users\Application Data\Apple Computer\Quicktime, Quicktime qtp is the file for QT preferences. If you delete Quicktime qtp a new one will be created when you run QT again.
    It will also be removing your Pro Key registration, so you'll want to have that before deleting qtp so you'll be able to re-enter it to get your Pro features back.
    Give it a try, if it don't solve the audio, I can suggest a few more things to try within the XP OS that relate to audio.

Maybe you are looking for

  • Universal Adapter for CRM

    Dear All, I am involved in a case recently that need to use Universal Adapter for CRM Analytics to extract data from a 3rd-party CRM system. The subject area is Consumer Sector - Performance. According to BI Apps Installation and Configuration Guide,

  • Business Package for Assets 50.3.1:  Error in Source. Message not available

    Hi Just deployed the Business Package for Assets 50.3.1 on Portal version 7 with SP8, when running the Assets detail, my assets iviews always display:  "Error in Source. Message not available." even all other iviews on the same page still work as exp

  • How do I get my Adobe Digital book read out loud.

    I am disabled and need to use text to speech. I purchased an ebook which is an Adobe Digital Edition. I have really enjoyed using Adobe Reader with the Read Out Loud feature and was shocked when I discovered I could not use this feature on the Digita

  • Default documents

    I was wondering if someone knows a way of creating new documents to be listed in the list of default documents when you open the new document window. What I would like to do is create 3 files to add to the list. I am using coldfusion and want use <cf

  • .msi files

    Hi, i was wondering if anyone could help?! I am new to Mac and am trying to open a .msi file. Does anyone have any links to any dwonloads were i can open this file? It is driving me mad!! Thanks Emma