Android :: AudioTrack Cutting Audio Short

Dec 15, 2009

I am trying to play a 0.1s tone using audio track. I have done this succesfully in stream mode by calling play() then writing the array of short containing the data. However when I use STATIC mode and also in stream mode if I write the data before i call play() only about 0.06s of the audio is played. I have tried changing the buffer size but this has not effect.My understanding is that I have to write the data before I call play for static mode to work. Does anyone know what could be going wrong here?

Android :: AudioTrack cutting audio short


Android :: Audio Stuttering When Using AudioTrack

Apr 13, 2010

I'm in the process of wring a music player that can play SID tracks (music from the Commodore 64), and everything is progressing nicely, except that I sometimes get audio stuttering.The stuttering only happens when the player is in the background, and another application has focus. It's most noticeable when a cpu heavy app(like Google Earth) is running in the foreground.I have tried adjusting the priority of my thread and increasing the AudioTrack buffer size, but nothing has solved the stuttering problem.I believe the problem is that generating the audio takes quite a lot of cycles (I'm at 15-30% cpu load), and that my audio thread is being starved and cant keep up with AudioTrack's constant need for data.I'm must be doing something wrong, I can't imagine that gui threads should be able to starve a high priority audio thread.I hope someone have some ideas on how to get my player stutter free, as I'm at a loss :)

View 9 Replies View Related

Android :: Continuous Raw Audio Playback Using AudioTrack

Dec 29, 2009

I am trying to play raw audio samples ( 16 bit, stereo, @ 32000KHz) using AudioTrack, in "MODE_STREAM" mode. I could play the first video buffer successfully but, After having received "onMarkerReached" for that raw audio buffer, I wonder how to push more audio data in AudioTrack ? without closing/stopping it. Writing more data to AudioTrack in "onMarkerReached" callback does not help. I am using the same thread to construct the AudioTrack and pump in audio - buffers and receive callbacks.

View 2 Replies View Related

Android :: Low Level Audio - Latency In SoundPool - AudioTrack For Real Time

Oct 26, 2009

I first have to say that I'm biased, 'cus I like to write music apps (like music generation apps). However, this affects games as well. It's somewhat disappointing how OpenGL has made it into the NDK now but there isn't any NDK methods to get to sound to have faster access. Over the weekend I did some more testing and if you make a "drum" app, for example, and play the sound using either SoundPool or AudioTrack, you will get about a 100ms delay buffer, which is clearly audible (gap).

I made a test app where when you touch the screen, upon the DOWN event, it would play a short sound (like a drum sound). It clearly was not real time responsive or even close - you could hear the delay. I'd be interested to know if anyone who has made a game has any trouble with sounds? It seems like they aren't going to really trigger real time enough if you use SoundPool, for example. Am I completely wrong? Seems like your game is going to perform an action, play a sound, but the sound will have latency which I would think would throw off the game a bit..................

View 12 Replies View Related

Android :: AudioTrack Stop/release - AudioTrack Plays In The STREAM Mode

Dec 25, 2009

I need to stop the AudioTrack, regardless what's in the buffer, immediately when executing the stop/release. The AudioTrack plays in the STREAM mode. It appears that the AudioTrack finishes playing what's in the buffer and than stops. It seems that it's such a fundamental flaw since there are so many audio applications out there.

View 4 Replies View Related

Android :: Playing Short Audio Clip Has Tick Sound

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

Android : 2.2 Cutting Off MediaPlayer

May 21, 2010

Suddenly, when playing audio using MediaPlayer in an Android 2.2 emulator, the audio seems to be getting the last 5-10% cut off. I'm using the exact same code from previous API's, with just what is below for mp3 playback. I changed the API level of my app to 2.2 for external storage, but the app still runs perfectly on any emulator using <=2.1 and on my Moto Droid.

MediaPlayer mp = MediaPlayer.create(this, playMe); mp.start();

View 3 Replies View Related

Android :: How To Use AudioRecord And AudioTrack?

Apr 30, 2009

I want to use AudioRecord and AudioTrack classes(in SDK 1.5) in my program. Where can I find how to use it. Is there any API demo program for this?. If not it is greatly appreciated if someone can post a sample code in this forum.

View 7 Replies View Related

Android :: How Do We Use AudioTrack Class?

Apr 23, 2009

I'm currently initiating the AudioTrack() for MODE_STREAM. I load some bytes using the write() and I see that it is working but once hit the play() call nothing happens. what is the matter? should I do something else that is not obvious? Any tips Google friends? My settings: streamType - STREAM_MUSIC sampleRateInHz - 44100 channel Config - CHANNEL _CONFIGURATION_STEREO audioFormat - ENCODING_PCM_16BIT bufferSizeInBytes - 256K the total size (in bytes) of the buffer where audio data is read from for playback. mode - MODE_STREAM.

View 21 Replies View Related

Android :: How To Play Music From AudioTrack

Feb 15, 2010

I want to play music from online mp3 link.I am reading the music data into a stream and trying to play it using audio track. But itz giving only noise.No music i could listen.Same buffer I can play in Media Player,But i could not play in audio track.

View 16 Replies View Related

Android :: AudioTrack - Clicking Sound

Dec 15, 2009

I am getting this clicking sound when playing static pcm data. Anybody out there is having the same problem? This is not the data issue.

View 7 Replies View Related

Android :: Synchronizing AudioTrack And AudioRecord

Jan 21, 2010

My application uses AudioTrack in streaming mode and AudioRecord simultaneously.My problem is that I start them at the same time, but I have no guarantee that they will actually start playback ecording in the same timestamp. The reason I need this kind of accuracy is because I use echo cancellation (subtracting audio played to speaker from the recording).My echo canceller doesn't require an exact delay, but the delay introduced between AudioTrack and AudioRecord moves in the range of 250ms (between different runs), and that's too much - each run is different because they start themselves asynchronously. The API doesn't provide me a way to make sure they start in the same time, so I thought about measuring this starting delay somehow and then using it in my calculation.Does anyone have an idea how to do that, utilizing their API or in any other way?

View 2 Replies View Related

Android :: Memory Leak In AudioTrack?

Jun 27, 2009

If I create and release multiple AudioTrack objects, the GREF count continually increases which eventually causes an application crash. Even with a forced garbage collection, I end up with the same high GREF count at the end of the loop.In my application, I continuously create AudioTracks from variable lenght buffers.I guess I can try and use a fixed size pool of AudioTracks each with a buffer large enough to fit my longest sound, and try and reuse them.Is there a better/correct way to completely clear resources used by an AudioTrack?

View 5 Replies View Related

Android :: How To Realize AudioTrack Class In SDK 1.1?

Aug 10, 2009

There is a AudioTrack Class in SDK 1.5 which can play PCM buffer directly.But it is not exist in SDK 1.1. I want to play PCM buffer in SDK1.1,but i don't know how.

View 2 Replies View Related

Android :: AudioTrack Sanity Test

Oct 2, 2009

I am trying to determine if I should go the ndk way to work on a music synth app, but first wanted to do a sanity check in the java layer by testing how many sine tones i could play concurrently, and so I tried this. And it's pretty low: I can only play about 4 or 5 tones before the obtainBuffer timeouts start increasing in number. Also, changing the media volume while the tones are playing disrupts the output.

View 3 Replies View Related

Android :: AudioTrack - Clicking Error

Jan 21, 2010

I am trying to resolve the clicking problem while using the AudioTrack. It takes place only when playing the first part of the wave (pcm) buffer when the offset to the write is 0 (zero). track.write(buffer, offset, minBufferSize); It tells me that there is something wrong with the pcm data. Could it be because the wave data, I generate using Audacity, has some header as opposed to the pure pcm which does not? I was looking for the converter tools to generate pure pcm but found none. Applications I found generate only wave data so I am not able to test this assumption. At this point I am sure that filling the buffer is correct. Any ideas?

View 2 Replies View Related

Android :: Service + AudioTrack - WAKE_LOCK?

Jan 25, 2010

I'm currently writing an app that uses a Service. A thread in the service generates an infinite stream of audio, and writes it to the AudioTrack. I want the audio to keep playing indefinitely until the user stops it. Based on my understanding of the PowerManager class, it looks like I should need a PARTIAL_WAKE_LOCK to keep the CPU awake so the audio can continue playing.

However, I left the audio playing on my phone with no wake lock, running on battery, in airplane mode, with all five items on the power control widget disabled, and the audio just kept right on playing for at least 15 minutes. Afterwards, I looked at the battery history, and it showed "Running (100%)", even though the Partial wake usage was negligible. Is there something special about AudioTrack which prevents the CPU from entering its deep sleep state? Should it be necessary for my service to grab a PARTIAL_WAKE_LOCK and its associated permission?

View 2 Replies View Related

Android :: AudioTrack Stop - Release ?

Dec 16, 2009

It doesn't seems as if the the stop and release immediately terminates the audio played by the MODE_STREAM track. It looks like it finishes playing the rest of the buffer and then stops.

View 3 Replies View Related

Android :: Displaying Long String In Spinner Without Cutting

May 11, 2010

In my current app, if the string is too long and doesn't fit into screen it gets cut. How to display rolling text for long strings in a spinner(i have seen that in some apps)?

View 2 Replies View Related

Android :: AudioTrack Start Called From Thread

Dec 8, 2009

I am getting the 'AudioTrack::start called from thread' when starting an AudioTrack. I am using it in a thread. I asume I shouldn't but why? I see it as a major limitation.

View 4 Replies View Related

Android :: Is AudioTrack Fundamentally Designed To Be Singleton?

Dec 14, 2009

Is the AudioTrack fundamentally designed to be a singleton? Methods on the OnPlaybackPositionUpdateListener receive just one argument, which is the AudioTrack itself. And since the AudioTrack does not have getTag/setTag methods I don't see any way to distinguish among multiple AudioTracks in the OnPlaybackPositionUpdateListener methods short of keeping track of references. So, if it's so why it's not implemented as a singleton? Any thoughts. I am trying to implement concurrent use of the AudioTrack. Anybody has any experience with this approach? Am I wasting time?

View 3 Replies View Related

Android :: Increase Speaker Volume Using AudioTrack

Jun 26, 2009

how to increase the volume of speaker using AudioTrack? the streamed audio is playing in speaker, but not loud as voice call. Here my code..............

View 2 Replies View Related

Android :: ObtainBuffer Timed Out In AudioTrack.write

Sep 1, 2010

After stopping and restarting playback of an audiotrack stream, on some devices I consistently get;

W/AudioTrack( 2453): obtainBuffer timed out (is the CPU pegged?) 0x64acc0 user=00010000, server=00000000

after freezing for a couple of seconds. This happens whether I just pause() and flush() my audiotrack or release() and recreate it.

View 4 Replies View Related

Android :: AudioTrack - 51 - WARNING - ObtainBuffer() Timed Out

Nov 4, 2009

I am using MediaPlayer to play background music and SoundPool to play sound effects. All Audio data is stored in .ogg file format. Sometimes it happens that the MediaPlayer playback is interrupted for a fraction of a second if SoundPool.play() is called. Whenever this happens, the following two warnings are printed to logcat:

11-04 01:49:05.113: WARN/AudioTrack(51): obtainBuffer timed out (is the CPU pegged?) 0x2b6e8 user=000cc520, server=000cb710 11-04 01:49:05.113: WARN/AudioTrack(51): *** SERIOUS WARNING *** obtainBuffer() timed out but didn't need to be locked. We recovered, but this shouldn't happen (user=000cc520, server=000cb710)

Do you have any ideas what could cause the warning messages and/or how to avoid them? I.e. how to prevent SoundPool.play() from interrupting MediaPlayer playback?

An other warning that's sometimes appearing is: 11-04 01:55:49.793: WARN/AudioFlinger(51): write blocked for 89 msecs There seems to be no connection to the above messages, but do you have any ideas what causes this message and/or how to avoid it?

Here's some more detailed background information, maybe they are useful: My OpenGL powered game is split into three threads: One for rendering, one to take care about the game logic and the main thread to process user input. All Audio data is accessed through a central AudioManager class, which is only used in the game logic thread. (So this does not seem like a threading issue. Needless to say that synchronizing all methods has not solved the problem). The game runs smoothly at ~60 frames per second. According to DDMS the game causes ~33% system load (~10% in kernel space and ~23% in user space) on a G1. Even the idle task gets ~24% CPU time assigned while the game is running and input happens through the touch screen! (So it does not look like a performance problem) The MediaPlayer playback interruption always happens if SoundPool.play () is called in response of a touch screen input. Although touch screen input and SoundPool.play() happen in different threads. I've tried suspending the UI thread for various different delays between 8 and 32 msec after a MotionEvent has been processed, but again, without success...

View 3 Replies View Related

HTC EVO 4G : BlueTooth Earpiece Cutting Out

Aug 29, 2010

Anyone else having an issue with a bluetooth headset cutting out on the Evo. It started on a call and got so bad I ha to switch to the handset. it also did it playing MP3s right off the phone. This was a $90 motorola unit. So I took it back and picked up a nice Jabra for about $80 (just showing these aren't cheap units). I have not used the Jabra for a call yet, but the music cuts in and out for a few seconds every minute or so. Phone was in the holster on my hip so it wasn't a distance issue, the music is stored on the phone so it isn't a bandwidth thing.

View 1 Replies View Related

HTC Incredible : Phone Cutting Off

Apr 29, 2010

My new in credible keeps cycling on and off. No idea how long until it does it again

View 1 Replies View Related

Android :: Playing AudioTrack Multiple Times Producing Crash

Mar 16, 2010

I am trying to play audio buffered sound (.wav) using AudioTrack. Please see the code below. I need to call this function under a Thread to support simultaneous play. It is fine being under a Thread. It is working fine playing the sound normally. But if i execute playing the sound using AudioTrack one after another continuously (i.e. executing second play before completing the first play sound), produces device crash (force close unexpectedly error). Does anyone come across such problems and resolve it in a way?

View 1 Replies View Related

HTC Hero :: Calls Cutting Out After Few Minutes

Oct 4, 2010

Had problems with their Hero cutting out during a call? After a few minutes (less than 5) I find I can't hear the other person and then it cuts out. I'm on my second Hero (first one had touch screen problems galore). I love my phone but I'm reduced to using it for email and text as I haven' t got the energy to fight with T Mobile again....

View 1 Replies View Related

HTC Droid Eris :: OTA - Sound Cutting Out

May 16, 2010

I was wondering if anyone that got the OTA has experienced the no sound bug yet. I am currently stuck on leak V3 and several times a week I have to reboot my phone due to the sounds cutting out.

View 2 Replies View Related

HTC Incredible : Blinking LED/Charger Cutting In And Out

Sep 8, 2010

I only noticed this after I installed the 2.2 update. Now, sometimes when I plug the charger in, the LED blinks amber. It is not just the LED blinking, it is blinking because it charges for a second, then stops, then charges, etc. It does this with the OEM AC charger, and any other charger I use, however, it does not do it all the time, it seems random. When it is doing this, it doesn't actually charge. I turn the phone off, plug the charger in, it's fine, turn the phone back on, still fine. It's somewhat annoying. Anyone experience this or know what's going on? It's definitely not an overheated battery.

View 2 Replies View Related







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