tags:

views:

122

answers:

1

In MediaPlayer.create method an id to a Raw file can be used but how to use that in setDataSource method?

A: 

You can load the raw audio into an input stream and load it into a MediaPlayer as you would a normal stream:

InputStream ins = getResources().openRawResource(R.raw.example);

and then follow a streaming tutorial like pocketjourney

But this is overly complicated as you can just call

mp = MediaPlayer.create(counterstrikesb.this, R.raw.example);
stealthcopter