Package com.meapsoft

Examples of com.meapsoft.AudioReader


           {
           //see which file we should be playing here
           String fileName = playOriginal ? BasePanel.inputSoundFileNameFull : BasePanel.outputSoundFileNameFull;
            
             //divide length by the framerate (thanks ron!)
           AudioReader r = AudioReaderFactory.getAudioReader(fileName, outputFormat);
           double length = r.getFrameLength() / r.getFormat().getFrameRate();
          
             //create a big chunk and add it
             EDLChunk c = new EDLChunk(fileName, 0.0, length, 0.0);
             edl.chunks.add(c);
           }
View Full Code Here


    double zoomMulti = (zoomLevel * 4.0) / 4.0;
    int w = (int) (this.getWidth() * zoomMulti) - 1;
    FeatChunk fCTD = (FeatChunk) events.get(firstChunkToDraw);
    double localFirstEventTime = fCTD.startTime;

    AudioReader reader = null;

    // don't need hirez data for display...
    AudioFormat format = new AudioFormat(8000, 16, 1, MEAPUtil.signed,
        MEAPUtil.bigEndian);

    try
    {
      //reader = new AudioReader(fCTD.srcFile, format);
            reader = AudioReaderFactory.getAudioReader(fCTD.srcFile, format);
    }
    catch (IOException e1)
    {
      e1.printStackTrace();
      return;
    }
    catch (UnsupportedAudioFileException e1)
    {
      e1.printStackTrace();
      return;
    }

    int frameSize = format.getFrameSize();
    double frameRate = (double) format.getFrameRate();

    long fileFrameLength = reader.getFrameLength();
    double fileTimeLength = ((double) fileFrameLength / frameRate);//  / frameSize;

    int framesPerPixel = (int) Math.ceil((double) fileFrameLength
        / (double) w);
    double timePerPixel = ((double) framesPerPixel / frameRate);// / frameSize;
View Full Code Here

   
    //don't need hirez data for waveform display...
      AudioFormat format = new AudioFormat(8000, 16, 1, MEAPUtil.signed,
                                             MEAPUtil.bigEndian);
   
        AudioReader reader = null;
    try
    {
            //reader = new AudioReader(fCTD.srcFile, format);
            reader = AudioReaderFactory.getAudioReader(fCTD.srcFile, format);
    }
    catch (IOException e1)
    {
      e1.printStackTrace();
      return;
    }
    catch (UnsupportedAudioFileException e1)
    {
      e1.printStackTrace();
      return;
    }
   
    //double startTime = fC.startTime;   
   
        int frameSize = format.getFrameSize();
        double frameRate = (double)format.getFrameRate();
       
    long fileFrameLength = reader.getFrameLength();
    double fileTimeLength = ((double)fileFrameLength / frameRate);// / frameSize;
   
    int framesPerPixel = (int) Math.ceil((double)fileFrameLength/(double)w);
    double timePerPixel = ((double)framesPerPixel / frameRate);// / frameSize;

    firstEventTime = localFirstEventTime;
    timeRange = fileTimeLength - localFirstEventTime;
   
    //System.out.println("waveform seyz: timeRange: " + timeRange + " fileTL: " + fileTimeLength +
    //    " firstET: " + firstEventTime);
   
    //System.out.println("waveform seyz: frameSize: " + frameSize + " frameRate: " + frameRate +
    //    " fileFrameLength: " + fileFrameLength + " fileTimeLength: " + fileTimeLength +
    //    " framesPerPixel: " + framesPerPixel + " timePerPixel: " + timePerPixel + " w: " + w);

        try
        {
            // One sample per frame because we converted the file to mono.
            long n = reader.skipSamples((long)(localFirstEventTime * frameRate));
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }

    int x = 0;
    while (x < w)
    {
      double[] samples = new double[framesPerPixel];
            //double[] samples = new double[100];
      try
      {
                int n = reader.readSamples(samples);
      }
      catch (Exception e)
      {
        e.printStackTrace();
      }
View Full Code Here

TOP

Related Classes of com.meapsoft.AudioReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.