我需要將flac文件拆分爲很多部分。我使用jFLAC圖書館閱讀FLAC文件jFLAC。拆分FLAC文件
FLACDecoder decoder = new FLACDecoder(inputStream);
然後我試圖以SeekPoints
decoder.decode(seekPointFrom, seekPointTo);
之間的父文件進行解碼我也不太明白如何正確地得到這個seekpoints用於秒值。例如,我需要從0秒和秒到150秒的第一個查找點。如何獲得正確的尋求點對象? Seekpoint cinstructor是
/**
* The constructor.
* @param sampleNumber The sample number of the target frame
* @param streamOffset The offset, in bytes, of the target frame with respect to beginning of the first frame
* @param frameSamples The number of samples in the target frame
*/
public SeekPoint(long sampleNumber, long streamOffset, int frameSamples) {
this.sampleNumber = sampleNumber;
this.streamOffset = streamOffset;
this.frameSamples = frameSamples;
}
解碼器還有一些偵聽器來偵聽每個讀取的塊動作。
@Override
public void processPCM(ByteData pcm) {
try {
outputStream.write(pcm.getData(), 0, pcm.getLen());
} catch (IOException e) {
e.printStackTrace();
}
}
當書寫時我綁打新FLAC文件,但該文件不正確我的播放器警報。我需要做什麼,我的flac文件將打開權利?也許我需要爲這個文件或其他東西寫一些頭文件?
您應該在[jFLAC郵件列表](http://jflac.sourceforge.net/mail-lists.html)上提問, – 2012-08-09 18:37:12