javazoom.jl.decoder.Bitstream.readFrame()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(185)

本文整理了Java中javazoom.jl.decoder.Bitstream.readFrame()方法的一些代码示例,展示了Bitstream.readFrame()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bitstream.readFrame()方法的具体详情如下:
包路径:javazoom.jl.decoder.Bitstream
类名称:Bitstream
方法名:readFrame

Bitstream.readFrame介绍

[英]Reads and parses the next frame from the input source.
[中]从输入源读取并解析下一帧。

代码示例

代码示例来源:origin: libgdx/libgdx

int sampleRate = -1, channels = -1;
while (true) {
  Header header = bitstream.readFrame();
  if (header == null) break;
  if (outputBuffer == null) {

代码示例来源:origin: libgdx/libgdx

int sampleRate = -1, channels = -1;
while (true) {
  Header header = bitstream.readFrame();
  if (header == null) break;
  if (outputBuffer == null) {

代码示例来源:origin: libgdx/libgdx

int sampleRate = -1, channels = -1;
while (true) {
  Header header = bitstream.readFrame();
  if (header == null) break;
  if (outputBuffer == null) {

代码示例来源:origin: libgdx/libgdx

int sampleRate = -1, channels = -1;
while (true) {
  Header header = bitstream.readFrame();
  if (header == null) break;
  if (outputBuffer == null) {

代码示例来源:origin: libgdx/libgdx

public Music (OpenALAudio audio, FileHandle file) {
  super(audio, file);
  if (audio.noDevice) return;
  bitstream = new Bitstream(file.read());
  decoder = new MP3Decoder();
  bufferOverhead = 4096;
  try {
    Header header = bitstream.readFrame();
    if (header == null) throw new GdxRuntimeException("Empty MP3");
    int channels = header.mode() == Header.SINGLE_CHANNEL ? 1 : 2;
    outputBuffer = new OutputBuffer(channels, false);
    decoder.setOutputBuffer(outputBuffer);
    setup(channels, header.getSampleRate());
  } catch (BitstreamException e) {
    throw new GdxRuntimeException("error while preloading mp3", e);
  }
}

代码示例来源:origin: libgdx/libgdx

public Music (OpenALAudio audio, FileHandle file) {
  super(audio, file);
  if (audio.noDevice) return;
  bitstream = new Bitstream(file.read());
  decoder = new MP3Decoder();
  bufferOverhead = 4096;
  try {
    Header header = bitstream.readFrame();
    if (header == null) throw new GdxRuntimeException("Empty MP3");
    int channels = header.mode() == Header.SINGLE_CHANNEL ? 1 : 2;
    outputBuffer = new OutputBuffer(channels, false);
    decoder.setOutputBuffer(outputBuffer);
    setup(channels, header.getSampleRate());
  } catch (BitstreamException e) {
    throw new GdxRuntimeException("error while preloading mp3", e);
  }
}

代码示例来源:origin: libgdx/libgdx

public Music (OpenALAudio audio, FileHandle file) {
  super(audio, file);
  if (audio.noDevice) return;
  bitstream = new Bitstream(file.read());
  decoder = new MP3Decoder();
  bufferOverhead = 4096;
  try {
    Header header = bitstream.readFrame();
    if (header == null) throw new GdxRuntimeException("Empty MP3");
    int channels = header.mode() == Header.SINGLE_CHANNEL ? 1 : 2;
    outputBuffer = new OutputBuffer(channels, false);
    decoder.setOutputBuffer(outputBuffer);
    setup(channels, header.getSampleRate());
  } catch (BitstreamException e) {
    throw new GdxRuntimeException("error while preloading mp3", e);
  }
}

代码示例来源:origin: libgdx/libgdx

public Music (OpenALAudio audio, FileHandle file) {
  super(audio, file);
  if (audio.noDevice) return;
  bitstream = new Bitstream(file.read());
  decoder = new MP3Decoder();
  bufferOverhead = 4096;
  try {
    Header header = bitstream.readFrame();
    if (header == null) throw new GdxRuntimeException("Empty MP3");
    int channels = header.mode() == Header.SINGLE_CHANNEL ? 1 : 2;
    outputBuffer = new OutputBuffer(channels, false);
    decoder.setOutputBuffer(outputBuffer);
    setup(channels, header.getSampleRate());
  } catch (BitstreamException e) {
    throw new GdxRuntimeException("error while preloading mp3", e);
  }
}

代码示例来源:origin: libgdx/libgdx

int minRequiredLength = buffer.length - OutputBuffer.BUFFERSIZE * 2;
while (totalLength <= minRequiredLength) {
  Header header = bitstream.readFrame();
  if (header == null) break;
  if (setup) {

代码示例来源:origin: libgdx/libgdx

int minRequiredLength = buffer.length - OutputBuffer.BUFFERSIZE * 2;
while (totalLength <= minRequiredLength) {
  Header header = bitstream.readFrame();
  if (header == null) break;
  if (setup) {

代码示例来源:origin: libgdx/libgdx

int minRequiredLength = buffer.length - OutputBuffer.BUFFERSIZE * 2;
while (totalLength <= minRequiredLength) {
  Header header = bitstream.readFrame();
  if (header == null) break;
  if (setup) {

代码示例来源:origin: libgdx/libgdx

int minRequiredLength = buffer.length - OutputBuffer.BUFFERSIZE * 2;
while (totalLength <= minRequiredLength) {
  Header header = bitstream.readFrame();
  if (header == null) break;
  if (setup) {

代码示例来源:origin: pdudits/soundlibs

/**
 * skips over a single frame
 * @return false    if there are no more frames to decode, true otherwise.
 */
protected boolean skipFrame() throws JavaLayerException
{
  Header h = bitstream.readFrame();
  if (h == null) return false;
  bitstream.closeFrame();
  return true;
}

代码示例来源:origin: javazoom/jlayer

/**
 * skips over a single frame
 * @return false    if there are no more frames to decode, true otherwise.
 */
protected boolean skipFrame() throws JavaLayerException
{
  Header h = bitstream.readFrame();
  if (h == null) return false;
  bitstream.closeFrame();
  return true;
}

代码示例来源:origin: com.googlecode.soundlibs/jlayer

/**
 * skips over a single frame
 * @return false    if there are no more frames to decode, true otherwise.
 */
protected boolean skipFrame() throws JavaLayerException
{
  Header h = bitstream.readFrame();
  if (h == null) return false;
  bitstream.closeFrame();
  return true;
}

代码示例来源:origin: tulskiy/musique

private Header skipFrame() throws BitstreamException {
  readFrame = bitstream.readFrame();
  if (readFrame == null) {
    return null;
  }
  bitstream.closeFrame();
  return readFrame;
}

代码示例来源:origin: com.googlecode.apparat/apparat-playerglobal

private boolean decodeFrame() {
    try {
      final Header header = _bitstream.readFrame();

      if(null == header) {
        return false;
      }

      _output = (SampleBuffer) _decoder.decodeFrame(header, _bitstream);
      _available += _output.getBufferLength() >> 1;
      _readPos = 0;

      return true;
    } catch(final Throwable t) {
      throw new RuntimeException(t);
    }
  }
}

代码示例来源:origin: threerings/nenya

@Override
public void init (InputStream in)
  throws IOException
{
  _istream = new Bitstream(in);
  try {
    _header = _istream.readFrame();
  } catch (JavaLayerException e) {
    throw new IOException(e.toString());
  }
  _decoder = new Decoder();
}

代码示例来源:origin: com.threerings/nenya

@Override
public void init (InputStream in)
  throws IOException
{
  _istream = new Bitstream(in);
  try {
    _header = _istream.readFrame();
  } catch (JavaLayerException e) {
    throw new IOException(e.toString());
  }
  _decoder = new Decoder();
}

代码示例来源:origin: com.badlogicgames.gdx/gdx-backend-lwjgl3

public Music (OpenALAudio audio, FileHandle file) {
  super(audio, file);
  if (audio.noDevice) return;
  bitstream = new Bitstream(file.read());
  decoder = new MP3Decoder();
  bufferOverhead = 4096;
  try {
    Header header = bitstream.readFrame();
    if (header == null) throw new GdxRuntimeException("Empty MP3");
    int channels = header.mode() == Header.SINGLE_CHANNEL ? 1 : 2;
    outputBuffer = new OutputBuffer(channels, false);
    decoder.setOutputBuffer(outputBuffer);
    setup(channels, header.getSampleRate());
  } catch (BitstreamException e) {
    throw new GdxRuntimeException("error while preloading mp3", e);
  }
}

相关文章