Ho bisogno del tuo aiuto. Ho provato a riprodurre un file audio memorizzato nella cartella Risorse ma si è verificato un errore.Errore lettore multimediale Android (1, -4) durante la riproduzione di un audio dalla cartella Assets
Ecco il mio codice:
try{
if (player.isPlaying()) {
player.stop();
player.release();
}
}catch(Exception e){
Toast.makeText(this, "an exception occurred", Toast.LENGTH_LONG).show();
e.printStackTrace();
}
try{
AssetFileDescriptor afd = BeeDailyConvo.this.getAssets().openFd("sounds/hello_kr.wma");
player.setDataSource(afd.getFileDescriptor(),afd.getStartOffset(),afd.getLength());
player.prepare();
player.start();
}catch(Exception e){
e.printStackTrace();
}
Ed ecco i miei logcat:
06-16 22: 39: 53,330: W/MediaPlayer (13490): informazioni/avviso (1, 26)
06-16 22: 39: 53,330: E/MediaPlayer (13490): errore (1, -4)
Potrebbe spiegare cosa c'è di sbagliato con il mio codice?
Grazie in anticipo
saluti,
Priska
grazie .. ha funzionato per me, ma senza afd.close(); lavorando in Samsung la mia scheda ICS da 10 ", ma non in Nexus 7 Jellybean .. dopo aver aggiunto afd.close(); ha funzionato in Jeallybean !! –