Playing the audio file from the point of mark

Hi All, i want to play a audio file from the point of mark.
i have used mark() method to mark but when i play the audio it is still playing the audio from the starting point. please help me.

Hi,
Question:
1. You have a folder for each DVD whose video contents you edited.
Answer: Yes
Question:
You talk about projects 34, 35, 36, 37. Are these projects associated with only one specific DVD?
What is supposed to be in each project - just edited VTS_01_1.VOB or edits from the others in the series
such as VTS_01_2.VOB, VTS_01_3.VOB, etc.
Answer:
Project 34 has edited Premiere Elements file 34 and the VOB files (VST_01_1.VOB, VTS_01_2.VOB, etc) from DVD#34
Project 35 has edited Premiere Elements file 35 and the VOB files (VST_01_1.VOB, VTS_01_2.VOB, etc) from DVD#35
Project 36 has edited Premiere Elements file 36 and the VOB files (VST_01_1.VOB, VTS_01_2.VOB, etc) from DVD#36
etc.
Question:
2. If you screen each DVD video file VOB for a given DVD disc, does the content follow sequentially and cleanly?
Answer:
Yes
When I run the VST_01_1.VOB, VTS_01_2.VOB, etc from each project the audio and the video are clean and match.
When I run the edited Premiere Elements file that were created after project 34 edited Premiere Elements file project 35, 36, 37 etc. I am getting the audio from project 34
When I run the edited Premiere Elements file that were created  before project 34 edited Premiere Elements file project 1, 2, all the way to 33. I am getting the correct audio
Thanks,
Ron

