0
讀取音頻文件(例如wav文件),然後獲取其時間長度。然後從第二個秒或第二個秒獲取它的字節值。就像我有一個20秒的WAV,我會在我指定的時間輸出它的字節[]。因爲獲取文件的所有長度的字節需要非常大的空間。在java中獲取音頻文件的時間屬性
這是我從音頻文件中獲取字節,但我需要的只是秒的字節。任何幫助?
FileInputStream s = new FileInputStream(Environment.getExternalStorageDirectory().getAbsolutePath()+"/audio_raw.wav");
BufferedInputStream b = new BufferedInputStream(s);
byte[] data = new byte[128];
while((bytes = b.read(data)) > 0)
{
for(int i = 0; i<bytes; i++)
{
unsigned = data[i] & 0xFF;
bw.write(unsigned+"+");
}
}
b.read(data);
b.close();
這可能,謝謝!現在就玩吧。讓你知道它是否有竅門。 – dimmed 2014-12-04 17:43:40