playing Audio from BLOB field of a Table of a SQLite DB
Perhaps too late but if someone needs it.
This works for me:
File file; FileOutputStream fos; byteaudio = cursor.getBlob(cursor.getColumnIndex("sonido")); try { file = File.createTempFile("sound", "sound"); fos = new FileOutputStream(file); fos.write(byteaudio); fos.close(); Log.d("File", file.toString()); } catch (IOException e) { e.printStackTrace(); }mp = MediaPlayer.create(getActivity(), Uri.fromFile(file)); mp.start();