mediaplayer how to stop playing
<p>I am playing some wav file and after while i want to stop it.</p>

<p>I am using singleton like</p>

<pre><code>private static playSound instance = null;

public static synchronized playSound getInstance(Context context) {
    if(null == instance) {
        instance = new playSound(context, "", 1);
    }

    return instance;
}
</code></pre>

<p>and i am calling</p>

<pre><code>public void stopAudio() {
    try{
        myplayer.stop();
        myplayer.release();         
    } catch(Exception e){
        Log.e(TAG, "Exception caught:\n" + e.getMessage() +"\n" + e.getStackTrace());               
    }
}
</code></pre>

<p><code>instance</code> is not null so i think this should work because is the same instance...</p>

<p>but i get:</p>

<pre><code>MediaPlayer: stop called in state 1
</code></pre>
