Can read file from android sdcard using java
When I try to read file from sdcard I get an error source not found.
private void merge2WavFiles(String wavFile1, String wavFile2, String newWavFilePat开发者_运维技巧h) {
try {
AudioInputStream clip1 = AudioSystem.getAudioInputStream(new File(wavFile1));
I can't get the audio input stream... Of course the file exists. what could be the problem?
EDIT: The error is source not found (instead of file not found)
Using LogCat I managed to find the error:
ERROR/AndroidRuntime(311): java.lang.NoClassDefFoundError: javax.sound.sampled.AudioSystem
How can I fix this?
Take a look here about how to access files on SD card. And here about manifest file permissions. Hope that helps.
The solution to my problem is simple...Android dosen't support the javax.sound.sampled.AudioSystem anymore
精彩评论