Android :: Media Player Sluggish To Play Sounds

Mar 31, 2009

I have an Activity that plays a brief OGG "pop" sound effect when bubbles pop. To keep it fast and to ensure I can play several pops, I create four MediaPlayer instances. I synchronize access to a pool of instances, so I can play up to four pops at once. Once a sound completes, I call seekTo(0) and return the MediaPlayer instance to my pool.

Here is a rough sketch of the code:
// when the activity resumes... for (int i=0; i<4; i++) {
MediaPlayer mp = MediaPlayer.create(context, R.raw.pop);
mp.setOnCompletionListener(this);
mp.setVolume(1f, 1f); players.add(mp); // put into a pool of available players }

Android :: Media Player sluggish to Play sounds


Android :: Media Player Not Playing Sounds On Droid X

Jul 28, 2010

I have some pretty simple Soundboard applications on the Android Market that work flawless on an LG Ally, the Motorola Droid, and the Nexus One, but I recently received an e-mail from a user with the Motorola DroidX claiming that most of the sounds do not work. I've exchanged a few e-mails with him. He claims the Soundboard is the only application running, and he's double checked to make sure that the Media Volume wasn't set to minimum. I really don't have access to one either to play around with. The application isn't doing anything cosmic to play the sounds. Below is a code snippet. Any insights into what might be causing the hang up are greatly appreciated.

public void play(Sample sample) {
Log.v(TAG, "Playing: " + getString(sample.getButtonTextResId()) + " (" + sample.getSoundResId() + ")");
if (mPlayer != null) { mPlayer.stop(); mPlayer.release();
} MediaPlayer player = MediaPlayer.create(this, sample.getSoundResId());
mPlayer = player; if (player != null) { player.setVolume(1.0f, 1.0f);
player.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
@Override public void onCompletion(MediaPlayer mp) { mp.release();
mPlayer = null; } } ); player.start(); } }

View 1 Replies View Related

Android :: Playing Sounds In Game Application Using Media Player

Feb 5, 2009

I am using mp3 sound in my game (used wav format also) while playing sound I get problem as "obtainBuffer timeout (is the CPU pegged)" and then sound gets played after some time i.e it is not synchronized with the game play.

View 10 Replies View Related

Media :: Find A Media Player To Play Streaming Videos On Andro?

Sep 1, 2010

Does anyone know where to find a media player that would allow you to play streaming videos on Android Browser?

I want to know if you can play streaming videos on your web browser on your android os phone.

View 1 Replies View Related

Media :: No Media Player Will Play Music In Order As CD

Jul 7, 2010

I guess no one cares to listen to their favorite music in the order the artist intended? we now listen to timeless classic Opera in whatever order? makes no difference? Classic Rock albums out of order? Pink Floyd "Dark Side of the Moon"?

View 6 Replies View Related

Media :: Media Player Not Play Downloaded MP3 Files?

Oct 23, 2010

My application gets playlist from a XML file, requests URL of mp3 file from server, downloads and plays it. It was able to download mp3 file but unable to play it. When I used emulator with Android 2.1, it was displayed in LogCat:

[Quote]

View 5 Replies View Related

Android :: Media Player Could Not Play RTSP?

Sep 9, 2009

I create a "mplayer" to play the rtsp on the emulator. When the "mplayer" play the http ,it is ok.
MediaPlayer mplayer = new MediaPlayer();
mplayer.setDataSource("rtsp://test.intra.3g.sina.com.cn/streaming/ 20090313/wenjiabao1.mp4");
mplayer.prepare(); mplayer.start(); but when it play the rtsp, it doesn't work. The Wireshark shows UDP Checksum Incorrect.

View 10 Replies View Related

Android :: Phone Play Video In Media Player From Given URL?

Oct 24, 2009

Can anyone please tell me if Android Media Player is able to play a video that is placed in a remote server, in a supported format?

View 5 Replies View Related

Android :: Can Media Player Play .wav Fomat Audio?

Feb 16, 2009

I tried to play a piec of 16-bit .wav audio file, no sound came out from my earphone, but .mp3 file would be OK. Do any one else have this kind of experience? This is the code: player = MediaPlayer.create(this, R.raw.test); // I put test.wav in /res/raw player.start();

View 4 Replies View Related

Android :: Media Player - Play Video From Sdcard

Sep 13, 2010

I am new to android.I am trying to play a video from sdcard. this is the sample code I have used..

