2

This is my code: mp3 format file plays without any error, but wav format brings MediaPlayer error(1,-1):

try {
        MediaPlayer player = new MediaPlayer();
        player.setAudioStreamType(AudioManager.STREAM_MUSIC);
        player.setDataSource("h*.wav");
        player.prepare();
        player.start();} catch (Exception e) {
        // TODO: handle exception
    }
Joseph Quinsey
  • 9,553
  • 10
  • 54
  • 77
Reth
  • 67
  • 1
  • 10

1 Answers1

0

Kindly make a reference to Android supported media-formats

sonu thomas
  • 2,161
  • 4
  • 24
  • 38