Android :: Buffer Size For Audio Track

Jun 17, 2009

This may be impossible but is there any way that I can get a smaller buffer size for AudioTrack than what is provided by getMinBufferSize method?

This is how I am instantiating AudioTrack right now: SR = 44100; bufSize = AudioTrack.getMinBufferSize(SR, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT); audioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, SR, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT, bufSize, AudioTrack.MODE_STREAM);

With sample rate of 44100, getMinBufferSize always returns 4800. If I try to make the buffer size smaller than 4800 then I get the following error message: E/AudioTrack( 318): Invalid buffer size: minFrameCount 1200, frameCount 600 E/AudioTrack-JNI( 318): Error initializing AudioTrack E/AudioTrack-Java( 318): [ android.media.AudioTrack ] Error code -20 when initializing AudioTrack. D/AndroidRuntime( 318): Shutting down VM W/dalvikvm( 318): threadid=3: thread exiting with uncaught exception (group=0x4000fe70) E/AndroidRuntime( 318): Uncaught handler: thread main exiting due to uncaught exception I/CheckinService( 59): From server: Intent { action=android.server.checkin.FOTA_CANCEL } E/AndroidRuntime( 318): java.lang.RuntimeException: Unable to start activity Does anyone has any ideas how to over come this problem?

Android :: Buffer size for audio track


Android :: Invalid Audio Buffer Size On Samsung Galaxy

Nov 14, 2009

The following works fine on a G1 but gives an error on the Samsung Galaxy. I was hoping cross-platform support would be better than this. See error below.

