/** * 獲取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;}