playback

Event for VideoView playback state or MediaController play/pause

牧云@^-^@ 提交于 2019-11-26 12:38:47
问题 I cant seem to find an event that listens for playback state. I am mostly interested in the play/pause state. I am using MediaController which has a Play/Pause button, but I have a secondary button that also controls Play/Pause . Using my custom button, I can play/pause , but if I play/pause using the MediaController play/pause button, I currently have no way to change the image on my custom play/pause button to either play or pause. Is there an event that I do not know about so I can do some

Trouble playing wav in Java

笑着哭i 提交于 2019-11-26 12:27:22
问题 I\'m trying to play a PCM_UNSIGNED 11025.0 Hz, 8 bit, mono, 1 bytes/frame file as described here (1) and here(2). The first approach works, but I don\'t want to depend on sun.* stuff. The second results in just some leading frames being played, that sounds more like a click. Can\'t be an IO issue as I\'m playing from a ByteArrayInputStream. Plz share your ideas on why might this happen. TIA. 回答1: I'm not sure why the second approach you linked to starts another thread; I believe the audio

What does this gdb output mean?

ぐ巨炮叔叔 提交于 2019-11-26 12:07:00
I've got a button that plays a sound, and it seems to work perfectly fine on the simulator, but i'm getting this message: Error loading /System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn: dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn, 262): Symbol not found: ___CFObjCIsCollectable Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs

Play sound on button click android

早过忘川 提交于 2019-11-26 10:08:40
问题 How do I get a button to play a sound from raw when click? I just created a button with id button1 , but whatever code I write, all is wrong. import android.media.MediaPlayer; public class BasicScreenActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_basic_screen); } Button one = (Button)this.findViewById(R.id.button1); MediaPlayer = mp; mp = MediaPlayer.create(this, R.raw.soho); zero

playback video full screen

那年仲夏 提交于 2019-11-26 08:13:25
问题 I am trying to play a video in my app. It has to be embedded. I went through the \"Play Video Files in Android\" thread. I am able to play my video using VideoView as mentioned in this discussion. But there are a few problems. I need full screen video, how do I stretch VideoView to full screen? Will that stretch the video too? I don\'t need the default play/forward/stop buttons at all. Basically I need continuous loop playing of the video. I tried the MediaPlayer class as in here, but it

iOS: Sample code for simultaneous record and playback

家住魔仙堡 提交于 2019-11-26 07:34:50
问题 I\'m designing a simple proof of concept for multitrack recorder. Obvious starting point is to play from file A.caf to headphones while simultaneously recording microphone input into file B.caf This question -- Record and play audio Simultaneously -- points out that there are three levels at which I can work: AVFoundation API (AVAudioPlayer + AVAudioRecorder) Audio Queue API Audio Unit API (RemoteIO) What is the best level to work at? Obviously the generic answer is to work at the highest

Play two sounds simultaneusly

点点圈 提交于 2019-11-26 06:38:20
问题 Is there a way to play two sounds at the same time? I know that SoundPlayer isn\'t able to do this. I can\'t use SoundEffect as I believe it\'s only part of XNA. The two required sounds will be called at unknown and random times. The sound needs to be be controlled after it is played. i.e., the sound must be able to be stopped before it has finished playing. 回答1: Reference PresentationCore and WindowsBase and try this... var p1 = new System.Windows.Media.MediaPlayer(); p1.Open(new System.Uri(

How do you play a long AudioClip?

允我心安 提交于 2019-11-26 05:38:29
问题 I have written a simple class to play audio files in a simple game. It works fine for small sounds like a gunshot or explosion, but when I tried to use it for background music I got this error: \'Failed to allocate clip data: Requested buffer too large.\' I am assuming this means that the file is too large, but how can I get around this? Source: import java.io.File; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.Clip; public

MediaPlayer stutters at start of mp3 playback

做~自己de王妃 提交于 2019-11-26 04:36:53
问题 I\'ve been having a problem playing an mp3 file stored in a raw resource: when the file first starts playing, it generates perhaps a quarter of a second of sound and then restarts. (I know that this is basically a duplicate of the problem described here, but the solution offered there hasn\'t worked for me.) I have tried several things and have made some progress on the problem, but it isn\'t totally fixed. Here\'s how I\'m setting up to play a file: mPlayer.reset(); try { AssetFileDescriptor

What does this gdb output mean?

半世苍凉 提交于 2019-11-26 03:35:30
问题 I\'ve got a button that plays a sound, and it seems to work perfectly fine on the simulator, but i\'m getting this message: Error loading /System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn: dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn, 262): Symbol not found: ___CFObjCIsCollectable Referenced from: /System/Library/Frameworks/Security.framework