I am using MediaPlayer as a Service in my app. I have implemented a mute and unmute feature but I have a problem with the volume when I switch between the two states: Say the music is playing at max volume and you reduce the volume to halfway while in the unmuted state. Then you ..
Category : android-mediaplayer
I’m trying to optimize a pipeline. I want to know , when I write input data to the buffer obtained by calling "AMediaCodec_getInputBuffer" Does android internally copy it to the OMX buffer ( OMX_FillThisBuffer() ) or is this buffer mapped internally to the OMX buffer? Source: Android..
I have an application which will record audio as soon as the activity is launched and after recording for 15 seconds, it will stop and the audio will be saved in phone’s storage and will be uploaded to firebase as well. But whenever I call mediarecorder.stop(); function, it gives error of null object reference. Please ..
Music files should be downloaded to the app itself, it shouldn’t get stored on mobile memory (file manager or SD card). Source: Android..
public class SongPlayerActivity extends AppCompatActivity implements MediaPlayer.OnCompletionListener { static MediaPlayer mediaPlayer; TextView songName, artistName, albumName, durationPlayed, totalDuration; ImageView next, previous, songImage, shuffle, repeat; SharedPreferences sharedPreferences; SharedPreferences.Editor editor; SeekBar seekBar; FloatingActionButton floatingActionButton; List<Song> songList = new ArrayList<>(); Handler handler = new Handler(); Thread playPauseThread, nextThread, previousThread; private Uri uri; private int position; boolean shuffleBoolean, repeatBoolean; @Override ..
I used a view pager in xml of main activity and item container xml have all the details of the view pager. I used Media player to play the video but I want to make a share button in this such that the user can share the video which is running at that moment . ..
I have a method that has to play an audio file when a button is pressed. But I want the audio file that has to be played depend on the parameter of the method. The parameter is a int with the same name as the audio file in raw folder. But I noticed that the ..
I have a settings activity in my Android app that selects a sound from a choice of files in the res/raw folder. There are other settings too but the essential part of the settings_pref.xml file is <PreferenceCategory android:title="Pager Tone"> <ListPreference android:defaultValue="pager1" android:entries="@array/pagerName" android:entryValues="@array/pagerFile" android:key="pagerSound" android:title="Select Pager Tone" app:useSimpleSummaryProvider="true" /> </PreferenceCategory> Then the SettingsFragment.java is import ..
My application notifications should appear even when the phone is silent. This is a prayer app and, for example, the notification needs to sound when it comes to prayer even if the phone is in silent mode at night, which can sometimes be long (eg: like adhan). I used the MediaPlayer library for this and ..
There are GameActivity and MainActivity. I put the Mediaplayer on GameActivity. Then when the game is over, the music stops. So, I put the Mediaplayer on MainActivity. Then it’s repeating after the game over. (overlap, playing new music when it’s already playing) How can I solve this error? GameActivity public class GameActivity extends AppCompatActivity { ..
Recent Comments