CODE EDITED:
I am developing a dictionary for Android. I succeeded in having the app pronounce every word viewed. Here is the code:
btnPronounce.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub //Log.i(MAIN_TAG,"Start pronounciation ..."); btnPronounce.setEnabled(false); String currentWord = edWord.getText().toString().toLowerCase(); try { ZipFile zip = new ZipFile("/sdcard/app_folder/sound/zip_test.zip"); ZipEntry entry = zip.getEntry(currentWord); if (entry != null) { InputStream in = zip.getInputStream(entry); // see Note
But the problem is that there are too many WAV files in one folder, and all these files are treated as music files on Android devices. As a result, it takes age to index such files. In addition, indexing and viewing users sometimes cause the application to crash.
So I'm just wondering if you can programmatically do the following:
- Can Android MediaPlayer play WAV / MP3 files archived or packaged into a single file? I mean, I want to pin or wrap the audio files (or do something similar) so that they appear as one single file on Android devices, but MediaPlayer can play every single WAV file inside.
- If this is not possible, can you suggest a solution to the problem?
EDIT: Are there other ways / solutions that allow audio files to just fit into one large file (image, zip or the like ...) and then let MediaPlayer read the individual files in it?
Thank you very much.
source share