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

x33g5p2x  于2022-01-20 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(214)

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

Header.frequency介绍

[英]Returns Frequency.
[中]返回频率。

代码示例

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

@Override
public int getFrequency ()
{
  return _header.frequency();
}

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

@Override
public int getFrequency ()
{
  return _header.frequency();
}

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

/**
 * Returns ms/frame.
 * @return milliseconds per frame
 */
public float ms_per_frame () // E.B
{
  if (h_vbr == true) {
    double tpf = h_vbr_time_per_frame[layer()] / frequency();
    if (h_version == MPEG2_LSF || h_version == MPEG25_LSF) tpf /= 2;
    return (float)(tpf * 1000);
  } else {
    float ms_per_frame_array[][] = { {8.707483f, 8.0f, 12.0f}, {26.12245f, 24.0f, 36.0f}, {26.12245f, 24.0f, 36.0f}};
    return ms_per_frame_array[h_layer - 1][h_sample_frequency];
  }
}

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

/**
 * Returns ms/frame.
 * @return milliseconds per frame
 */
public float ms_per_frame() // E.B
{
  if (h_vbr == true)
  {            
    double tpf = h_vbr_time_per_frame[layer()] / frequency();
    if ((h_version == MPEG2_LSF) || (h_version == MPEG25_LSF)) tpf /= 2;
    return ((float) (tpf * 1000));
  }
  else
  {
    float ms_per_frame_array[][] = {{8.707483f,  8.0f, 12.0f},
                    {26.12245f, 24.0f, 36.0f},
                    {26.12245f, 24.0f, 36.0f}};
    return(ms_per_frame_array[h_layer-1][h_sample_frequency]);
  }
}

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

/**
 * Returns ms/frame.
 *
 * @return milliseconds per frame
 */
public float ms_per_frame() // E.B
{
  if (h_vbr) {
    double tpf = h_vbr_time_per_frame[layer()] / frequency();
    if ((h_version == MPEG2_LSF) || (h_version == MPEG25_LSF)) {
      tpf /= 2;
    }
    return ((float) (tpf * 1000));
  } else {
    float ms_per_frame_array[][] = {{8.707483f, 8.0f, 12.0f},
        {26.12245f, 24.0f, 36.0f},
        {26.12245f, 24.0f, 36.0f}};
    return (ms_per_frame_array[h_layer - 1][h_sample_frequency]);
  }
}

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

/**
 * Returns ms/frame.
 * @return milliseconds per frame
 */
public float ms_per_frame() // E.B
{
  if (h_vbr == true)
  {            
    double tpf = h_vbr_time_per_frame[layer()] / frequency();
    if ((h_version == MPEG2_LSF) || (h_version == MPEG25_LSF)) tpf /= 2;
    return ((float) (tpf * 1000));
  }
  else
  {
    float ms_per_frame_array[][] = {{8.707483f,  8.0f, 12.0f},
                    {26.12245f, 24.0f, 36.0f},
                    {26.12245f, 24.0f, 36.0f}};
    return(ms_per_frame_array[h_layer-1][h_sample_frequency]);
  }
}

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

/**
 * Returns ms/frame.
 * @return milliseconds per frame
 */
public float ms_per_frame() // E.B
{
  if (h_vbr == true)
  {            
    double tpf = h_vbr_time_per_frame[layer()] / frequency();
    if ((h_version == MPEG2_LSF) || (h_version == MPEG25_LSF)) tpf /= 2;
    return ((float) (tpf * 1000));
  }
  else
  {
    float ms_per_frame_array[][] = {{8.707483f,  8.0f, 12.0f},
                    {26.12245f, 24.0f, 36.0f},
                    {26.12245f, 24.0f, 36.0f}};
    return(ms_per_frame_array[h_layer-1][h_sample_frequency]);
  }
}

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

private void initialize (Header header) throws DecoderException {
  // REVIEW: allow customizable scale factor
  float scalefactor = 32700.0f;
  int mode = header.mode();
  header.layer();
  int channels = mode == Header.SINGLE_CHANNEL ? 1 : 2;
  // set up output buffer if not set up by client.
  if (output == null) throw new RuntimeException("Output buffer was not set.");
  filter1 = new SynthesisFilter(0, scalefactor, null);
  // REVIEW: allow mono output for stereo
  if (channels == 2) filter2 = new SynthesisFilter(1, scalefactor, null);
  outputChannels = channels;
  outputFrequency = header.frequency();
  initialized = true;
}

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

