Android :: Unable To Play Short MediaPlayer Sound
Apr 23, 2009
I have this task: Need to play short (0.3-0.4 sec) sounds all the time. When sound is played, it should start again, etc. User can press button to reset sound - it should stop and lunch.
I did many tests. I tried to create 1 MediaPlayer, then do this: MediaPlayer.OnCompletionListener complListener = new MediaPlayer.OnCompletionListener; code...
It works great on emulator and on device if I have eclipse+debugger on. When I disconnect debugger, I have very strange errors - sound can stop at all (till program restart), sound can start "repeating" (play 0.1-0.2 sec, then restart). Can someone please provide me some info about problem?
View 5 Replies
Oct 3, 2010
I have an app that worked fine on Android 2.1 (Eclair) but is no longer working in 2.2.1 (Froyo). I think this may have to do with the shift from OpenCore to StageFright for video encoding and decoding, but am unsure.
The debug logs show two things I'm not sure about:
Does this mean H.264 baseline is not supported? WARN/QCvdec(59): Parsing Error unsupported profile or level No idea about: ERROR/PVOMXVidDecNode(59): Ln 1373 OMX_EventError nData1 -2147479542 nData2 0
Play the following url (it works fine in VLC, for example): rtsp://nexus3.dropcam.com/6821ec44e37846428850ec195d69969a
The code:.........
The debug result:
CODE:................
View 3 Replies
View Related
Dec 14, 2009
I'm using the SoundPool to play a series of small audio clips and am having issues with the audio when it starts. I have the audio attached to a button press. When I press the button mulitple times the tick persists. I was wondering if this was the audio file itself or is there something I need to do differently with the SoundPool other than play simply play the clip. These are .ogg files I created using Audacity. When I play them in my dekstop media player, they sound fine.
View 2 Replies
View Related
Mar 10, 2010
I need to use MediaPlayer to play some sounds, as they were too large in size for the SoundPool class.
The constructor takes a single sound file. I have, potentially, around 20 files that I want to play, randomly and instantly, like sounds in a game.
Do I have to create a new MediaPlayer object for each sound? i.e...
MediaPlayer mp1 = MediaPlayer.create(context, R.raw.sound1); MediaPlayer mp2 = MediaPlayer.create(context, R.raw.sound2); MediaPlayer mp3 = MediaPlayer.create(context, R.raw.sound3); MediaPlayer mp4 = MediaPlayer.create(context, R.raw.sound4);
That seems expensive...
View 6 Replies
View Related
Jul 20, 2010
I downloaded an application named Todderlock so my children could just meddle around with my phone while they sat in my lap. However, the sound stops working after a non-specific amount of "dings" when either tapping the shapes around the screen, or when dragging your finger along the screen to make the same type of noise, but much more rapidly.
Thinking this was an application problem, I had my wife download Todderlock on her HTC Hero, and the sound works without issue.
So, I shrugged that off and went looking for other neat applications to download...I downloaded Bug Squash I, II and III and they all suffer from the same problem: after squishing X amount of bugs, the SFX stop (the music continues however), and I have to restart the application to enjoy the sound for as long as it lasts.
I was getting suspicious, so I loaded up Robo Defense FREE and the same thing happens when the turrets are firing...after X amount of shots fired, all sound ceases to work.
I have not been able to find a similar problem with the HTC Evo on Google or here on the Android forums, considering my wife's Hero works without issue on all the sound issues I am having.
As far as I know, phone notifications and ringers continue to work after the application has "disabled" the sound. I have not reset the phone to factory settings or anything, but I have restarted the phone itself numerous times, and the problem still persists.
View 1 Replies
View Related
Jul 19, 2010
is there a way to find the 'noise produced' by a currently playing sound (MediaPlayer) -Like in many music editor software you import a song and it does a graphical layout of the song -like a graph with it higher up at louder bits. Hard to explain. But there must be a way to do this on android...
View 1 Replies
View Related
Feb 14, 2009
I'm just trying to play a local video that is a resource with the MediaPlayer class in the most simple way possible. I have confirmed that the video works with players that I download from the marketplace, so I'm assuming that's not the issue.
The problem is that I just get a black screen with no video. There is audio from the file playing though, so I know that the file resource is being accessed correctly, it's just not showing anything on the screen in the emulator.
The one other note is that at any time whenever I try to access getVideoWidth() or getVideoHeight() I get this (non-blocking) error:
ERROR/MediaPlayerService(24): getVideoSize returned -1
Any ideas as to what I could be doing wrong?
import android.app.Activity; import android.os.Bundle; import android.view.SurfaceView; import android.view.SurfaceHolder; import android.media.MediaPlayer;
Code...
View 9 Replies
View Related
Apr 28, 2009
Could I somehow trick the player on playing something of this format? I know that there is support for AAC encoded files but just how?
View 2 Replies
View Related
Jul 3, 2009
Recent news say that flash porting is finished for android and HTC Hero has support for flash. Can I use MediaPlayer API to play flv media file? Is there such documents?
View 3 Replies
View Related
Jan 6, 2010
Why does my MediaPlayer
MediaPlayer mp = MediaPlayer.create(this, R.raw.somemusic); mp.setLooping(true); mp.start();
stop, wenn I change the layout?
setContentView(R.layout.screenoptions);
and also suddenly in my game, the sound stops. What could be the reason?
And which one is better? MediaPlayer or SoundPool?
View 2 Replies
View Related
Jul 10, 2010
In my application, RTSP streams play only sound without video, but if i specify the video path as a local file, it plays the video and audio.
How would i get the RTSP streams to show video?
CODE:.................
View 2 Replies
View Related
Jul 22, 2010
I am able play a media using MediaPlayer. The media played via the ear piece. But how can I play the media with speaker phone? e)But that does not work. And I have added this to my Manifest file.
View 7 Replies
View Related
Jan 18, 2010
Is it possible to have two instances of MediaPlayer to play sounds/ video? How many instances are actually allowed? I can see from the Javadocs that there is a limited amount of instances of MediaPlayer allowed.
View 3 Replies
View Related
Nov 8, 2010
In my music app, i would like to play live streaming like radio broadcasting with mediaplayer as Mediaplayer mp = new Mediaplayer(); mp.setDataSource(LiveStreamingURL); mp.prepare(); mp.start(); but after playing for few seconds it is stopped. I dont know how to overcome it. Give me your suggestions for this.
View 3 Replies
View Related
Jun 12, 2010
I am unable to attach even short videos to send via text message, or whatever you want to call it. it says that the files are too large attach. i have had success in teh past with other phones having this feature, so i guess i sort of figured id be able to do it on this phone.
View 4 Replies
View Related
Dec 3, 2009
Can anyone tell me if the Android MediaPlayer class is able to play a video stored in a remoted URL? Just for testing purposes, can I use the URL http://localhost/video-name.3gp. Another question is if the MediaPlayer works well on the emulator?
View 2 Replies
View Related
Apr 27, 2009
I have a requirement to play several sounds many times in my game so instead of creating the MediaPlayer again and again I have called mp.seekTo(0) in onCompletion(mp) so that it will restart. Sometimes the sound is not audible from the device when I call mp.start () after setting mp.seekTo(0); but the player calls onCompletion() without playing any sound, this is observed randomly on most of the sounds
My sounds are of short duration mostly less than a second.
I am using a separate MediaPlayer for each sound (as I need this) -
There are almost 28 sounds in my game so i will be creating 28 MediaPlayers.
Below is the attached code for player
Also If I try to play many sounds one after the other in a short period of time i get an error saying "no more track names available". can u tell Why this is happening...?
check the below code:
CODE:........
View 9 Replies
View Related
Apr 28, 2010
I took out the 8GB SD card from my Blackberry Storm and put it the Incredible.
I had a bunch of music saved on my SD Card that I downloaded from VZW Music Media thing.
When I go to music on the Incredible and go over the song (it shows the picture of the album of the song)
it says "unable to play this type of audio"
View 10 Replies
View Related
Mar 16, 2010
Im making an app, and i want it to make a sound when a activity is opened , the sound file is in R.raw.sound_file , if someone could do some example code to make my app play a sound that would be great.
View 1 Replies
View Related
Jul 22, 2010
Can we play sound file in phone line (in background)?
View 4 Replies
View Related
Jun 24, 2009
Since i don't want to have double entries, but would like a fast spreading, here's my post:
http://groups.google.com/group/android-beginners/browse_thread/thread...
View 2 Replies
View Related
Aug 28, 2010
I'm trying to use a ListPreference to decide which sound to play on a button click.
I have this at the top:
public String greensound;
Here's my OnClick code:................
I also tried removing the default value here it didnt seem to change anything but, should it be removed?
Here's my Settings.java:
package com.my.app;
CODE:...........
And here's my array's if that will help at all:
CODE:............
Here's a logcat that kinda looked possibly related:
CODE:..........
For those that might ask here's my DDMS > File Explorer > Data > Data > packageName > SharedPreferences This is what was in there:
com.my.app_preferences.xml:
CODE:...................
This all really confuses me more because...It looks like greensound does == gsone so.... I don't understand whats wrong its not even playing the default sound. and yes i've tested all this code without the listpreference code and they work great. I'm not sure what's wrong?
View 1 Replies
View Related
Aug 27, 2010
I have an Android app which needs to play a sound resource on a timed interval, say every 120 seconds. I know how to access the sound resources and play them, however it's time timer part I'm not sure of. What's the best approach?
View 1 Replies
View Related
Aug 28, 2009
I am playing one audio file when call arrives so the caller can receive it at other side but the issue is yet the opposite caller is not able to listen it what could be wrong in it. Can some one tell me what can be the issue in it ?
View 2 Replies
View Related
Aug 26, 2010
In my class I have an OnTouchEvent and when a certain area is clicked, it will play a sound (Not sure if this is the best way to go about this?). However I have been running into bugs using the MediaPlayer. Sound will double play and then eventually sound will stop completely. I am wondering how to efficiently play 5 sounds. The user will be clicking the screen in different areas and different sounds will be playing. I have the attached code below but it only has the first area. Say I add in another area how would I go about changing the media player to play a different sound.
@Override public boolean onTouchEvent(MotionEvent e) {
x = e.getX(); y = e.getY();
if (x >= 232 && x<=287 && y>=117 && y<=157) {
//PLAY SOUND } return true;
View 2 Replies
View Related
Oct 10, 2010
Could it be possible now, which we can develop an Android application having the following requirement for its working steps Automatic receive the call, then Play some sound out to the caller, wait for DTMF response, then Record the caller sound (in the case that they permit, by pressing 1 as DTMF response)Callee can play back the recoreded sound later.
View 1 Replies
View Related
May 18, 2010
Is there any way to play a sound file under Android browser?
View 1 Replies
View Related
Mar 2, 2010
I would like to play native camera shutter sound clip on camera preview capture. I'm referring to the sound clip played when takePicture() is called. How could I that? Can someone walk me through the steps?
View 3 Replies
View Related
Mar 28, 2012
What sound files is android allowed to play?
View 2 Replies
View Related
Jul 22, 2010
What could be the reason that a mp4 video file without sound doesn't play correctly when using the VideoView class? The video plays just fine in vlc, mplayer and ubuntu media player. It has been created on the device using ffmpeg. It is like 5 seconds long, so nothing especially big. Codec is H263 with AAC-Audio, though the audio signal is just empty. The problem is, that the video plays, but the image doesn't change, or at least doesn't change a lot. It seems more like a still image, though small movements is sometimes visible but not at all what has been encoded. I noticed that the VideoView stops playing but the time continues to step up, so it doesn't stop counting after 5 seconds but just goes on counting.
I'm using the emulator. Can that be related? I see the following messages in logcat:
CODE:......................
View 3 Replies
View Related