How to Load and Play Sounds from SD Card
<p>I have button that plays sound using soundpool. I want to open my application and then manually load .mp3 file from SD card and play it with my button.
My java code : </p>

<pre><code>package com.example.idea;

    import android.media.SoundPool;
    import android.os.Bundle;
    import android.app.Activity;
    import android.view.Menu;
    import android.view.View;

    public class MainActivity extends Activity {
    SoundPool sp;
    int mSoundId;
    int mStreamId;
    @Override
    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    mSoundId = sp.load(this, R.raw.sound1, 1);

}

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.activity_main, menu);
    return true;
}

    public void button1(View view){
    if (mStreamId != 0) {
    sp.stop(mStreamId);
}
    `mStreamId = sp.play(mSoundId, 1, 1, 1, 0, 1f);`
}
}
</code></pre>
