android-mediaplayer

Can an Android (Java not C/C++) plugin alter unity textures?

允我心安 提交于 2019-12-06 14:08:32
I'm trying to use an Android plugin to get around the fact that Unity does not support Video Textures on mobile. I do this by getting the texture ID of the texture that will be used for video (supplied by Texture2D.GetNativeTextureID() ) which i then pass into the Java Plugin. The plugin then follows a standard MediaPlayer implementation to play the video into a Surface Texture, which has been assigned the aforementioned texture ID. When i call the MediaPlayer.Start() method, LogCat outputs as if the media player is working normally/as hoped, however the texture never changes in the app. I'm

Handling Incoming calls in android application

被刻印的时光 ゝ 提交于 2019-12-06 14:01:14
I have developed a music related android application. I have a problem in handling the mediaplayer on incoming call. I want to pause the audio during the phonecall and resume it back after the call gets ended. I need suggestions whether to use TelephonyManager with onstatechanged to pause and resume the audio (OR ) any other methods to pause and resume the application itself during Incoming calls. use onPause() and onResume() methods in your activity. When an incoming call comes, onPause() method is called. and onResume() is called when call is hung up. This will work even if the user clicks

Getting IllegalStateException in MediaPlayer when trying to getCurrentPosition

久未见 提交于 2019-12-06 13:45:04
问题 I've been trying to make my trackbar work with the music player I just started working on. But when I press next, I get an Exception. Here's my code: public class ThePlayer extends AppCompatActivity { private static final String TAG = "MyActivity"; static MediaPlayer mp; int position; SeekBar mSeekBar; Button btnPlay, btnFF, btnFB, btnNext, btnPrev; int[] w2 = {R.raw.w2l01f01, R.raw.w2l01f03, R.raw.w2l01f04}; ArrayList<Integer> mysongs; Thread updateSeekBar; @Override protected void onCreate

Android AudioFlinger server died | media server died

早过忘川 提交于 2019-12-06 13:18:25
I am trying to develop a hls player on android devices, and i have some test-streams i can play with. A problem i have is that the HLS stream just "stops", freezes at some random locations, it could be after 1 minute, or after 20. The error i get is: 11-20 14:14:10.484: W/AudioSystem(18531): AudioFlinger server died! 11-20 14:14:10.484: W/IMediaDeathNotifier(18531): media server died and 11-20 14:14:10.484: E/MediaPlayer(18531): Error (100,0) I've got basically no idea on how to prevent or restart the stream if this is happening. I don't even know why it happens. So if someone could answer

File that I recorded with MediaRecorder can't be played

╄→尐↘猪︶ㄣ 提交于 2019-12-06 12:34:30
I'm using MediaRecoder to record sound, but after I'm done recording it can't be played. I tried with Google Play Music, ES Media Player, even uploaded it to pc and tried opening it with Winamp. Nothing plays it! //AUDIO RECORDER recorder = new MediaRecorder(); recorder.reset(); recorder.setAudioSource(MediaRecorder.AudioSource.MIC); recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) { externalStoragePath = Environment

java.lang.IllegalStateException: Not allowed to start service Intent while trying to run RingtoneService

主宰稳场 提交于 2019-12-06 12:02:26
I am creating an organizer app which contains many functions one of them is an alarm, while trying to start the RingtoneService for my alarm most of the times I get this exception "java.lang.IllegalStateException: Not allowed to start service Intent" because it's running in the background (sometimes it runs with delay)! I extensively searched for an answer and tried the following and none worked: - JobScheduler : I get the same exception - bindService() and writing the code inside onServiceConnected() : it never hits the onServiceConnected() Below are the important parts of my code: public

Android MediaPlayer: prepared video takes 250ms to start playing

孤街醉人 提交于 2019-12-06 10:49:22
When I play a video, using prepareAsync(), then calling start() when the video is prepared, it takes about 250ms from my start() call to when the video actually starts to play. Is that just how it is, or is something funny going on here? Note that the video is in the raw directory. In my activity's OnCreate I have: private VideoView vv; private MediaPlayer mp = new MediaPlayer(); vv = (VideoView)findViewById(R.id.vv); vv.getHolder().addCallback(this); mp.reset(); mp.setDisplay( vv.getHolder() ); mp.setDataSource( this, Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.moviename)

m3u8 file not playing in Android Emulator

这一生的挚爱 提交于 2019-12-06 08:36:48
I am trying to playback a m3u8 file in Android Emulator. http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8 It's not able to playback the video but audio is heard. I get the following error E/OMXNodeInstance( 39): OMX_GetExtensionIndex failed . I traced the calls and I see that the video decoder is not instantiated properly, I find that OMXNodeInstance::enableGraphicBuffers is getting called and that calls, OMX_ERRORTYPE err = OMX_GetExtensionIndex(...,const_cast<OMX_STRING>("OMX.google.android.index.enableAndroidNativeBuffers"),...); which is then calling OMX_ERRORTYPE

How to compute decibel (dB) of Amplitude from Media Player?

假如想象 提交于 2019-12-06 07:31:23
问题 I have a code to compute real-time dB Amplitude of AudioRecord. The code works well for computing dB Amplitude. After recording, I save that it to wav file. Now, I want to playback that file and recompute the dB Amplitude. However, I cannot achieve similar result before. Could you help me to fix it. This is my code to compute dB Amplitude when recording and playback. 1.Compute dB amplitude when recording bufferSize = AudioRecord.getMinBufferSize(16000, AudioFormat.CHANNEL_IN_MONO, AudioFormat

WARN/AudioFlinger(33): write blocked for 76 msecs, 7773 delayed writes, thread 0xb3f0

别说谁变了你拦得住时间么 提交于 2019-12-06 07:29:52
I have created an intent service to start the music for my app in the background. It is working, but my log-cat is flooded with the messages: 09-14 16:46:30.117: WARN/AudioFlinger(33): write blocked for 76 msecs, 7773 delayed writes, thread 0xb3f0 and nothing else is getting Logged. Here is my IntentService: import android.app.IntentService; import android.content.Intent; import android.media.MediaPlayer; import android.media.MediaPlayer.OnErrorListener; import android.widget.Toast; public class MusicService extends IntentService { MediaPlayer mPlayer; private OnErrorListener mErrorListener;