I am having some trouble storing audio in the database in android using SQLite
. I know people will say don't store in database performance, large files, once you reach the limit. I have a reason for storing in the database.
My intended goal is to record audio from the device and then store it as a blob
to place it in the database.
My next intention is to retrieve it as a blob
and convert it back to the recorded audio file format.
I am interested in using just about any format. maybe 3gp
for the recording or mp3
i'm not really sure how the recording works because i am working on the database class for storing.
below is an example of something i am trying to do. The image file i have can easily be changed back using the BitmapFactory.decodeByteArray()
but i have no idea what to use for audio files. keep in mind it's up for a change i can use any audio format recommended.
the main goal is to go from audio to blob and back
for (int i = 0; i < rows; i++) {
Note note = new Note(cursor.getInt(_id),cursor.getString(_book),
cursor.getString(_chapter),cursor.getInt(_page),
BitmapFactory.decodeByteArray(cursor.getBlob(_image),
0,
cursor.getBlob(_image).length),
cursor.getBlob(_audio));
cursor.moveToNext();
}