public class videoa extends Activity {
/** Called when the activity is first created. */
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setContentView(R.layout.main);

VideoView videoView = (VideoView)this.findViewById(R.id.videoView);
MediaController mc = new MediaController(this);
videoView.setMediaController(mc);
// (1) Web
//videoView.setVideoURI(Uri.parse(
//"http://www.bogotobogo.com/Video/sample.3gp"));
//"http://www.bogotobogo.com/Video/sample.mp4"));................Please help me out.

View 1 Replies View Related

Android :: Possible To Use Media Player To Play Streaming Audio?

Mar 21, 2010

The dev guide suggests this
MediaPlayer mp = new MediaPlayer();
mp.setDataSource(this, Uri.parse("http://wamu-1.streamguys.com:80"));
mp.prepare(); mp.start();
I can't seem to get it working though.
I'm getting "java.io.IOException: Prepare failed.: status=0x1"

View 6 Replies View Related

Android :: Media Player To Play AVI And Other File Formats?

Feb 12, 2009

Is there any support for avi and other media formats except mp4 and 3gpp? If there is no support may I develop a support through correct the program? Will that be too difficult ?I don't know where to put my hands into first, should I correct programs in opencore first or should I just correct programs in directory frameworks/base/include/ media . I want to have a clear mind how I can achieve my goal, I need a roadmap to guide me how to do it.

I am trying to get familiar with the SDK 1.0 now. another question, my chip is from freescale and it supports hardware codecs of mpeg4, h.263 and h.264, I don't know whether I can change the program or the architecture of mediaplayer to utilize my hardware codecs instead of software codecs provided by android opencore. I once implement an mplayer to my platform, there is problems about sync of audio and video due to the quality of my chips(CPU can support software codecs but is not fast enough to make sure sync of audio and video), So I am worried about when the android is implemented, there would also be the same problem, and for this reason, I am thinking whether I can utilize my hardware codecs for mediaplayer.

View 3 Replies View Related

Android :: Media Player Cant Play From Program Data Folder

Sep 22, 2010

When i record my audio from MIC and store file in /data/data/. why Media Player can't play this file ? If i change destination to / sd card/..... - all works great. I do something wrong ? I not found limitation for Media Player. Device - Samsung T959 (Galaxy S).

View 4 Replies View Related

Android :: Getting Streaming Audio To Play With Media Player Class?

Jul 21, 2010

I am currently new to android development I been working on the examples in the Dev Guide in the android website. I want to get a stream from a server I have to play in the emulator when I insert the url it doesn't seam to want to play. My question is there a way to get the emulator to play audio or is it all enabled also does MediaPlayer require a special kind of format like mp3 or ogg? his is the code i am running on my 'onCreate()' method.
MediaPlayer mp - new MediaPlayer();
mp.setDataSource(MY_URL_);
mp.prepare();
mp.start()

View 1 Replies View Related

Android :: No Update Buffering When Media Player Play RTSP?

Sep 13, 2009

Why Update buffering is always 0% when mediaplayer play the rtsp? I try to play this both on the emulator and on the device. But eveytime it shows that the Update buffering is always 0%. Could anyone give me a reason?

At last it always shows the log
E/MediaPlayer( 1455): stop called in state 4
E/MediaPlayer( 1455): error (-38, 0)
E/PlayerDriver( 1088): Command (7) was canceled

View 2 Replies View Related

Android :: Play RTSP Stream Using Media Player Or VideoView

Jul 2, 2010

I wanted to stream A/V from my machine to Android over HTTP
(http://lists.mplayerhq.hu/pipermail/libav-user/2010-July/004944.html).
But that does not seem feasible using FFMpeg. I am planning to try FFMpeg streaming over RTSP. But I am not sure whether MediaPlayer or VideoView classes on Android support RTSP playback. Is playing RTSP stream possible in simple application?

View 3 Replies View Related

Android :: How To Play Media Player With Non-file And Non-rtsp Source

Feb 15, 2010

We've a mpeg4 source that we would like to play in the media player. Our source is not in a file or on an rtsp server. It is hand coded to generate mpeg4 source on the fly. Imagine the data is coming from an unix pipe stream instead of rtsp or a file. How can I use that stream in media player?

View 1 Replies View Related

Media :: Which Player Will Play .mov Files?

Jul 15, 2010

As the headline say:How can I play .mov files on my HTC Desire?

View 3 Replies View Related

General :: Air Play Media Player

Feb 8, 2014

I'm looking for an app or combination of apps where I can find a link to a movie online, stream it on my phone then using air play push it onto my tv. They only released the sony screen mirroring app to a couple of sony xperia phones so I cant use that. I dont want to have to download the movie first either.

View 2 Replies View Related

Media :: Player - Converter To Take A DVD And Play It With Menu / All?

Nov 3, 2010

I am interested if there is any programs out there that mimic the DVD player. On a DVD you first start off with a Menu then can decide to either play the movie or see different interviews ect. Is there a player or a converter that allows you to take a DVD and play it with menu and all?

View 3 Replies View Related

Media :: Stock Music Player / Play Ringtones Too?

Sep 6, 2010

I am using the stock music player. Why does it also play the ringtones that I have added to my SD card?

View 2 Replies View Related

HTC Hero :: Media Player To Play .flv Files Without Having To Convert To .mp4 / .3gp?

Apr 18, 2010

Anyone know of a media player that will play .flv files without having to convert to .mp4 or .3gp ?

Seems strange that youtube streams fine, but you can't play the downloaded files in the default media player.

View 3 Replies View Related

HTC Hero :: Media Player Apps Which Can Play AVI , Mpeg , DivX , FLV?

Jan 25, 2010

Are there any MEdia Player Apps. which can play AVI, Mpeg, DivX, FLV, etc?

View 3 Replies View Related

General :: Play Windows Media Player Embedded In Webpage?

Jun 5, 2013

I need to embed windows media player in a web page and show streaming video from my server with a url. I have WMP on my phone and the video streams through it fine. Is there any way to embed this now in a web page? It does not play. Do I need a special plugin or what?

View 2 Replies View Related

Android :: Media Player On HTC Hero Misbehaving And Intercepting Bluetooth Media Buttons

Jan 10, 2010

Even registering the broadcast receiver at the highest priority still fails to receive the Bluetooth media button events on the HTC Hero phone. The Bluetooth media button registration code works fine on the other Android phones that I have tested. Apparently this isn't the first time HTC has done something like this, as I also found a report of a similar problem on one of the HTC Microsoft Mobile Devices reported here

It seems extremely short sighted of HTC to code their media player so that it grabs the Bluetooth AVRCP media button events in such a way that other applications are unable to work with the Bluetooth head phone buttons and Bluetooth in car stereo systems.................

View 2 Replies View Related

Media :: How To Sync Android To Windows Media Player (including Playlists)

Nov 10, 2010

I use Windows Media Player to manage all my mp3s and playlists. I want my Samsung Galaxy S to be synchronized with my PC. I can connect my Galaxy S using "Media Player" mode and use the built-in sync with WMP, but there are issues:
1) Some mp3s get "corrupted" - how do I force WMP to "re-sync" them without losing my playlist association (if I manually add it as a file to sync, it is no longer associated with the playlist)

2) If I delete an mp3 from the device, WMP doesn't realize and won't re-sync the file again... is there a way to re-sync?