Similar Messages

  • Playing an audio file from applet

    Hi friends,
    I have a problem to be solved .
    Please help me.
    I have to play an audio file from applet.When the applet loads it shold start playing .There is a progress bar in the applet it shold alsomove corresponding to that.
    How can i do that.Give me an idea.
    I know nothing about jmf.
    I am using j2sdk1.4,windows 2000 server.

    Andrew,
    Forgive my naivety, but i struggle with JAVA! I am desperately trying to create a JAVA plugin to SERVOY and have to date been successful with a few things. Record, Playback, convert to .spx.
    I am really struggling with implementing a rewind and fastforward function of the type you have. I thought it would be easy, but it appears not.
    At the bottom is the complete code from my class that is called by the servoy plugin wrapper,
    i had thought that adding some simple jump 500 ms would have been easy in something like this:
    public AudioStream js_FastForward (AudioStream as) throws IOException {
    !!! Line or two here to move the play head forward !!!
         AudioPlayer.player.start(as);
         return as;
    Can you give me any pointers to how i code that fast forward bit.
    many thanks
    David
    package com.d2e.MyPlugin;
    import com.servoy.j2db.scripting.IScriptObject;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.awt.Button;
    import javax.sound.sampled.*;
    import org.xiph.speex.*;
    import org.xiph.speex.spi.*;
    import  sun.audio.*;    //import the sun.audio package
    public class MyPluginProvider implements IScriptObject  {
          public void JSencode()
             throws IOException{
               /** Version of the Speex Encoder */
                final String VERSION = "Java Speex Command Line Encoder v0.9.7 ($Revision: 1.5 $)";
                /** Copyright display String */
                final String COPYRIGHT = "Copyright (C) 2002-2004 Wimba S.A.";
                /** Print level for messages : Print debug information */
                final int DEBUG = 0;
                /** Print level for messages : Print basic information */
                final int INFO  = 1;
                /** Print level for messages : Print only warnings and errors */
                final int WARN  = 2;
                /** Print level for messages : Print only errors */
                final int ERROR = 3;
                int printlevel = INFO;
                /** File format for input or output audio file: Raw */
                final int FILE_FORMAT_RAW  = 0;
                /** File format for input or output audio file: Ogg */
                final int FILE_FORMAT_OGG  = 1;
                /** File format for input or output audio file: Wave */
                final int FILE_FORMAT_WAVE = 2;
                int srcFormat  = FILE_FORMAT_OGG;
                int destFormat = FILE_FORMAT_WAVE;
                int mode       = -1;
                int quality    = 4;
                /** Defines the encoders algorithmic complexity. */
                 int complexity = 3;
                /** Defines the number of frames per speex packet. */
                 int nframes    = 1;
                /** Defines the desired bitrate for the encoded audio. */
                 int bitrate    = -1;
                /** Defines the sampling rate of the audio input. */
                 int sampleRate = -1;
                /** Defines the number of channels of the audio input (1=mono, 2=stereo). */
                 int channels   = 1;
                /** Defines the encoder VBR quality setting (float from 0 to 10). */
                 float vbr_quality = -1;
                /** Defines whether or not to use VBR (Variable Bit Rate). */
                 boolean vbr    = false;
                /** Defines whether or not to use VAD (Voice Activity Detection). */
                 boolean vad    = false;
                /** Defines whether or not to use DTX (Discontinuous Transmission). */
                 boolean dtx    = false;
              //HArd code src format and dest
               // private String srcPath ="junk.wav";
              srcFormat = FILE_FORMAT_WAVE;
              destFormat = FILE_FORMAT_OGG;
              //destPath="junk.spx";
             byte[] temp    = new byte[2560]; // stereo UWB requires one to read 2560b
             final int HEADERSIZE = 8;
             final String RIFF      = "RIFF";
             final String WAVE      = "WAVE";
             final String FORMAT    = "fmt ";
             final String DATA      = "data";
             final int WAVE_FORMAT_PCM = 0x0001;
             // Open the input stream
             DataInputStream dis = new DataInputStream(new FileInputStream("junk.wav"));
             // Prepare input stream
           //DP - Sort out the Wave File
               // read the WAVE header
               dis.readFully(temp, 0, HEADERSIZE+4);
               // Read other header chunks
               dis.readFully(temp, 0, HEADERSIZE);
               String chunk = new String(temp, 0, 4);
               int size = readInt(temp, 4);
               while (!chunk.equals(DATA)) {
                 dis.readFully(temp, 0, size);
                 if (chunk.equals(FORMAT)) {
                   typedef struct waveformat_extended_tag {
                   WORD wFormatTag; // format type
                   WORD nChannels; // number of channels (i.e. mono, stereo...)
                   DWORD nSamplesPerSec; // sample rate
                   DWORD nAvgBytesPerSec; // for buffer estimation
                   WORD nBlockAlign; // block size of data
                   WORD wBitsPerSample; // Number of bits per sample of mono data
                   WORD cbSize; // The count in bytes of the extra size
                   } WAVEFORMATEX;
                   if (readShort(temp, 0) != WAVE_FORMAT_PCM) {
                     System.err.println("Not a PCM file");
                     return;
                   channels = readShort(temp, 2);
                   sampleRate = readInt(temp, 4);
                   if (readShort(temp, 14) != 16) {
                     System.err.println("Not a 16 bit file " + readShort(temp, 18));
                     return;
                   // Display audio info
                   if (printlevel <= DEBUG) {
                     System.out.println("File Format: PCM wave");
                     System.out.println("Sample Rate: " + sampleRate);
                     System.out.println("Channels: " + channels);
                 dis.readFully(temp, 0, HEADERSIZE);
                 chunk = new String(temp, 0, 4);
                 size = readInt(temp, 4);
               if (printlevel <= DEBUG) System.out.println("Data size: " + size);
           //DP ENd sort wave file 
           //Now Choose the mode , we have a file sampled at 44100
                 mode = 2; // Ultra-wideband
             // Construct a new encoder
             SpeexEncoder speexEncoder = new SpeexEncoder();
             speexEncoder.init(mode, quality, sampleRate, channels);
             if (complexity > 0) {
               speexEncoder.getEncoder().setComplexity(complexity);
             if (bitrate > 0) {
               speexEncoder.getEncoder().setBitRate(bitrate);
             if (vbr) {
               speexEncoder.getEncoder().setVbr(vbr);
               if (vbr_quality > 0) {
                 speexEncoder.getEncoder().setVbrQuality(vbr_quality);
             if (vad) {
               speexEncoder.getEncoder().setVad(vad);
             if (dtx) {
               speexEncoder.getEncoder().setDtx(dtx);
             // Display info
             // Open the file writer
             AudioFileWriter writer;
             if (destFormat == FILE_FORMAT_OGG) {
               writer = new OggSpeexWriter(mode, sampleRate, channels, nframes, vbr);
             else if (destFormat == FILE_FORMAT_WAVE) {
               nframes = PcmWaveWriter.WAVE_FRAME_SIZES[mode-1][channels-1][quality];
               writer = new PcmWaveWriter(mode, quality, sampleRate, channels, nframes, vbr);
             else {
               writer = new RawWriter();
             writer.open("junk.spx");
             writer.writeHeader("Encoded with: " + VERSION);
             int pcmPacketSize = 2 * channels * speexEncoder.getFrameSize();
             try {
               // read until we get to EOF
               while (true) {
                 dis.readFully(temp, 0, nframes*pcmPacketSize);
                 for (int i=0; i<nframes; i++)
                   speexEncoder.processData(temp, i*pcmPacketSize, pcmPacketSize);
                 int encsize = speexEncoder.getProcessedData(temp, 0);
                 if (encsize > 0) {
                   writer.writePacket(temp, 0, encsize);
             catch (EOFException e) {}
             writer.close();
             dis.close();
            * Converts Little Endian (Windows) bytes to an int (Java uses Big Endian).
            * @param data the data to read.
            * @param offset the offset from which to start reading.
            * @return the integer value of the reassembled bytes.
           protected static int readInt(final byte[] data, final int offset)
             return (data[offset] & 0xff) |
                    ((data[offset+1] & 0xff) <<  8) |
                    ((data[offset+2] & 0xff) << 16) |
                    (data[offset+3] << 24); // no 0xff on the last one to keep the sign
            * Converts Little Endian (Windows) bytes to an short (Java uses Big Endian).
            * @param data the data to read.
            * @param offset the offset from which to start reading.
            * @return the integer value of the reassembled bytes.
           protected static int readShort(final byte[] data, final int offset)
             return (data[offset] & 0xff) |
                    (data[offset+1] << 8); // no 0xff on the last one to keep the sign
         AudioFormat audioFormat;
           TargetDataLine targetDataLine;
         public Class[] getAllReturnedTypes() {
              // TODO Auto-generated method stub
              return null;
         public String[] getParameterNames(String arg0) {
              // TODO Auto-generated method stub
              return null;
         public String getSample(String arg0) {
              // TODO Auto-generated method stub
              return null;
         public String getToolTip(String arg0) {
              // TODO Auto-generated method stub
              return null;
         public boolean isDeprecated(String arg0) {
              // TODO Auto-generated method stub
              return false;
         public String js_Record (String name){
              captureAudio();
              return "Started Recording " +name;
        public String js_StopRecord (String name) throws IOException{
             //new ActionListener(){
             //   public void actionPerformed(ActionEvent e)
                  //Terminate the capturing of input data
                  // from the microphone.
                  targetDataLine.stop();
                  targetDataLine.close();
              //  }//end actionPerformed
             //};//end ActionListener
                 // JSpeexEnc ("junk.wav","output.spx");
                  JSencode();
              return "Stop Records " +name;
        //Play audio file
        public AudioStream js_Playback (String name) throws IOException{
             InputStream in = new FileInputStream("junk.wav");
             AudioStream as = new AudioStream(in);        
             AudioPlayer.player.start(as);           
             return as;
        public AudioStream js_ContPlay (AudioStream as) throws IOException {
             AudioPlayer.player.start(as);           
             return as;
         //Stop Play
        public AudioStream js_Stop_Playback (AudioStream as) throws IOException{
             AudioPlayer.player.stop(as);
              return as;
         //This method captures audio input from a
        // microphone and saves it in an audio file.
        private void captureAudio(){
          try{
            //Get things set up for capture
            audioFormat = getAudioFormat();
            DataLine.Info dataLineInfo =
                                new DataLine.Info(
                                  TargetDataLine.class,
                                  audioFormat);
            targetDataLine = (TargetDataLine)
                     AudioSystem.getLine(dataLineInfo);
            //Create a thread to capture the microphone
            // data into an audio file and start the
            // thread running.  It will run until the
            // Stop button is clicked.  This method
            // will return after starting the thread.
            new CaptureThread().start();
          }catch (Exception e) {
            e.printStackTrace();
            System.exit(0);
          }//end catch
        }//end captureAudio method  
    //  This method creates and returns an
        // AudioFormat object for a given set of format
        // parameters.  If these parameters don't work
        // well for you, try some of the other
        // allowable parameter values, which are shown
        // in comments following the declarations.
        private AudioFormat getAudioFormat(){
          float sampleRate = 44100.0F;
          //8000,11025,16000,22050,44100
          int sampleSizeInBits = 16;
          //8,16
          int channels = 1;
          //1,2
          boolean signed = true;
          //true,false
          boolean bigEndian = true;
          //true,false
          return new AudioFormat(sampleRate,
                                 sampleSizeInBits,
                                 channels,
                                 signed,
                                 bigEndian);
        }//end getAudioFormat
        class CaptureThread extends Thread{
               public void run(){
                 AudioFileFormat.Type fileType = null;
                 File audioFile = null;
                 //Set the file type and the file extension
                 // based on the selected radio button.
                 //if(aifcBtn.isSelected()){
                  // fileType = AudioFileFormat.Type.AIFC;
                  // audioFile = new File("junk.aifc");
                // }else if(aiffBtn.isSelected()){
                 //  fileType = AudioFileFormat.Type.AIFF;
                 //  audioFile = new File("junk.aif");
                // }else if(auBtn.isSelected()){
                 //  fileType = AudioFileFormat.Type.AU;
                 //  audioFile = new File("junk.au");
                // }else if(sndBtn.isSelected()){
                //   fileType = AudioFileFormat.Type.SND;
                 //  audioFile = new File("junk.snd");
                // }else if(waveBtn.isSelected()){
                 fileType = AudioFileFormat.Type.WAVE;
                 audioFile = new File("junk.wav");
                // }//end if
                 try{
                   targetDataLine.open(audioFormat);
                   targetDataLine.start();
                   AudioSystem.write(
                         new AudioInputStream(targetDataLine),
                         fileType,
                         audioFile);
                 }catch (Exception e){
                   e.printStackTrace();
                 }//end catch
               }//end run
             }//end inner class CaptureThread
    }

  • How to play an audio file from the begin.........

    Hello to everybody,
    I am working on a application that is supposed to manage audio file. At the moment I 'm using the SourceDataLine instead of the Clip. But I've got a problem. When the user pushes the Stop button I want that if he pushes Play again the track starts from the begin. I've used the drain() and flush() method but it doesn't work because the track resumes from the point when has been interrupted. Here part of the code:
    @Override
    public void run()
    try
    if(dataline!=null)
    dataline.open(audio_format);
    dataline.start();
    int i=0;
    while((i=audio_input_stream.read(buffer, 0, buffer.length))!=-1 && flag==false)
    if(i>0)
    dataline.write(buffer, 0, i);
    dataline.drain();
    dataline.stop();
    dataline.flush();
    dataline=null;
    dataline.close();
    And also I'd like to know how to navigate through the audio file by a slider or something like that, so how much time is passed.
    Thank you in advance.
    Maurizio Di Vitto

    mauriziodvt wrote:
    I've tried to use it but I found out that if I use quite large wav files an exception is thrown, Aha! I expected as much. That is why I developed BigClip.
    ..so I thought to change to SourceDataLine even if Clip has the right stuff to manage my audio files. So what do you suggest? Is there a way to avoid such problem? I mean, how can I be sure that I'm able to use every wav files? Not every WAV file can be opened using SourceDataLine, but if SDL can open it, so can BigClip.

  • I'm trying to extract audio files from my OLYMPUS Digital Voice Recorder VN-6200PC I am getting this error whenever I try to play its file type on my MacBook Pro,"The document "VN622195.WMA" could not be opened. The movie's file format isn't recognized."

    I'm trying to extract audio files from my OLYMPUS Digital Voice Recorder VN-6200PC
    I am getting this error whenever I try to play its file type on my MacBook Pro,"The document “VN622195.WMA” could not be opened. The movie's file format isn't recognized."

    The mac has no native way to read .wma files (these are Windows Media Audio files).  Do a search on the internet for playing wma files on a mac.  You will find several links to solution (one is to use flip4mac).

  • How to read an audio file from the disk and play it?

    Do you know who to read an audio file from the hard disk and play it. It's for an application and not an applet. I tried with the Applet.newAudioClip(URL url) thing, but I keep getting a MalformedURLException.
    And is there a way to get the path of the file you are using? Currently I'm doing this:
    File file = new file("randomname");
    string = file.getAbsolutePath();
    file.delete();
    I'm sure there's a better way. And this is not for an applet, just a normal app.

    Below is a class that should be of use to you.
    package com.sound;
    import java.io.File;
    import javax.sound.sampled.AudioFormat;
    import javax.sound.sampled.AudioInputStream;
    import javax.sound.sampled.AudioSystem;
    import javax.sound.sampled.Clip;
    import javax.sound.sampled.DataLine;
    public class SoundPlayer implements Runnable {
         String filename;
         public SoundPlayer(String filename){
              this.filename = filename;
              Thread t = new Thread(this);
              t.start();
         }//SoundPlayer constructor
         public void run(){
              playSound();
         }//run method
         public boolean playSound(){
              try {
                   File file = new File(filename);
                   AudioInputStream stream = AudioSystem.getAudioInputStream(file);
                   AudioFormat     format = stream.getFormat();
                   DataLine.Info info = new DataLine.Info(Clip.class, format);
                   Clip clip = (Clip)AudioSystem.getLine(info);
                   clip.open(stream);
                   clip.start();
                   while (clip.isRunning()) {
                       Thread.sleep(100);
                   clip.close();
              catch (Exception e) {
                  System.err.println("Error in run in SoundPlayer");
                   return false;
              return true;
         }//playSound() method
    }//Class SoundPlayer

  • How do I add Core Audio files from my HD to the search tab?

    Hello there,
    I'm trying to add a few core audio files from my hard drive the sound effects library in Sound track. I assumed if I just coppied and pasted the CAF files in the ambience folder that is in the  ilife sound effects folder in my library that the files would automaticaly show up in the search tab in soundtrack. this is not the case.
    Can anybody help me?
    Soundtrack 3.0.1
    Thanks,
    mike

    iTunes/iPod does not provide a way of copying tracks from an iPod to iTunes except for purchased music. But iTunes can play MP3 files without conversion.
    Here are some ways of getting files from an iPod to your PC:
    Copy from iPod to PC
    It is important not to allow your iPod to sync with an empty library. If it is set to synchronise automatically you will get a message saying your iPod is linked to a different library and asking if you want to sync – it is important to press cancel as syncing with an empty library erases all music from your iPod.
    You can also prevent auto sync by holding down shift & ctrl as you plug in your iPod and keeping the keys held down until the iPod appears in iTunes.
    Once you are connected, you need to set your iPod to manage music manually.
    http://support.apple.com/kb/HT1535
    If you have an iPod with iTunes Store purchases on it, you can use it to copy your purchases to other authorized computers.
    http://support.apple.com/kb/HT1848
    However this is not allowed for other music.
    This MacMuse tip tells you how to copy music from your iPod using Windows Explorer, but it is a bit fiddly:
    http://discussions.apple.com/messageview.jspa?messageID=797432
    Otherwise you can use third party software to manage the transfer, there are a variety of programs out there, some free and some that will copy ratings and counts as well as the music files. Here is a selection, check them out and see what suits you.
    http://www.yamipod.com/main/modules/home/
    http://www.floola.com/modules/wiwimod/index.php?page=WiwiHome
    http://www.ipodsoft.com/site/pmwiki.php?n=igadget.Homepage
    http://www.copytrans.net/
    For a more complete list see:
    http://en.wikipedia.org/wiki/Comparisonof_iPodmanagers
    There is a useful background article on copying from your iPod here:
    http://www.ilounge.com/index.php/articles/comments/copying-music-from-ipod-to-co mputer/

  • Where can i find the Audio Files from Games?

    Who can  help me i' am serching the folder for Audio Files from Games and Application's where can  i find it by the way the sound folder from Application is not so important!

    Google audio game files, this is a free link. but there are quite a few.
    Hope you find the file you are loking for, plenty of hunting out there:)
    http://soundbible.com/tags-game.html

  • It is very difficult to import audio files from extern drives (NAS) into the new garageband

    it is very difficult to import audio files from extern drives (NAS) into the new garageband.

    Are you trying to open an audio file in GarageBand or a GarageBand project?
    To open an audio file drag it from your NAS to a real-instrument track in GarageBand.
    If you are trying to open a GarageBand project - can you open the same project, if you copy it to your system drive?
    Trying Google translate -
    Bent u probeert om een audiobestand in GarageBand of een GarageBand-project te openen?
    Om een audiobestand slepen uit uw NAS naar een real-instrument track in GarageBand openen.
    Als u probeert een GarageBand-project te openen - kunt u hetzelfde project opent, als u het kopiëren naar uw systeem schijf?

  • Can't play audio files from pre-Intel Mac

    I have some audio files from my old PowerPc Mac (around 1998) which I'd dearly like to be able to hear again on my 2011 Intel G5 Mac (10.7.4).
    The files were created by me on the old Mac using the basic sound recording software that came with all Macs. The files are just people speaking.
    I have attached an image of the icon that is associated witho these files now. For some of these files, the properties show the file type as "QuickTime Player.app Document".I tried opening the files using Quicktime Player app, to no avail.
    Other files are shown as being a "Unix Executable file" type.
    I also have other files from the old Mac with this same icon. With those that I know were text files of some kind, I have just simply added .txt at the end of the filename and hey presto, the file is viewable again. I haven't been so lucky with the others.
    I imagine also that its not so simple with these audio files but I wouldn't know what file extension to use as I haven't worked with audio files before.
    Also, is there a way to keep these files in some generic format, to avoid this problem happening again in the future, as technology advances?
    If you can help with this problem, please reply.

    .... on my 2011 Intel G5 Mac (10.7.4)
    There is no such thing as an Intel G5 Mac.

  • I am having some huge problems with my colorspace settings. Every time I upload my raw files from my Canon 5D mark II or 6D the pics are perfect in color. That includes the back of my camera, the pic viewer on my macbook pro, and previews. They even look

    I am having some huge problems with my colorspace settings. Every time I upload my raw files from my Canon 5D mark II or 6D the pics are perfect in color. That includes the back of my camera, the pic viewer on my macbook pro, and previews. They even look normal when I first open them in photoshop. I will edit, save, and then realize once i've sent it to myself to test the color is WAY off. This only happens in photoshop. I've read some forums and have tried different things, but it seems to be making it worse. PLEASE HELP! Even viewing the saved image on the mac's pic viewer is way off once i've edited in photoshop. I am having to adjust all my colors by emailing myself to test. Its just getting ridiculous.

    Check the color space in camera raw, the options are in the link at the bottom of the dialog box. Then when saving make sure you save it to the srgb color space when sending to others. Not all programs understand color space and or will default to srgb. That won't necessarily mean it will be accurate, but it will put it in the ballpark. Using save for web will use the srgb color space.

  • Help me play an audio file in my GUI

    Hi
    I've been having some trouble getting code to play an audio file in my GUI
    Basically all I want to do is play a file in the same directory as the program, and have it loop. No controls, no buttons to change the play state.
    Could someone point me to or help me implement this with some example code? I'm really stuck and I'm just not sure how to implement it into the existing GUI class.
    Thanks for any help

    Hi
    I've done so, and the method gets called without any problems, but doesnt play anything.
    Have a look -
    public void audioFile()
        try {
            // From file
            AudioInputStream stream = AudioSystem.getAudioInputStream(new File("test.wav"));
            // From URL
            //stream = AudioSystem.getAudioInputStream(new URL("http://hostname/audiofile"));
            // At present, ALAW and ULAW encodings must be converted
            // to PCM_SIGNED before it can be played
            AudioFormat format = stream.getFormat();
            if (format.getEncoding() != AudioFormat.Encoding.PCM_SIGNED) {
                format = new AudioFormat(
                        AudioFormat.Encoding.PCM_SIGNED,
                        format.getSampleRate(),
                        format.getSampleSizeInBits()*2,
                        format.getChannels(),
                        format.getFrameSize()*2,
                        format.getFrameRate(),
                        true);        // big endian
                stream = AudioSystem.getAudioInputStream(format, stream);
            // Create the clip
            DataLine.Info info = new DataLine.Info(
                Clip.class, stream.getFormat(), ((int)stream.getFrameLength()*format.getFrameSize()));
            Clip clip = (Clip) AudioSystem.getLine(info);
            // This method does not return until the audio file is completely loaded
            clip.open(stream);
            // Start playing
            clip.start();
        } catch (MalformedURLException e) {
        } catch (IOException e) {
        } catch (LineUnavailableException e) {
        } catch (UnsupportedAudioFileException e) {
    }

  • Play an audio file over HTTP

    Hello everybody,
    I'm trying to play an audio file over HTTP protocol. The code is the following:
    public class HTTPClientJMF {
         static String url = "http://localhost/audio/Reklam1.wav";
         static String urlFile = "file:///C://tmp/audio/Reklam1.wav";
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              try {
                   DataSource dataS = new URLDataSource(new URL(url));
                   dataS.connect();               
                   Player player = Manager.createPlayer(dataS);
                   player.start();
              } catch (MalformedURLException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (NoPlayerException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    }Now, if I'm trying to play the file from the local disk (+urlFile+ - using file protocol), everything goes well, but if I'm trying to play the same file from the network (using http protocol) I get the following exception:
    javax.media.NoPlayerException: Cannot find a Player for: javax.media.protocol.URLDataSource@fa9cf
    Can somebody tell me what I'm doing wrong?
    Thank you!

    Ah',..okay. I constructed the DataSource like follows:
    Buffer mediaBuffer = new Buffer();;
              String mediaURL = "http://ares.inescn.pt/video/Reklam1.wav";
              URL url;
              try {
                   url = new URL(mediaURL );
                   InputStream in = url.openStream();
                   BufferedInputStream bufIn = new BufferedInputStream(in);
                   for (;;) {
                        int data = bufIn.read();
                        // Check for EOF
                        if (data == -1)
                             break;
                        else
                             mediaBuffer.setData(data);
                   System.out.println(mediaBuffer.getLength());
                   if (mediaBuffer.getLength() != 0) {
                        DataSource ds = new DataSource();
                        HttpStream[] httpStream = ds.getStreams();
                        System.out.println(httpStream.length);
                        httpStream[0].read(mediaBuffer);
                        ds.connect();
                        ds.start();                         
                        Player player = Manager.createPlayer(ds);
                        player.start();But I still cannot play an audio file (wav format) over the HTTP. Application starts but nothing happened.
    I make the modification like you suggested. (into the DataSource, more exactly for method getStreams()).
    I renamed as well the HttpDatasource into HttpStream.
    Did you actually tried the code? I've been reading the instruction how to test the code but I did not be able to run the example.

  • Error while playing an audio file. Please help!

    Hi all,
    I'm trying to transfer an audio file from server to client and play it after transferring the whole file. But the play command opens up the player and gives me the error saying the file is corrupted. I see that some of the lines in the copied file are missing when compared with the original file. I couldnt understand why this is happening in a TCP connection. Can anyone please help me with this.
    Thanks a lot in advance.

    I'm posting my code so that you can tell where am I going wrong
    //Server side writing file to client socket
    do
    i = fin.read();
    if(i!=-1) outToClient.writeByte(i);
    if(i == -1) outToClient.writeByte(-1);
    } while(i!=-1);
    //Client side reading file and playing it
    DataInputStream inFromServer3 = new DataInputStream(clientSocket.getInputStream());
    do
    b = inFromServer3.readByte();
    if(b != -1) fout.write(b);
    if(b == -1)
    end_time = System.currentTimeMillis();                         
    break;
    }while(b !=-1);
    try
    Runtime.getRuntime().exec("C:\\Program Files\\Windows Media Player\\wmplayer.exe /Play c:\\inf612\\612P1\\tcp2.wav");
    catch(Exception e)
    System.out.println(e.getMessage());

  • How do i play an audio clip from a server?

    I am trying to play an audio file on another server, for example:
    URL url = new URL("http://example.com/hello.wav");
    AudioClip click = Applet.newAudioClip(url);
    click.play();This doesn't seem to be working, can anyone tell me what I'm doing wrong?
    Thanks very much.
    Edited by: JavaJenius on Mar 7, 2008 6:47 PM

    Use a SwingWorker:new SwingWorker<AudioClip, Void> () {
        protected AudioClip doInBackground () throws Exception {
            return Applet.newAudioClip (new URL ("http://www.geocities.com/darrylbu/sounds/ringout.wav"));
        protected void done () {
            try {
                get ().play ();
            } catch (ExecutionException ex) {
                ex.printStackTrace();
            } catch (InterruptedException ex) {
                ex.printStackTrace();
    }.execute ();Depending on your need, you may want to make that a named class AND/OR assign it to a variable reference and call execute separately AND/OR you may want to call loop () instead of play () inwhich case you may want to assign the AudioClip to an instance field so that stop () can be called from any method.
    For a console app, I would have recommended a Thread:new Thread (new Runnable () {
        public void run () {
            try {
                Applet.newAudioClip (new URL ("http://www.geocities.com/darrylbu/sounds/ringout.wav")).play ();
            } catch (MalformedURLException ex) {
                ex.printStackTrace();
    }).start ();The same reasoning applies.
    Please read the API for anything you're not familiar with, and get back if you have any questions.
    db

  • Backing up audio files from music production apps onto sd card

    Hi,
    I was considering buying a new 128gb iPad Air, however I'm trying to find a cheaper alternative for my concern, I want to back up my audio files from BM2 onto an usb card via a camera connection kit from an iPad 3 32gb, it would be great if I could also read from it, especially two things in one go, I could use an SD card to store my audio files, and read into BM2, and also free the usb connector for a keyboard. I plan to start performing live and have produced more than 450 tracks, but I want each set to be unique, with different parts of different tracks playing via BM2 also with live keyboard performances routing through Audiobus. I find that like the next level compared to Djaying already produced tracks, also if I progress I could also manage a few live sessions while performing, via Samplr by recording samples from what's playing in output or sessions on other music apps which might not be Audiobus compatible, like iMPC, please could you give us this option to move audio files from device to SD card or usb to transfer onto a computer to back up, in case internet is very weak, or would Apple not allow it? I mainly produce on Intua Beatmaker and have been producing since 2009, I have a sound cloud account www.soundcloud.com/a-submitter, and a website www.asubmitter.com. Please since my internet connection is really bad, as though NSA are tampering with it or Sky are curtailing it, I cannot move bulk folders or files which I highlight via Filezilla, and sometimes moving one file takes ages working as low as 90kbps, when I have a fibre optical internet line from Sky, and it is supposed to be 8mbs upload and 15mbs download, my computer is a mac mini 2012, the latest, but not the highest spec, but still the internet performs as though it's ten years ago.
    Thanks
    Kash

    The camera connection kit can only be used to copy photos/videos to the iPad's Videos app. If you want to leave feedback for Apple (these are user-to-user forums) then you can do so here : http://www.apple.com/feedback/ipad.html

Maybe you are looking for

  • What are the things that need to be done before creating quote and order

    Hi guys We have installed ECC and just for testing purpose we want to enter some basic data starting from creating couple of customers, department, quote and order. Is there a simple way (steps) to follow. The reason for asking this question is that

  • How to Override Trigger Hierarchy at runtime

    I want to override the trigger executio Hierarchy at runtime. I have a When-Validate-Item at Item level, Block level and Form level based, on certain condition i want to dynamically change the hierarchy from item level to Block level or Form level so

  • Problems with ALE transfer HR - E-Recruitment

    Dear Forum, I have an issue when transferring organisational and employee data from HR to E-Rec. HR employee just created another OU, as she has been doing lots of time, but it doesnt trigger the update of E-Rec - so this change is not visible in Rec

  • MBA Blacking out (sleeping?) randomly

    I have a new '13 macbook air. Over the course of about 2 weeks it's had this unusual behavior about 8-10 times where I will be using it and it will just go blank. It appears to be going to sleep while open and in use. I then have to wait 10-15 second

  • Cancel Inbound delivery

    Hi, We've posted a GR for Inbound Delivery for the false scheduling agreement. Now we want to cancel this GR for Inbound Delivery and delete the old scheduling agreement. Problem: Material was with HU. We couldn't cancel the GR because of HU We've de