in a picture When you press the record button in the left activity, it is recorded and saved as a.3gpp on the sd card.
Then I want to play the file a that I saved when I pressed the button in the activity on the right
How do I code for that?
file io sdcard eclipse-audio external-memory
When you click the Play button, you can play the recorded file using the code below by default.
Uriuri = ....; // a stored on sd card.3gpp file path
MediaPlayer mediaPlayer = new MediaPlayer();
mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
mediaPlayer.setDataSource(getApplicationContext(), uri);
mediaPlayer.prepare();
mediaPlayer.start();
For more information about playing with Media Player, see the link below.
© 2024 OneMinuteCode. All rights reserved.