private final static int RATE = 44100; private final static int CHANNEL_MODE = AudioFormat.CHANNEL_CONFIGURATION_MONO; private final static int ENCODING = AudioFormat.ENCODING_PCM_16BIT; private AudioRecord recorder_; public boolean open() { int bufferSize = 4 * AudioRecord.getMinBufferSize(RATE, CHANNEL_MODE, ENCODING); recorder_ = new AudioRecord(AudioSource.MIC, RATE, CHANNEL_MODE, ENCODING, bufferSize);

last line gives the following on the Samsung Galaxy phone: 11-14 19:04:07.507: ERROR/AndroidRuntime(7617): java.lang.IllegalArgumentException: Invalid audio buffer size.

View 5 Replies View Related

Android :: System Log Buffer Size

Feb 11, 2009

I have the following problem: I'd like to see the system log of two days ago and I cannot. I see only 3 last hours. How can I configure the system log size, location, severity?

View 6 Replies View Related

Android :: Any Way To Change LogCat Buffer Size?

Jan 30, 2010

Is there a way to change how big the logcat buffer is? or how much is buffered back? Especially when using DDMS.

View 3 Replies View Related

Android :: How To Capture Audio Data From Mic Into A Buffer?

Sep 24, 2009

I am working on a packet switched network. I want to capture the audio data from mic into a buffer at a desired sample rate.How can I capture the audio data from mic into a buffer instead of a file? Also how can I control the audio capture rate as per the desired sample rate?

View 2 Replies View Related

Android :: Buffered Input Stream Buffer Size

Jul 5, 2010

I use BufferedInputStream in my code: socket = new Socket(ip, Integer.parseInt(port)); socket.setReceiveBufferSize(64000); output = socket.getOutputStream(); input = new BufferedInputStream(socket.getInputStream(), 64000); I read incoming packets like this: if (input.available() != 0) { System.out.println("Get Packet: " + input.available() + " bytes"); byte[] b = new byte[input.available()]; input.read(b); incParser(b); }

View 2 Replies View Related

Android :: Java.lang.OutOfMemoryError On Audio Buffer

Mar 4, 2010

I am currently trying to create an Android application that loops Audio from the mic to the earpiece, I can do that perfectly but when I do it over and over again in my application I eventually get an Out Of Memory Error.

Here is the code I use to create the Audio Loop:

CODE:.................

And here is the error I get:

CODE:........................

So the Error specifically focuses on this line in the code

CODE:.................

And it happens after I try to do the Loop several times, so say I start the application and after 10 times starting the loop I get the error.

So I think the buffer is simply becomiing full or something?? Is that correct? If so how would I keep clearing out the buffer?

View 1 Replies View Related

Android :: Continous Audio Recording In Memory Using Circular Buffer / SDK?

Jan 16, 2010

I'm writing an App that needs to continuously record audio in memory and email the last 30 seconds of audio when required. Much of the mediarecorder API is designed to store linear audio in files. Could anybody point me towards a way to continuously record audio in memory, using a circular buffer using the SDK?

View 2 Replies View Related

Android :: Dalvik Message - Default Buffer Size Used In BufferedInputStream Constructor

Aug 17, 2010

When I used BufferedInputStream and I specify a buffer size, Dalvik gives me this warning - Default buffer size used in BufferedInputStream constructor. It would be better to be explicit if an 8k buffer is required.
But right now, my buffer size is already at 8k. What am I doing wrong?

View 1 Replies View Related

Android :: Change Internal Buffer Size Of Data Input Stream

Apr 1, 2010

I'm using this kind of code for my TCP/IP connection:

sock = new Socket(host, port);
sock.setKeepAlive(true);
din = new DataInputStream(sock.getInputStream());
dout = new DataOutputStream(sock.getOutputStream());

Then, in separate thread I'm checking din.available() bytes to see if there are some incoming packets to read. The problem is, that if a packet bigger than 2048 bytes arrives, the din.available() returns 2048 anyway. Just like there was a 2048 internal buffer. I can't read those 2048 bytes when I know it's not the full packet my application is waiting for. If I don't read it however - it'll all stuck at 2048 bytes and never receive more. Can I enlarge the buffer size of DataInputStream somehow? Socket receive buffer is 16384 as returned by sock.getReceiveBufferSize() so it's not the socket limiting me to 2048 bytes. If there is no way to increase the DataInputStream buffer size - I guess the only way is to declare my own buffer and read everything from DataInputStream to that buffer?

View 4 Replies View Related

Android :: How To Record Audio From Mic In Raw Pcm Format Into A Buffer Using Native Libraries Directly

Oct 9, 2009

My application cannot handle the JNIE overhead, as I need to make 2 JNIE calls to the native C/C++ code for every 20msec. So I am trying to use the native media libraries and the realted C/C++ files provided by Android in the folder "//external/srec/audio/test" of the donut build. Ex. AudioHardwareRecord, AudioInRecord etc.. I am implementing all the calls in the native layer.

I am using the sampling rate as 8000 and want to read 160 samples (320 bytes) at a time.

I used the following values to create the AudioRecord..

CODE:..........

It says "success" after creating this interface but I am getting the error "Bad Value" if I am doing the InitCheck.

And it is crashing once I start reading the samples or if I try to retrieve the configured sampling rate.

Has anybody tried to access this native code?

View 4 Replies View Related

General :: Which Video Players Allow To Set Network Buffer Cache By Size And Time

Dec 26, 2012

The closest I know of are mxplayer and vplayer. Any xda alternatives people know of?

View 2 Replies View Related

Samsung Moment :: Custom Kernel - Partial Audio Buffer And Optimizations

Dec 29, 2009

Don't know if anyone over here cares, but zefie over on SamsungMomentForum.com released a custom kernel with a bunch of fixes. Including a partial audio buffer fix, and a bunch of tweaks and optimizations. Also, persistent root so you can run a bunch of those programs on the market that require it. No WiFi tethering yet, but it is being worked on. Not sure if this includes the battery notification fix because I had already installed CL14 the other day and it's been working for me ever since. This was not difficult to install, once you have the software and drivers required, the update takes less than 30 seconds.

Here's a link:
Time for the first custom "ROM" (well kernel)

View 19 Replies View Related

Android :: Audio Track Support?

Mar 15, 2010

I like to know on which version of SDK does support 'AudioTrack' class? Does 'AudioTrack' can be used from 1.5 SDK, 1.6 SDK and 2.0 SDK?

View 1 Replies View Related

Android :: Audio Track Play Music

Sep 6, 2010

I'm an android starter I tused AudioTrack to play music But it just tell me filenotfoundexeception I try to play mp3 wav ogg (all in raw dir) I've no idea where is wrong? here are my code:

CODE:..................

View 3 Replies View Related

Android :: Audio Track Class Streaming Mode

May 18, 2010

I am trying to playback voice data which is received in form of RTP packets in my application. The class
Receiver.java extends thread is playing back the audio. The question is
1. For real time streaming operation how to configure the write(byte[], int offsetInBytes, int sizeInBytes) methods?
2. What is the function and purpose of getPlaybackHeadPosition() What is playback head position kindly explain! Note: The RTP packets I am receiving are not from a traditional Datagram Socket but rather then from Ad Hoc Network so there is unknow delay for receiving the RTP packets. I need to design the Receiver class to play back the voice as soon as packets are recieved. Kindly help me in this regard You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+ unsubscribe@ google groups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

View 3 Replies View Related

Android :: Playing Audio From Audio Track In Android

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.here buffer is the audio data i am reading into.Same buffer I can play in MediaPlayer,,,But i could not play in audio track.

View 1 Replies View Related

Android :: Create Sound Effects Manipulation On Audio Track?

Dec 28, 2009

I am creating an android app that basically records an applies an "Effect" on the audio track then plays it back. I got my app to record an play back but I am stuck an not sure where do go from here. I have been Googling for days now trying to find a open source audio library or some way to change the audio after I record it. I currently have it setup to play back using SoundPool an I't lets me speed up an slow down the audio. I would like to do things like change pitch an add echo etc. I will appreciate any responses because I am totally stumped right now.

View 1 Replies View Related

Android :: Size Of Audio In Seconds?

Aug 11, 2010

How do I know the file size in seconds mp4?

View 1 Replies View Related

Android : Playing Bigger Size Audio Wav Sound File Produces Crash

Mar 25, 2010

I am trying to play the bigger size audio wav file(which is >20 mb) using the following code(AudioTrack) on my Android 1.6 HTC device which basically has less memory. But i found device crash as soon as it executes reading, writing and play. But the same code works fine and plays the lesser size audio wav files(10kb, 20 kb files etc) very well.

P.S: I should play PCM(.wav) buffer sound, the reason behind why i use AudioTrack here. Though my device has lesser memory, how would i read bigger audio files bytes by bytes and play the sound to avoid crashing due to memory constraints. Code...

Could someone guide me please to play the AudioTrack code for bigger size wav files?

View 1 Replies View Related

Android :: ATrackDog - SD - Track Backup App Vs. ATrackDog - Track New Version

Dec 1, 2009

I was just wondering what the difference between aTrackDog(SD) and the regular aTrackDog? Which is better and more stable?

View 2 Replies View Related

Android :: Data Buffer Pass By Jni

Aug 4, 2009

Have some tryed to pas databuffer on android by jni?

View 6 Replies View Related

Android :: Alpha Buffer Support On G1

Mar 21, 2009

Is it possible to generate an EGL Config with an alpha buffer on the G1? When I request a non-zero number of bits for the alpha buffer I can get a R5G5B5A1 or R8G8B8A8 visual, but neither of them renders correctly to the screen. I assume that's because the G1 only supports R5G6B5 visuals. It does surprise me that I can even get those visuals though. It's fairly obvious looking at the 32bpp visual artifacts that the frame buffer is indeed laid out with 32bpp, but display hardware is treating it as 16bpp, resulting in the left and right halves of my scene rendering in alternate scan lines, with distorted colors. So does anyone know if there is any way to get an alpha buffer on the G1? I've tried using FBO's but they don't seem to be implemented either. Or I'm using them incorrectly. If I call glGenFrameBuffersOES on a GL11ExtensionPack reference I get an UnsupportedOperationException. I am getting my GL11ExtensionPack reference by casting the return value from my EGLContext.getGL() call.

View 2 Replies View Related

Android :: Alpha Buffer Support

May 24, 2009

Since Google groups doesn't let you add posts to threads more than 60 days old, and I want to leave a solution to the problem I encountered a while back, I'm posting this message with the same title in hopes that anyone running into the problem I had will find this message as well. I was having trouble getting my G1 to render an RGBA_8888 OpenGL context to the screen. Everything was twice the size it should be because the 8888 pixels were being interpreted as two 565 pixels. The colors were obviously wrong as well. I had missed a critical function call. You must configure the Surface that is being used by EGL using the SurfaceHolder method setFormat. The pixel format needs to be TRANSLUCENT, or more specifically you can use RGBA_8888.

View 2 Replies View Related

Android :: How To Empty The Logcat Buffer

Jul 23, 2010

How can I empty the logcat buffer in Android? I use adb logcat from command line and pipe the output to a file, since the DDMS has a very limited buffer. At the moment, when I restart my app (after fixing bugs etc) the logcat buffer has data from the previous launch as well. Even uninstalling the app does not clear the buffer. The only way I've found so far to clear the buffer, is reboot. This is effective, but would like to know if there's an easier way.

View 1 Replies View Related

Android : Why Does Internet Radio Always Buffer

Oct 5, 2010

I like to listen to internet radio stations due to the variety of music i can listen to and also due to the lack of full Flash support yet for 2.1

my 3G & HSDPA signal is excellent almost anywhere....at home, at work and on the road and out and about. i'm with T-mobile (UK) for the past 5 years and i'm very happy with their service. and the signal.

but sometimes the internet radio still buffers sometimes even with an almost excellent signal. why is this? any explanation?

View 6 Replies View Related

Android :: How Do I Make My Image View Fixed Size Regardless Of Size Of Bitmap

Sep 23, 2010

So I'm loading images from a web service, but the size of the images are sometimes smaller or bigger than other images and the visualization looks silly when I put them in a ListView in android. I'd like to fix the size of my ImageView so that it only shows a portion of the image if it's larger than a preset amount. I've tried everything I can think of setting the setMaxWidth/setMaxHeight, setting the scale type to centerCrop, using ClipableDrawable wrapping my BitmapDrawable, setting using Drawable.setBounds(). I've tried setting in the XML and programmatically, but neither worked. I'm very surprised setting max width/height didn't do anything. Below is the XML I'm using ImageView definition in my layout file

View 1 Replies View Related

Android :: Better (Video Buffer) YouTube Application?

Oct 19, 2010

I've pretty much fed up with the stock Youtube app on my Moto Droid, and was wondering if there are any alternate apps or fixes out there. Between it flipping a nut if I try to seek further into the video and the fact that it won't allow me to buffer the video at all is what tweaks me the most. Whats the point of trying to watch anything over 3G if I'm only gunna get 3 seconds of video followed by 3 seconds of buffering through the whole thing?

View 1 Replies View Related

Android :: OpenGL Depth Buffer - Cant Get To Work

Apr 29, 2010

I'm currently learning OpenGL ES programming on Android (2.1). I started with the obligatory rotating cube. It's rotating fine but I can't get the depth buffer to work. The polygons are always displayed in the order the GL commands render them. I do this during initialization of GL:

CODE:...........

On surface-change I do this:

CODE:............

When I enable backface culling then everything looks correct. But backface culling is only a speed-optimization so it should also work with only the depth buffer or not? So what is missing here?

View 2 Replies View Related

Android :: Using Cache Or SDcard As Temporary Buffer

Nov 19, 2010

I'm currently trying to create a buffer for my application which needs to be big!I mean at least 1MB but most likely to be 4MB.Now definitely bad idea to actually allocate this much on a byte array in memory.So the options are put all the data in a file. So question is where do I place this temp file?

Option 1: Store to sdcard. Might be slow and not such a good idea for continuous read/writes?

Option 2: Store to in the apps cache.I read somewhere this is fast for read/ writes. But also read before issues cleaning up the cache after use? I guess I should as if I be able to create a file in cache and discard it when I don't need it? Any tips/look outs from using this methods would be greatly appreciated!

View 7 Replies View Related







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