private void initialize(Header header)
  throws DecoderException
{
  
  // REVIEW: allow customizable scale factor
  float scalefactor = 32700.0f;
  
  int mode = header.mode();
  int layer = header.layer();
  int channels = mode==Header.SINGLE_CHANNEL ? 1 : 2;
        
  // set up output buffer if not set up by client.
  if (output==null)
    output = new SampleBuffer(header.frequency(), channels);
  
  float[] factors = equalizer.getBandFactors();
  filter1 = new SynthesisFilter(0, scalefactor, factors);
      // REVIEW: allow mono output for stereo
  if (channels==2) 
    filter2 = new SynthesisFilter(1, scalefactor, factors);
  outputChannels = channels;
  outputFrequency = header.frequency();
  
  initialized = true;
}

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

private void initialize(Header header)
    throws DecoderException {
  // REVIEW: allow customizable scale factor
  float scalefactor = 32700.0f;
  int mode = header.mode();
  int layer = header.layer();
  int channels = mode == Header.SINGLE_CHANNEL ? 1 : 2;
  // set up output buffer if not set up by client.
  if (output == null)
    output = new SampleBuffer(header.frequency(), channels);
  float[] factors = equalizer.getBandFactors();
  filter1 = new SynthesisFilter(0, scalefactor, factors);
  // REVIEW: allow mono output for stereo
  if (channels == 2)
    filter2 = new SynthesisFilter(1, scalefactor, factors);
  outputChannels = channels;
  outputFrequency = header.frequency();
  initialized = true;
}

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

private void initialize(Header header)
  throws DecoderException
{
  
  // REVIEW: allow customizable scale factor
  float scalefactor = 32700.0f;
  
  int mode = header.mode();
  int layer = header.layer();
  int channels = mode==Header.SINGLE_CHANNEL ? 1 : 2;
        
  // set up output buffer if not set up by client.
  if (output==null)
    output = new SampleBuffer(header.frequency(), channels);
  
  float[] factors = equalizer.getBandFactors();
  filter1 = new SynthesisFilter(0, scalefactor, factors);
      // REVIEW: allow mono output for stereo
  if (channels==2) 
    filter2 = new SynthesisFilter(1, scalefactor, factors);
  outputChannels = channels;
  outputFrequency = header.frequency();
  
  initialized = true;
}

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

private void initialize(Header header)
  throws DecoderException
{
  
  // REVIEW: allow customizable scale factor
  float scalefactor = 32700.0f;
  
  int mode = header.mode();
  int layer = header.layer();
  int channels = mode==Header.SINGLE_CHANNEL ? 1 : 2;
        
  // set up output buffer if not set up by client.
  if (output==null)
    output = new SampleBuffer(header.frequency(), channels);
  
  float[] factors = equalizer.getBandFactors();
  filter1 = new SynthesisFilter(0, scalefactor, factors);
      // REVIEW: allow mono output for stereo
  if (channels==2) 
    filter2 = new SynthesisFilter(1, scalefactor, factors);
  outputChannels = channels;
  outputFrequency = header.frequency();
  
  initialized = true;
}

代码示例来源:origin: ddf/Minim

nFrequency = m_header.frequency();
aff_properties.put("mp3.frequency.hz", new Integer(nFrequency));
FrameRate = (float)((1.0 / (m_header.ms_per_frame())) * 1000.0);

代码示例来源:origin: libetl/soundtransform

sampleRate = header.frequency ();
outBuffer = new StreamBuffer (channels, MP3JLayerConverter.BIG_ENDIAN);
formatInfo = new FormatInfo (MP3JLayerConverter.SAMPLE_SIZE, sampleRate);

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

encDelay = header.getEncDelay();
int encPadding = header.getEncPadding();
int sampleRate = header.frequency();
int channels = header.mode() == Header.SINGLE_CHANNEL ? 1 : 2;
trackData.setSampleRate(sampleRate);
trackData.setChannels(channels);
oldBitrate = trackData.getBitrate();
samplesPerFrame = (int) (header.ms_per_frame() * header.frequency() / 1000);
audioFormat = new AudioFormat(sampleRate, 16, channels, true, false);

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

int freq = header.frequency();
output = new WaveFileObuffer(channels, freq, destName);
decoder.setOutputBuffer(output);

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

int freq = header.frequency();
output = new WaveFileObuffer(channels, freq, destName);
decoder.setOutputBuffer(output);

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

int freq = header.frequency();
output = new WaveFileObuffer(channels, freq, destName);
decoder.setOutputBuffer(output);

相关文章