I have a tiny uncompress .wav file in my /res/raw directory called keyclick.wav (/res/raw/keyclick.wav).
However, I'm occasionally seeing an exception thrown which causes the activity to crash:
java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed at ...
android.content.res.AssetManager.openNonAssetFdNative(Native Method)
android.content.res.AssetManager.openNonAssetFd(AssetManager.java:427)
android.content.res.Resources.openRawResourceFd(Resources.java:857)
android.media.MediaPlayer.create(MediaPlayer.java:662)
It says "it is probably compressed" but I've double checked, it is not compressed.
This is how I instantiate the MediaPlayer:
this.clickPlayer = MediaPlayer.create(this.getActivity(), R.raw.keyclick);
I uploaded the file so you can see it directly:
http://inadaydevelopment.com/stackoverflow/keyclick.wav
The file is only 664 bytes and it's not compressed. Why is the system failing to get a file descriptor?