Play audio file with jmf on linux?

a simple audio player as flow:
import javax.media.*;
import java.io.File;
import java.net.URL;
public class SimpleAudioPlayer {
    private Player audioPlayer = null;
    public SimpleAudioPlayer(URL url) throws Exception {
        audioPlayer = Manager.createRealizedPlayer(url);
    public SimpleAudioPlayer(File file) throws Exception {
        this(file.toURL());
    public void play() {
        audioPlayer.start();
    public void stop() {
        audioPlayer.close();
    public static void main(String[] args) throws Exception {
        File file = new File("/usr/local/download/1.wav");
        SimpleAudioPlayer sap = new SimpleAudioPlayer(file);
        sap.play();
}when run the program
javac -cp jmf.jar SimpleAudioPlayer.java
java -cp .:jmf.jar SimpleAudioPlayer
the output as flow:
Unable to handle format: ima4/ms, 8000.0 Hz, 4-bit, Mono, Unsigned, 4027.0 frame rate, FrameSize=4096 bits
Failed to prefetch: com.sun.media.PlaybackEngine@defa1a
Error: Unable to prefetch com.sun.media.PlaybackEngine@defa1a
How can I play wav file with jmf on linux?(OS is debian5 and jmf cross-platform pack)

thanks for your reply.
I tried to replace the wav file "1.wav" with the linear encoded WAV download from pscode.org,and run the code again,but
BasicTrackControl:prefetchTrack():96 1 bm = com.sun.media.BasicRendererModule@1186fab
BasicRendererModule.doPrefetch:155 Render : true
Render buffer size: 32768
BasicRenderModule.doPrefetch:159
javax.media.ResourceUnavailableException: Cannot intialize audio device for playback
at com.sun.media.renderer.audio.JavaSoundRenderer.open(JavaSoundRenderer.java:93)
at com.sun.media.BasicRendererModule.doPrefetch(BasicRendererModule.java:158)
at com.sun.media.BasicTrackControl.prefetchTrack(BasicTrackControl.java:99)
at com.sun.media.PlaybackEngine.doPrefetch1(PlaybackEngine.java:682)
at com.sun.media.PlaybackEngine.doPrefetch(PlaybackEngine.java:658)
at com.sun.media.PrefetchWorkThread.process(BasicController.java:1430)
!!!!!!!§§§§§§§§§§§ BasicTrackControl:prefetchTrack():96
at com.sun.media.StateTransitionWorkThread.run(BasicController.java:1339)
Unable to handle format: LINEAR, 16000.0 Hz, 16-bit, Mono, LittleEndian, Signed, 32000.0 frame rate, FrameSize=16 bits
Failed to prefetch: com.sun.media.PlaybackEngine@26e431
Error: Unable to prefetch com.sun.media.PlaybackEngine@26e431

Similar Messages

  • 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 sdp file with JMF

    Hi,
    I have a Darwin Streaming Server(DSS) running on a machine, that reflects several broadcasts from other machines (I'm broadcasting to the DSS with JMF).
    I can see all the videos and audio without any problem with Quick Time, but I can't find a way to play the sdp files with jmf. I've searched the web for jmf and sdp, and there isn't much information, i've also tried to play with JMStudio..no luck. In the JMF solution there aren't any samples for SDP files....
    If I can't find a way to do it, I'll use Quick Qime 4 Java, the only problem is that there isn't a linux implementation :(
    Thanks in advance.
    Best regards,
    ANeto

    Hi,
    I have read all the mails on the JMF interest group regarding the Broadcaster and DSS.
    Well i too am trying to do a similar application. This is an Application
    Casting program basically to share my desktop with the other person sitting
    across the network using my client. And in order to multicast this, i am
    looking at using Darwin Streamng Server.
    The whole idea here is that i break the desktop image up into frames and
    then compress them and then send it over, protocol used here is TCP/RTP/UDP.
    I am trying to hit this stream of packets to DSS so that it can be accessed
    else where over the internet. I'm trying to under stand the basic
    authentication mechanism DSS uses, so that i can create the .sdp file and
    transfer it over to the DSS, which can further be accessed by any client
    that can understands sdp.
    As i read in the mail some of you were able to create the .sdp file with your custom built boradcaster and send it to DSS if i am not wrong.
    I have tried this with Mpegable Broad caster as you said.
    Now the problem i had was to create .sdp file with my application and push it to the DSS.
    So have you made some kind of a documentation or can you give me an idea as
    to how i can go about this. Or it will be even better if you can share the code with me.

  • Play .3gp-files with JMF (jffmpeg)

    Hello,
    for a MMS-Application I'm trying to show 3gp-files with Java. I heard that it should work with jffmpeg but I still couldn't get it to work.
    I added the Codec:
    String JFFMPEG_VIDEO = "net.sourceforge.jffmpeg.VideoDecoder";
    try {
        Codec video = (Codec) Class.forName(JFFMPEG_VIDEO).newInstance();
        PlugInManager.addPlugIn(JFFMPEG_VIDEO,
                video.getSupportedInputFormats(),
                video.getSupportedOutputFormats(null),
                PlugInManager.CODEC);
    } catch (Exception e) {
        e.printStackTrace();
    }and then started the player.
    It already works for mpg-Videos, but if the file-extension is .3gp the player throws a javax.media.NoPlayerException: Cannot find a Player for : file://C:/test.3gp
    When I change the file-name to test.mpg the player initializes but doen't show a picture.
    How can I register the 3gp-extension? Or is anything else missing?
    Thanks in advance for any hint :-)

    I still didn't get it to work as I need it, but I made some progress so far:
    Instead of jffmpeg I used the FOBS for JMF Package (http://fobs.sourceforge.net/index.html) in addition with the JMF.
    Using this package allows you to play a 3gp-Video in Swing that is stored in your filesystem (!).
    I'm still having two problems with this solution:
    - I use a Java Webstart-framework and can't acces the user's harddisk, so I need to play the 3gp-Videos directly from memory (they are stored as byte[] in a database), but the current version of FOBS is limited to 3gp-Playback only from filesystem.
    - Each user of the application has to download and install JMF and FOBS for their OS (system-specific libraries). Especially FOBS is not always very easy to install, because it needs to change some of the jmf.properites. This can not be done with the JAR-distribution-System of WebStart and I'm expecting problems, when the users try to install both packages on their own.
    If you are developing a plain Swing-Application you might be satisfied with the possibilities of FOBS and JMF.
    Good luck :-)

  • Play rtpdump files with jmf

    hello,
    I am trying to play a file created with rtpdump (or etheral) directly with jmf. I don�t know, how to create valid datasource and processor objects for a file with stored rtp-packets. Is there a possibility? Do I have to write an own demultiplexer f�r this rtp-dump format? Especially this RTP packets uses the H.263 format.
    Maybe there exists a code fragment for this problem.
    thanks a lot for your help

    I still didn't get it to work as I need it, but I made some progress so far:
    Instead of jffmpeg I used the FOBS for JMF Package (http://fobs.sourceforge.net/index.html) in addition with the JMF.
    Using this package allows you to play a 3gp-Video in Swing that is stored in your filesystem (!).
    I'm still having two problems with this solution:
    - I use a Java Webstart-framework and can't acces the user's harddisk, so I need to play the 3gp-Videos directly from memory (they are stored as byte[] in a database), but the current version of FOBS is limited to 3gp-Playback only from filesystem.
    - Each user of the application has to download and install JMF and FOBS for their OS (system-specific libraries). Especially FOBS is not always very easy to install, because it needs to change some of the jmf.properites. This can not be done with the JAR-distribution-System of WebStart and I'm expecting problems, when the users try to install both packages on their own.
    If you are developing a plain Swing-Application you might be satisfied with the possibilities of FOBS and JMF.
    Good luck :-)

  • Play audio files with cool buttons

    I want to create an embedded audio file as a swf file. On the
    page, you would see a series of stop, start, and volume buttons. I
    want to be able to add my own buttons that I create in Photoshop as
    the player buttons. I have the buttons, I have the mp3 file as well
    as the swf file. How do I create one of those cool players that you
    see on websites with audio?

    Lloyd already mentioned mediaelement.
    There's also soundplayer which is wav only
    https://msdn.microsoft.com/en-us/library/system.media.soundplayer%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396
    You don't need storyboards at all.
    You could play sounds using triggers or code.
    http://www.wpf-tutorial.com/audio-video/playing-audio/
    https://msdn.microsoft.com/en-us/library/ms752338(v=vs.110).aspx
    I think I mentioned this previously.
    I recommend you use visual studio to develop routinely and blend only rarely.
    Hope that helps.
    Recent Technet articles: Property List Editing;
    Dynamic XAML

  • 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]

  • Can CDHtmlDialog play swf file with audio component?

    Hello, I'm using CDHtmlDialog in our application to play swf that shows user how to do a workflow. It works fine if swf does NOT have audio; if the swf has audio component, then it does not play.
    Can CDHtmlDialog play swf with audio?
    If not, any suggestion on how to implement playing swf file with audio?
    Many thanks in davance.

    Hi PingHu,
    How do you play the swf file in a html. I tried play a swf file with audio in my CDHtmlDialog class. I just use this:
    Html code Play the SWF file.
    <!DOCTYPE html>
    <html>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <body>
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="200" height="100">
    <param name="movie" value="filename.swf">
    <param name="wmode" value="transparent">
    <embed src="D:\html directory\swf filename.swf" width="400" height="500" type="application/x-shockwave-flash" />
    </object>
    </body>
    </html>
    Then my sample is able to play a SWF file with audio. Hope this helps some.
    Best regards,
    Shu Hu
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Just upgraded an iMac with 4GB Memory and Intel Processor from 10.6.8 to Mavericks and Quicktime plays m4v files with stuttering audio

    I just upgraded an iMac with 4GB Memory and 3.33 Ghz  Intel Core Duo Processor from 10.6.8 to Mavericks.  I now have Quicktime 10.3 which plays m4v files with stuttering audio.  This is a nightmare as I use Quicktime a lot in my research.  I have seen similar threads but so far only reporting the problem.  For now I have installed Quicktime Player 10.7 (which appears in utilities, leaving Quicktime 10.3 in the main applications list) which plays the same videos with no problem, but it would be good to know if anyone has managed to find a workaround at all, or know if Apple have plans to do anything about it?

    Slow performance after installing Yosemite on an older Mac is often caused by inadequate memory. Although you can install the upgrade on a Mac with 2 GB of memory, experience has shown that at least 4 GB is needed for full performance.
    Select About This Mac from the Apple menu. If you have less than 4 GB of memory, and your model has upgradable memory, install as much as it can take, or at least that much. Any reputable RAM vendor will have a web form in which you can select the Mac model and be directed to compatible parts.

  • 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

  • Work flow for syncing separate Audio files with Video files in FCP

    It may be too late for me to use this workflow that I want with my current project, but I need to figure out what it is anyway for future reference.
    Right now I'm editing a movie which is near completion. When we recorded the movie, the camera's deck recorded reference audio from the sound guy at 48k @ 16bit. This audio also went through an additional set of preamps which added a small amount of noise. So we don't want to use the reference audio because of it's low resolution and less clean audio. The sound guy recorded straight to his deck at 48k @ 24bit, besides the better resolution, his audio is noticeably better.
    The camera deck and 'clapper' (I think that's what you call it) were not connected or synced. So the video files and the soundsguy's audio files are slightly different lengths, but at least have a 'clap sound' to manually sync to. And I don't mean that the audio and video files won't play in sync with each other, I mean that the soundguy always started recording before the camera, so his audio files have slightly different start and stop times.
    Could I have synced the audio files with the video files before I started editing this project? If so, could it have been in the way that the soundguy's audio would be connected to my video files while editing? What would that procedure have been?
    My current workflow right now is I have my finished sequence, I change the bit rate to 24 in Sequence Settings, and start manually dragging the soundguy's files to the sequence for every little edited clip. This is going to take forever, there are 99 scenes in this movie. Anyway, at the end of the day these sequences are exported as .omf files and imported into Pro Tools for audio post production.
    I was not thinking to figure this out before I started editing the movie, this is unfortunate, a newb move in a decent production.
    Anyway, I don't know if there is a standard for this situation or if I just opened up a can of worms for many possible workflows. Please comment if you have experience in this area or please refer me to any reading material.
    Thanks for your time!
    -Monty

    The normal workflow (besides manually syncing up before editing!)
    is to have ' some ' way of auto syncing the clips.
    So you must have common timecode.
    With external audio, you can slave the cam's TC to the TC output of the BWF recorder.
    Then you can use BWF / QT merge (one of my apps) to sync them, or use Sync 'n Link.
    (another third party application)
    If it is not possible cause you're shooting with a cam without a TC input, you can record the TC output on one of the audio tracks of your cam, and use FCPauxTC reader to decode the beeps and translate that to QT TC, and again use the former tricks to sync them.
    It is difficult when you have never done it, but very easy once you get the hang of it, and it saves a huge amount of time to do it right from the start.
    Have a look at the FCP aux TC reader here:
    http://www.videotoolshed.com/?page=products&pID=26
    Sync 'n Link can be found here:
    http://www.assistedediting.com/Sync-N-Link/
    /// disclaimer, i AM the owner of Videotoolshed, and i WILL (at least try) to make money on it. ///
    /// i do NOT have any relation with AssistedEditing.com, besides friendship with the owner. ///

  • Amarok 1.4.10 from AUR plays flac files with errors

    amarok 1.4.10 from AUR plays flac files with errors and i mean that it plays flac files but with strange behavior and of course the result is awful is there any chance to fix that problem. i have compile it with xine engine, can i use a different engine in PKGBUILD and how. i should write that i don't known much from configure a PKGBUILD by my own. with exaile and totem i have no problem i also play flacs with 24bit and 96khz audio quality. tnks for your time

    Why not amarok 2.3 from extra?
    Found this but its for 2.3: forum.kde.org/viewtopic.php?f=116&t=85428
    looks like amarok just uses xine, which I don't know much about...
    the 2.3 version depends on kde4, so you can run kde4 system settings and switch the multimedia backend between xine, mplayer, and gstreamer (need the aur packages first). I know mplayer should use ffmpeg to playback though.
    Edit: looks like exaile and totem use gstreamer for playback
    Last edited by 1LordAnubis (2010-05-19 16:19:09)

  • 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

  • How to export all tracks into audio files with the same duration

    Hi everybody.
    I am trying to export all the tracks into different audio files.
    It's 10 soft. instruments and an audio track. I tried with "File>Export>All Tracks as Audio File but the result is 11 audio files with different lengths. As the song is 3 minutes and 20 seconds I would like every single track to be 3.22 sec long.
    How do I do it? In fact, each track is composed not only by played instruments but also by moments of silence.
    Thanks!!
    Alessandro

    sambino wrote:
    I tried with "File>Export>All Tracks as Audio File but the result is 11 audio files with different lengths. As the song is 3 minutes and 20 seconds I would like every single track to be 3.22 sec long.
    The files are different lengths because each instrument does not stop playing at the same moment. It would accomplish nothing other than waste disk space if Logic appended silence to the end of each file in order to make each track the same length. The different lengths you see mean nothing because the absence of appended silence means nothing.
    each track is composed not only by played instruments but also by moments of silence.
    Naturally. And that silence is accounted for in your exported files, when the silence appears at the beginning of the track, and when it appears during the track. It just isn't appended at the end because that would be pointless. Consider this project, consisting of four tracks:
    When I use the command File > Export > All Tracks as Audio Files, Logic will produce four files that look like this:
    The files are not equal in length, which is perfectly fine. What's important is that they all start at bar 1, and will align properly when imported into some other program. So all you need is the command you already used: File > Export > All Tracks as Audio Files. In one step, it will produce all the files you need, and it will produce them correctly.
    By using Bounce, you would be gaining nothing except extra work, because you would have to do it separately for each file you wanted to produce. With Export > All Tracks as Audio Files, you get all your files with just one command.
    iSchwartz wrote:
    exporting tracks means that any panning or automation will not be rendered. So if you want the engineer to put up all of your tracks at unity gain (all faders at zero) and have your tracks & stems reproduce the mix you're hearing at your studio, use bounce, not export.
    If you want to have your tracks & stems reproduce the mix you're hearing at your studio, there's no need to go to the extra effort of using Bounce instead of Export. You only need to enable (in the Export dialog) the checkbox "Include Volume/Pan Automation." This is explained on p. 1022. When you do this, any panning or automation will indeed be rendered.

  • 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.

Maybe you are looking for

  • To show the 2nd part highlighted there only once on each page

    Hi, Could you pls see this for the problem? http://www.4shared.com/document/VExaTDlv/t31.html Regards, edward

  • Have to constantly wait for spinning wheel to stop when browsing

    I would appreciate some advice on how to change things to stop the spinning wheel being a hindrance to web browsing and moving between different applications. Thanks, Ptal Imac G4   Mac OS X (10.3.9)   HP printer, Ipod dock, Apple speakers

  • Tag does not evaluate expression

    Here is the tag I am using: <lst:select name="country" table="country" column="name" key="id" selected="<%= rsNetwork.getString("country_id") %>" /> The selected attribute does not return the value of "country_id" instead it results the entire expres

  • Show "invisible chars" in JTextPane

    Hi all. I want to show "invisible" chars (like spaces, line feeds, tabulators) in a JTextPane. Someone have already solve this, maybe in a more easy way than the one i found (see below)? I try solve this setting some specific (static) ImageIcon as "s

  • Demo setup

    Hi I need a demo setup for below scenarios, long running query with troubleshoot method Temp db full log/disk full high cpu cases