3) Sometimes WMP will re-sync playlists and each song shows up 3-4+ times when I load up a playlist on my device. I then have to wipe the Music and Playlist folder and re-sync from scratch any way around this?

4) Where are android playlists stored? The Playlists folder on the sd card can be wiped, but the playlists still show up in the music player?

5) If I make a change to a playlist on my PC, WMP will freeze and start skipping random files the playlists get corrupt and I see problem #3 occur. Essentially, if I change a playlist, I have to wipe the Music and Playlist folder and re-sync from scratch.

View 7 Replies View Related

Android :: Best Way To Play 10 Sounds Quickly

Oct 21, 2010

I am trying to play the same 10 sounds very quickly and wondering what is the best way?
1. Make 10 media players
2. Make 1 media player and set the sound each time
3. Use a soundpool?

View 3 Replies View Related

Android :: Play 2 Sounds At Once With Different Applications?

Jun 3, 2010

Is it possible to play audio via an app like slacker.com or pandora.com or your personal audio files and simultaneously play another audio track over the top of it with a second app? My question is whether the sound hardware gets locked by the first app that accesses the audio hardware or whether a second app can access the hardware simultaneously, too.

View 2 Replies View Related

Media :: Converting Videos Recorded With MT3G For Use In Windows Media Player / Movie Maker

Apr 8, 2010

I want to be able to use/view the video's I record with my phone on my computer. (open from an email or use in window's movie maker)I have a new computer with Windows seven at work and a Vista laptop at home. I can send the video to myself and try to open in from my email or tether to the computer and transfer the file manually. Either way I can't open with windows media player. Video's taken with default "Camcorder" app on a myTough 3G running Android 1.6.I know it has something to do with the codec's the phone uses but wonder why they wouldn't use codec's that are compatible with the most commonly used pc's?Is there any way around this? Some kind of converter for the computer or for the phone?Is there another camcorder app that can record video with a different codec or is it phone hardware specific?So far have been able to use these forum's to sort out most of my Android problems but I'm stumped on this one. It doesn't seem like it should be this hard to do. Should be more user friendly.

View 5 Replies View Related

Media :: Sync Music With Itunes And Windows Media Player

Jun 7, 2010

Sync Music to Nexus One using itunes and Windows Media Player. This process automatically creates a Music folder at the root level of the SD card. Hopefully some of you find this useful, especially coming from using iTunes Read more

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved