Why would you want to? With a garbage collector that can keep your
thread from running for over 400ms, you need at least that large a
buffer or you would get stuttering (ie for 500ms 44100*4 / 2 = 88100
bytes for stereo playing).


On Jun 17, 4:51 pm, akito <[email protected]> wrote:
> This may be impossible but is there any way that I can get a smaller
> buffer size
> forAudioTrackthan what is provided by getMinBufferSize method?
>
> This is how I am instantiatingAudioTrackright now:
>                 SR = 44100;
>                 bufSize =AudioTrack.getMinBufferSize(SR,
>                                 AudioFormat.CHANNEL_CONFIGURATION_MONO,
>                                 AudioFormat.ENCODING_PCM_16BIT);
>                audioTrack= newAudioTrack(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 initializingAudioTrack
> E/AudioTrack-Java(  318): [ android.media.AudioTrack] Error code -20
> when initializingAudioTrack.
> 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?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to