I have written the most basic application I can think of to try to
play an mp3 file, but it is not working. I don't get any errors, but
when the application starts up, the sound is not played.

<pre>
<code>
public class soundtest extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        MediaPlayer mp = new MediaPlayer();
        mp.create(getApplicationContext(), R.raw.norm_iphone_money);
        mp.start();
    }
}
</code>
</pre>

What am I missing? I have "norm_iphone_money.mp3" inside the res/raw
folder. The file plays fine in Windows Media Player and iTunes.

I'm using the latest versions of Java SDK and Eclipse for Java. The
app is targeted for Android 2.2 and runs fine in the emulator despite
no sound.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to