media-player

android mediaplayer alternative?

痞子三分冷 提交于 2019-12-08 00:55:42
问题 Is there a java audio library that is capable of setting the playback rate of the audio(controlling the speed of the audio) as well as being able to return me the current position of the playback and the total duration of the audio stream? I noticed that the android mediaplayer would be able to return me the current position of the playback and the total duration of the audio stream but it doesn't let me set the playback rate. And unfortunately the android soundpool lets me set the playback

Android: Mediaplayer stop / start playing raw resource

不想你离开。 提交于 2019-12-07 20:19:27
It now plays on first press, stops on second press or press of another sound button. If I let a sound play through I can restart it or play another sound on a single press. My goal is for the second press of the same button to stop it, but the press of a new button to just start the new sound instead of first press of new button stopping the old sound, second press starting the new sound. I can see why it does what it does now but am not sure how to make it work the way I want. public void playSound(int input){ if (mp!=null && mp.isPlaying()) { mp.stop(); mp.reset(); } else{ if (mp!=null){ mp

Closing MediaPlayer properly

强颜欢笑 提交于 2019-12-07 18:23:17
问题 I've got a MediaPlayer activity that I thought I was finished with until I noticed the verbose LogCat output and saw this constantly repeating. 01-17 17:03:50.466: D/StatusBarPolicy(209): iconIndex=1 01-17 17:03:50.476: V/StatusBarPolicy(209): cdmaLevel:1;max:4 01-17 17:03:50.476: D/StatusBarPolicy(209): iconLevel:1 01-17 17:03:50.476: D/StatusBarService(209): updateIcon slot=phone_signal index=20 viewIndex=14 old=StatusBarIcon(pkg=com.android.systemui id=0x7f020007 level=0 visible=true num=0

MediaPlayer not playing audio properly

杀马特。学长 韩版系。学妹 提交于 2019-12-07 17:08:53
问题 I'm trying to play an audio in background from a WebView. This audio is given by a URL. I approached this by overriding the url loading. And it starts playing the audio, but many times the Media Player just stops. This happens around 30% of times, and this audio files are never longer than 30 seconds. I tried with MP3, OGG and WAV, and it happens with any of them. I also tried but first downloading the file and then playing it, instead of stream it, but doesn't work either. This is a piece of

Set ContentURL of MPMoviePlayerController twice

丶灬走出姿态 提交于 2019-12-07 17:04:09
问题 I create an embedded MPMoviePlayerController thusly inside my loadView method: self.moviePlayerController = [[[MPMoviePlayerController alloc] init] autorelease]; // add to view, setup moviePlayerController's view frame, etc And I can later load a movie the user chooses thusly: NSURL *fileUrl = ... self.moviePlayerController.contentURL = fileUrl; and everything works great. However, if I set the contentURL again: NSURL *fileUrl2 = ... self.moviePlayerController.contentURL = fileUrl2; This does

MediaPlayer.getDuration() returning wrong duration

跟風遠走 提交于 2019-12-07 16:52:12
问题 The MediaPlayer's getDuration() method is giving me an incorrect value for some audio files. I think the common trait for all these files is that they were manipulated using Audacity or some other audio editing tool. This is a problem when trying to tie MediaPlayer progress to a Progress Bar. I went ahead and logged it: while(mPlayer.isPlaying()) Log.i("progress/total", mPlayer.getCurrentPosition() + "/" + mPlayer.getDuration()); and found this: I/progress/total(643): 14615/14620 I/progress

Android: MediaPlayer onPrepared is not being called

瘦欲@ 提交于 2019-12-07 16:49:03
问题 As title says, the onPrepared() overridden method is not being called. mediaPlayer = new MediaPlayer(); mediaPlayer.setOnPreparedListener(new OnPreparedListener(){ @Override public void onPrepared(MediaPlayer mp){ if (mp.equals(mediaPlayer)) isReady_mediaPlayer = true; Log.e("I", "Media player has been loaded to memory !"); } }); mediaPlayer = MediaPlayer.create(this, R.raw.my_sound_mp3); 回答1: It's because you are creating a new MediaPlayer object. This one does not have any

Is there a way to stop all MediaPlayers?

南笙酒味 提交于 2019-12-07 16:47:25
问题 I am currently developing my first Android application by reading Dev Documentation at Android official website. What I am trying to accomplish is to play some ring sounds. A section from my code is: import android.app.Activity; import android.media.MediaPlayer; import android.os.Bundle; import android.view.View; public class PlayRingSounds extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } public

QtQuick: cannot playback any video on embedded linux

此生再无相见时 提交于 2019-12-07 16:47:23
问题 I cross compiled Qt 5.2.1 for TI AM335x board using the toolchain provided by TI together with their SDK 6.00.00. Unluckily I am not able to reproduce any video in QML... The debug console tells: defaultServiceProvider::requestService(): no service found for – “org.qt-project.qt.mediaplayer” Is there something that I am missing in cross-compilation? maybe some dependencies? Can somebody help me in determining what I am missing? You can find here my cross-compilation configuration and here the

ffplay / ffmpeg setup table with audio and video filters

不羁的心 提交于 2019-12-07 16:12:29
Regards , I want to create a table with ffplay, that display the audio and video monitoring, from a signal like this: Unfortunately I can do only the video section: ffplay -i bar.mxf -vf "split=4[a][b][c][d],[d]vectorscope=m=color3:g=color[dd],[a]waveform=m=1:d=0:r=0:c=7[aa],\[b]waveform=m=0:d=0:r=0:c=7[bb],[c][aa]vstack[V],[bb][dd]vstack[V2],[V][V2]hstack" I can't put together an audio filters with video filters, actually I can't even do the audio section, I've audio filters independent but I can't put it together. SHOWVOLUME ffplay -f lavfi "amovie=input.mka, asplit [a][out1]; [a] showvolume