Using MediaPlayer, the user can play different types of audio files and categorize them or access them through audio albums. This program has features that include the ability to show the duration of the song, rewind or forward songs, change songs, access to all audio files on the device through this MediaPlayer.

What you will learn in this tutorial is as follows:

- MediaPlayer and itsapplications- How tocreate a MediaPlayer project- Familiarity with different types ofMediaPlayer methodsand their applicationsThere are different ways toplay audio in Android, one of which is very useful and convenient is MediaPlayer. In MediaPlayer there are also some methods that can be used to play audio.

- Start () method:

Using this method, you can play the audio file. If this method is called, the audio file can start playing from the beginning.

- Pause () method:

This method is also used to stop playing audio files. In this case, if the audio file has already been played using the start () method, you can use pause () to stop it. Of course, if we stop the audio file and try to play it again, we use the start () method. In this way, using this method, the audio file will be played from where it was, not from the beginning.

- Reset () method:

Used to reset MediaPlayer.

- IsPlaying () method:

This method is also used to check if music is playing or not. It also returns true or false values ​​and says whether the music is playing or not.

- SeekTo () method:

It should be noted that this method takes a value of type int and moves the audio file to the same position. For example, giving a value of 26 to this method can cause the audio file to start playing from 26 seconds.

- GetCurrentPosition () method:

This method can also send the current position of the player. Returns the audio file in any situation.

Read more on:https://www.dotnek.com/Blog/Apps/how-to-play-audio-file-in-mediaplayer-android

link:https://dotnek.mystrikingly.com/

Related link:Android Development

How to start learning Android development

Android article,How to work with cameras on Android devices in two ways

Android article,What are BroadcastReceiver in Android systems, why and how to use them?

Android article,What are floating buttons in Android systems and how can they be used?

Android article,How can we change the font in Android and how to solve different problems?

Android article,What are snackbars in Android systems and how can they be used?

Android article,What are the services in Android systems and when are they used?

the ,method ,audio ,this ,to ,file ,audio file ,this method ,the audio ,used to ,to play

مشخصات

آخرین ارسال ها

آخرین جستجو ها


كتابخانه امام علي (ع) محمّدپارساكریم نژاد 81 دیوار مشهد sepandart مذاکره و فروش تلفني baneh-original Helen's life faarzadb Ross's memory modirpayamak1
دزدگ