0
私はオーディオファイルをマージするためにライブラリを使用しています。 raw
のリソースに格納されている外部オーディオmp3ファイルがあります。生のフォルダからファイルを読み込むmp3オーディオファイルでcom.googlecode.mp4parserが失敗しますか?
:映画(失敗して)読み込む
InputStream is = context.getResources().openRawResource(R.raw.my_mp3_file);
OutputStream output = null;
try {
File file = new File(context.getFilesDir(), "silence.mp3");
if(!file.exists()) {
file.createNewFile();
}
output = new FileOutputStream(file);
byte[] buffer = new byte[4 * 1024]; // or other buffer size
int read;
while ((read = is.read(buffer)) != -1) {
output.write(buffer, 0, read);
}
output.flush();
output.close();
fileReference= file;
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace(); // handle exception, define IOException and others
} finally {
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
}
コード:
if(fileReference.exists()) {
Movie m = new MovieCreator().build(fileReference.getAbsolutePath());
}
このファイルは私のコードで以下では、以下の例外が原因にマージに失敗しますこれを取得中にMovie m
私のコードは例外をスローに失敗します:
java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.List com.coremedia.iso.boxes.MovieBox.getBoxes(java.lang.Class)' on a null object reference
一部のmp3ファイルがrawリソースファイルに失敗しますか?ここで何が間違っていますか?ここで
でいますか? –