/**
* 获取mp3文件的采样率
* @param filefullname 文件完整路径
* @return 采样率
*/
public int getMp3SampleRate(String filefullname) {
MediaExtractor mExtractor = new MediaExtractor();
try {
mExtractor.setDataSource(filefullname);
} catch (IOException e) {
e.printStackTrace();
}
MediaFormat format = mExtractor.getTrackFormat(0);
//获取当前音频的采样率
mExtractor.selectTrack(0);
int mSampleRate = format.getInteger(MediaFormat.KEY_SAMPLE_RATE);
return mSampleRate;
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2021-09-08
猜你喜欢
  • 2021-10-22
  • 2022-12-23
  • 2022-12-23
  • 2021-06-20
  • 2021-08-05
  • 2022-12-23
  • 2022-02-09
相关资源
相似解决方案