I'm learning android app development. Now, when I tried to upload an audio file named "audio.mp3" in res > raw folder in the android studio the audio sound is not playing. and also when running it on an emulator there is no sound. But I found that the file is completely fine. What should I do now?
my code is:
package com.example.audiocontroller;
import android.media.MediaPlayer;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
MediaPlayer mediaPlayer = MediaPlayer.create(this, R.raw.audio);
mediaPlayer.start();
}
}