Feeding data from memory to MediaPlayer
<p>Scenario:
Have encrypted mp3 files in my .apk.  Need to decrypt and send to MediaPlayer object.</p>

<p>Problem:
After I read the files and decrypt them, how do I get MediaPlayer to play them ?</p>

<p>Now.  MediaPlayer has 4 versions of setDataSource().</p>

<pre><code>setDataSource(String path)
setDataSource(FileDescriptor fd)
setDataSource(FileDescriptor fd, long offset, long length)
setDataSource(Context context, Uri uri)
</code></pre>

<p>None of which are ideal for the situation.  Guess ideal would be to give MediaPlayer an InputStream ?</p>

<p>Possible solutions:</p>

<ul>
<li>Write decrypted data to file play
that file.  A lot of IO overhead.</li>
<li>Create a dummy http server
(ServerSocket ?) and pass the url to
MediaPlayer.  Again, messy.  Am I
even allowed to create a socket.</li>
</ul>

<p>Does anyone have a better solution ?</p>
