[android-developers] AudioTrack

2013-09-10 Thread Yamusani Vinay
How to play mp3 song using audio track in android.I used following code but i am getting noise... InputStream in = getResources().openRawResource(R.raw.ding); try { ByteArrayOutputStream out = new ByteArrayOutputStream(

[android-developers] AudioTrack mp3 decoder takes too long to load mp3 file and decode? Is there any alternative for that?

2013-01-07 Thread bhupinder jai mata di
I am using AudioTrack class to play large mp3 files. Actually i want to manipulate voice on fly like changing the pitch or speed 1x 2x etc. As soundtrack works only for short files. So i found AudioTrack the only option. I am using JLayer to decode my mp3 file (stored on sdcard) to PCM byte

[android-developers] AudioTrack mp3 codec taking too long to load. using JLayer.?

2013-01-07 Thread bhupinder jai mata di
I am using AudioTrack class to play large mp3 files. Actually i want to manipulate voice on fly like changing the pitch or speed 1x 2x etc. As soundtrack works only for short files. So i found AudioTrack the only option. I am using JLayer to decode my mp3 file (stored on sdcard) to PCM byte

[android-developers] AudioTrack: thread safety of operations?

2012-09-06 Thread Tamás Kovács
The documentation says that AudioTrack.write() is thread-safe in terms of stop(). What about the other operations? As far as I can see, e.g. play() and pause() should also be callable from another thread. write() is blocking, so it does not make much sense to call pause() from the same

[android-developers] AudioTrack class only plays the first half of sound track

2012-02-20 Thread dara kok
Hi, I've got a sample class demoing the use of Android AudioTrack class. It's a very simple one which make use of 2 threads. One to read data from a wav file chunk by chunk and another thread to play it back. My issue is that it only play the first half and then the sound vanishes. Please

[android-developers] AudioTrack in MediaController

2012-02-08 Thread Raneez
I used mediaplayer to play audio files using the MediaController..its easy to show mediacontroller from the MediaPlayer.OnPrepared(MediaPlayer mp) method when the file is ready for playback. But I need to use AudioTrack as player for Wav files , how it is possible to use it with MediaController?

[android-developers] AudioTrack to play actual stereo (left, right channel separately)?

2012-01-08 Thread rar
Hi, I'm trying to figure out if it is at all possible to get AudioTrack to play actual stereo, that is - there is a separate PCM buffer for left and right channel and the output will have samples representing sine waves with opposite phases in the left and right stereo channel output accordingly.

[android-developers] AudioTrack won't play quiet sounds (below approx. 15 db)

2011-12-05 Thread eNeLOu
Hello, I have a problem with playing generated sine signal, using AudioTrack object. Everything is OK while the amplitude of the signal is above 40 (16 bit PCM format ), but when I set the amplitude below that value, no sound is played unless I change the volume level with the side buttons

[android-developers] AudioTrack: changing audio while playing

2011-08-02 Thread nicoletto
Hi there, I've spent days already trying to sort out this topic. Basically I'm recording audio in PCM and when the user clicks on Play I want to play the recorded audio but applying some effect. Basically, prior to do track.write(data, 0, maxlength); I want to apply some kind of transformation

[android-developers] AudioTrack cant not play sound on device with FM?

2011-06-19 Thread Baodong Chen
Hi all: i have a APP using AudioTrack to play pcm buffers,it works well on some devices. but when the device have FM, my APP can not make the sound, can someone give some advice? I used AudioTrack.MODE_STREAM and AudioManager.STREAM_MUSIC when new AudioTrack(); -- You received this

[android-developers] AudioTrack help - pause after mute

2011-06-15 Thread Stefan Alder
I need to pause the AudioTrack after its volume is set to zero. If I pause immediately after muting, there's a glitch, so I've added a sleep -- but this creates other problems and doesn't seem reliable. I still get glitches. Is there a reliable way to do this? For example, some sort of callback

[android-developers] AudioTrack in streaming mode

2011-05-30 Thread Raffaele Sgarro
I need to stream runtime generated PCM data. This sounds pretty simple, but it doesn't work. Pseudo code: public void run() { while(...) { mAudioTrack.write(whatNoiseDoesThisAnimalMake(mAnimal), ...); } } mAnimal can be changed from UI obviously. Just in case it matters, I set the

[android-developers] AudioTrack Underrun Notifications?

2011-01-14 Thread samdroid
Sorry if this is ends up repost but my other one seems to have been lost in the moderator ether and I just had my second post show up within a few minutes. I have an application where it is useful to me to know when there has been an underrun while streaming with AudioTrack (I think that an

[android-developers] AudioTrack audio streaming

2010-10-28 Thread Charles De Meulenaer
Hi, I'm currently working on an android video player. I am decoding audio and video in a native thread and passing the decoded data back to my application. I'm rendering a bitmap in a SurfaceView to display the video and am using a streaming AudioTrack to which I write data for the audio. When

[android-developers] AudioTrack: ObtainedBufferTimeout

2010-10-03 Thread Prajakta Shitole
Hi, I am developing a music application and I am trying to test it on 2G. My application works fine on wifi but on Edge it gives me AudioTrack: ObtainedBufferTimeout. I figured out the buffer does not have enough data so I am getting this message. I want to thus display a progress dialog box

[android-developers] AudioTrack: ObtainedBufferTimeout

2010-10-03 Thread praj
Hi, I am developing a music application and I am trying to test it on 2G. My application works fine on wifi but on Edge it gives me AudioTrack: ObtainedBufferTimeout. I figured out the buffer does not have enough data so I am getting this message. I want to thus display a progress dialog box

[android-developers] AudioTrack/Record, stop(), callback

2010-09-02 Thread Daniel Åkerud
Hi, Using libmedia from native code with the callback mechanism: when AudioTrack/Record-stop() returns, is it guaranteed that (1) the user supplied callback is not called again, and (2) has returned if it is currently being called when stop() is called? I have problems understanding the exact

[android-developers] AudioTrack flush() does not work

2010-08-26 Thread sasq
I am calling stop(), flush(), start() on my audiotrack when changning songs. This seems to only work the first time. After that, playbackposition does not become 0, and in fact all the data queued up from the old song plays until the buffer is drained. This is pretty bad, since I need a large

[android-developers] AudioTrack MODE_STATIC issue

2010-08-18 Thread Pat
Hi all, I'm developing an audio app that uses AudioTrack's MODE_STATIC to efficiently loop through a sound sample. Using MODE_STATIC, AudioTrack.write() to set the sample, and AudioTrack.setLoopPoints() to loop through the sample, I'm able to tell the hardware to simply keep looping through my

[android-developers] AudioTrack and STREAM_MODE

2010-08-12 Thread r3gis
Hi, I need help from an expert of the audio stack. I'm currently writting an opensource SIP application (http:// code.google.com/p/csipsimple/) based on a native sip stack (pjsip). I've ported the audio driver for android (naive portage using JNI) (the key file :

[android-developers] Audiotrack buffer issues?

2010-07-23 Thread J
Ok so I have a frequency generator which uses AudioTrack to send PCM data to the hardware. Here's the code I'm using for that: private class playSoundTask extends AsyncTaskVoid, Void, Void { float frequency; float increment; float angle = 0; short samples[] = new short[1024]; @Override

[android-developers] AudioTrack: obtainBuffer timed out question

2010-06-07 Thread ghhardy
Hi, I am using the eyes free TTS framework, and am observing a repeatable 1 second lag in the AudioTrack output that I am trying to explain. The problem occurs after the first or second callback (ttsSynchDoneCB, see: frameworks/base/packages/TtsService/jni/ android_tts_SynthProxy.cpp). The

[android-developers] AudioTrack in streaming mode

2010-04-04 Thread Simone
Hi everyone, I need to modify the volume of an AudioTrack, while it is playing a sound in streaming mode. I have something like this: minBufSize=AudioTrack.getMinBufferSize(11025, AudioFormat.CHANNEL_OUT_STEREO, AudioFormat.ENCODING_PCM_16BIT); fSound=new AudioTrack(

[android-developers] AudioTrack lag

2010-02-16 Thread Steve Lhomme
Hello, I'm trying to write an audio sink for my application. I am using the AudioTrack class and it works pretty well. In other words I get the audio to play correctly (stream mode). I am using it in C code via the NDK, but that shouldn't matter. The AudioTrack creation and feeding is done in a

[android-developers] AudioTrack lag

2010-02-16 Thread Steve Lhomme
Hello, I'm trying to write an audio sink for my application. I am using the AudioTrack class and it works pretty well. In other words I get the audio to play correctly (stream mode). I am using it in C code via the NDK, but that shouldn't matter. The AudioTrack creation and feeding is done in a

[android-developers] AudioTrack - Clicking Proplem

2010-01-21 Thread Business Talk
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

Re: [android-developers] AudioTrack stop/release

2009-12-29 Thread Olivier Guilyardi
On 12/25/2009 02:00 PM, Business Talk wrote: I keep posting this message hoping that maybe somebody from google (media group in particular) monitors the group. I need to stop the AudioTrack, regardless what's in the buffer, immediately when executing the stop/release. The AudioTrack plays in

[android-developers] AudioTrack - Clicking Sounds

2009-12-29 Thread Business Talk
Do you know of any freeware application that can convert/generate sounds in the PCM format? I am getting clicking sounds when playing AudioTrack and I think it is because I am playing a wave file which is a pcm with some headers. I downloaded a number of converters but all of them generate wave

[android-developers] AudioTrack stop/release

2009-12-25 Thread Business Talk
I keep posting this message hoping that maybe somebody from google (media group in particular) monitors the group. 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

[android-developers] AudioTrack - Doesn't stop playing as requested.

2009-12-22 Thread Business Talk
I've been trying to resolve the issue of the immediate termination of the AudioTrack played in the MODE_STREAM track with no avail. To do so I call stop and release; audioTrack.stop(); audioTrack.release(); audioTrack = null; I tried flushing but

Re: [android-developers] AudioTrack - Doesn't stop playing as requested.

2009-12-22 Thread Fabricio
Not been very familiar with it but maybe you could pause it and then proced to stop and release. Salutes. Fabricio Tuosto On Tue, Dec 22, 2009 at 11:22, Business Talk roman.businesst...@gmail.comwrote: I've been trying to resolve the issue of the immediate termination of the AudioTrack played

[android-developers] AudioTrack cutting audio short.

2009-12-16 Thread MarkNZ
Hi, 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

[android-developers] AudioTrack - Clicking Sound

2009-12-15 Thread Business Talk
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. I am sure of it. -- 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] AudioTrack stop/release

2009-12-15 Thread Business Talk
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. Any thoughts? -- You received this message because you are subscribed to the Google Groups Android Developers

[android-developers] AudioTrack

2009-12-14 Thread Business Talk
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

[android-developers] AudioTrack::start called from thread

2009-12-08 Thread Business Talk
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. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this

[android-developers] AudioTrack channel configuration

2009-11-28 Thread Akos Petho
Hi all, I would like to use the AudioTrack class to play separate the left and the right audio channel in a stereo .WAV file. In the AudioTrack class's constructor there is a channelConfig parameter, to describe the configuration of the audio channels. If i want to use the channel configuration

[android-developers] AudioTrack usage with streaming data in native code

2009-11-09 Thread DuncanLee
Dear All, I connect one streaming application voice output to android AudioTrack in native code layer (C code). But I can heard voice loop. if i put each frame(160bytes) to AudioTrack write() in each callback, i will get a bad quality voice from earphone. if i collect more frame(ex:3200,

[android-developers] AudioTrack sanity test

2009-10-02 Thread BD
Hi. 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

[android-developers] AudioTrack question

2009-09-29 Thread Tim Newsham
I have some questions about the AudioTrack class that I can't seem to answer by reading the class documentation. Is it possible to use the android.media.AudioTrack class in a non- blocking way? If so, what conditions must be true to ensure that the write() method doesnt block? How do the

[android-developers] AudioTrack - Optimal sound format

2009-07-13 Thread sasq
When playing music through AudioTrack, the mediaserver process takes about 5% CPU on top of what my program takes. So, is there an optimal format to give to AudioTrack so it doesn't have to resample? --~--~-~--~~~---~--~~ You received this message because you are

[android-developers] AudioTrack create failure

2009-06-25 Thread l hx
who know why? E/AudioFlinger( 635): not enough memory for AudioTrack size=262208 D/MemoryDealer( 635): AudioTrack (0x23340, size=1048576) D/MemoryDealer( 635): 0: 00023378 | 0x | 0x00040040 | A D/MemoryDealer( 635): 1: 00023400 | 0x00040040 | 0x00040040 | A D/MemoryDealer(

[android-developers] AudioTrack and MP3 data

2009-04-28 Thread Zach Hobbs
I have been streaming MP3 audio tracks using the Apache Commons libraries to create a local HTTP server and then connecting to it with MediaPlayer. This is a very cumbersome setup, and has tons of overhead...that's why I was excited about the introduction of AudioTrack. Unfortunately I just

[android-developers] AudioTrack class for streaming audio

2009-01-13 Thread Tez
Hi, I had come across the post of an android engineer stating that there is a class known as AudioTrack that can play audio streamed from a buffer. Can anyone shed some light on this. The class belongs to the so called 'cupcake' development branch Cheers, Earlence