Examples of IAudioSamples


Examples of com.xuggle.xuggler.IAudioSamples

  public void testGetBufferType()
  {
    int sampleRate = 440;
    int channels=1;
   
    IAudioSamples samples = IAudioSamples.make(sampleRate, 1);
    assertNotNull(samples);

    samples.setComplete(true, sampleRate, sampleRate,
        channels, IAudioSamples.Format.FMT_S16, 0);
    assertTrue(samples.isComplete());
   
    IBuffer buffer;
    buffer = samples.getData();
    assertEquals(IBuffer.Type.IBUFFER_SINT16, buffer.getType());

    samples.setComplete(true, sampleRate, sampleRate,
        channels, IAudioSamples.Format.FMT_S32, 0);
    assertTrue(samples.isComplete());
    buffer = samples.getData();
    assertEquals(IBuffer.Type.IBUFFER_SINT32, buffer.getType());
}
View Full Code Here

Examples of com.xuggle.xuggler.IAudioSamples

      mVideoStreamIndex = videoStreamIndex;
    }
   
    public void onAudioSamples(IAudioSamplesEvent event)
    {
      IAudioSamples samples = event.getAudioSamples();
     
      // set the new time stamp to the original plus the offset established
      // for this media file

      long newTimeStamp = samples.getTimeStamp() + mOffset;

      // keep track of predicted time of the next audio samples, if the end
      // of the media file is encountered, then the offset will be adjusted
      // to this time.

      mNextAudio = samples.getNextPts();

      // set the new timestamp on audio samples

      samples.setTimeStamp(newTimeStamp);

      // create a new audio samples event with the one true audio stream
      // index

      super.onAudioSamples(new AudioSamplesEvent(this, samples,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.