Questions tagged [audiotrack]

AudioTrack class in standard Android API for playing back raw Audio.

AudioTrack class in standard Android API for playing back raw Audio.

http://developer.android.com/reference/android/media/AudioTrack.html

419 questions
0
votes
0 answers

Record audio played on AudioTrack?

I have an android app that plays a generated tone on an AudioTrack, so my question is: is there a way to record whatever is played on that AudioTrack(it's started, stopped, written to, and released frequently), be able to play it back, and save it…
user2649681
  • 750
  • 1
  • 6
  • 23
0
votes
0 answers

AudioTrack makes clicking noise every second in Android app

I have the following code which reads objects from a queue that contain PCM data and writes the PCM data to an Android audio @Override public void run() { Process.setThreadPriority(Process.THREAD_PRIORITY_URGENT_AUDIO); try { …
benstpierre
  • 32,833
  • 51
  • 177
  • 288
0
votes
1 answer

Audio Track keep playing sound after audio track released

I am using an Audio Track to play a sound.I am initializing the Audio Track in this way. numSamples = duration * sampleRate; sample = new double[numSamples]; generatedSnd = new byte[2 * numSamples]; length_snd = generatedSnd.length; audioTrack = new…
Ratul Ghosh
  • 1,512
  • 9
  • 15
0
votes
1 answer

Android pulse an icon when .wav volume changes

I'm building an android app that pulses an icon - simple pulse, 2x size at loudest volume and 1x at no volume - based on audio. Worth noting my min api is 15. The user selects the mode (file)to play and I use AudioTrack to play it back on an…
0
votes
1 answer

how to play large PCM file via AudioTrack? (Currently getting errors)

I have been working on some code for an app i am making, and i need to play large PCM files (upwards of 600mb). This is the current code for my play() method: public void play(View view) { Toast.makeText(this, "play",…
Fishingfon
  • 1,034
  • 3
  • 19
  • 33
0
votes
1 answer

Generating frequency with AudioTrack

I found the following code, that generates 'noise'. I want to be able to generate a tone. As far as I understood there's some kind of formula involving SIN to generate the tone. This line generates the noise: rnd.nextBytes(noiseData); I tried to…
user3578847
  • 397
  • 2
  • 6
  • 17
0
votes
4 answers

AudioTrack playing with inconsistent speed on different devices

I am currently working with AudioTrack. I am loading an mp3 file and playing it. However, depending on devices, the music plays either at half the rate or normal rate. My code: AudioTrack track= new AudioTrack( AudioManager.STREAM_MUSIC, …
Herve
  • 36
  • 7
0
votes
2 answers

Android sound wave - not smooth and duration issue

I have a problem to generate smooth sinus wave. I've done it few years ago on C++ and everything worked perfect. Now I am trying to do this using AudioTrack and I do not know what is wrong. This is my test case: I want to produce for five second a…
user1683637
  • 75
  • 1
  • 5
0
votes
0 answers

audioTrack is giving noisy sound Noisy means a great distortion is made

I am recording user's voice through media player and saved it in .m4a format. Recording is successfully file saved successfully now i want to play that audio file through audioTrack with a different pitch. but my code is not playing the audio file…
Workaholic
  • 93
  • 12
0
votes
0 answers

Bluetooth Headset picking up noise - how to activate noise suppressor like NoiseAssassin

I'm recording my voice through a Bluetooth headset (ERA JAWBONE) and playing it in realtime on the phone speaker. This works with the following code: buffer = new byte[buffersize]; android.os.Process.setThreadPriority( …
0
votes
1 answer

Audio Record and Playback Failing - Android AudioRecord & AudioTrack

I am writing an Android Application for Recording and playing back audio in a loop. Like an echo (Record, Play, run in a loop). I have successfully written the application for Recording and playing using a temp file, (write into file, read from the…
Saurabh Meshram
  • 8,106
  • 3
  • 23
  • 32
0
votes
0 answers

Xamarin Audiotrack

When I play my tune I made with AudioTrack, there are pauses in the sound. It is a sinwave and there should be none but there are pauses. why? here is my code: public IsochonicTone () : base(Stream.Music, 44100, ChannelOut.Mono,…
0
votes
0 answers

Speex Echo cancellation `Fatal signal 11 (SIGSEGV) at 0x00000008 (code=1)`

I`am developping and android VoIP apps using Audiotracks and Audiorecord. But there is a lot of echo, I tried to use Speex echo canceller with JNI but I get error : 07-21 16:58:39.029: A/libc(7570): Fatal signal 11 (SIGSEGV) at 0x00000008…
0
votes
1 answer

Audio file is play late after write in buffer in android Audio Tack

when i increase the size of buffer the audio sound that will write on buffer is play late.And when i discrease the size of buffer the file is played correctly means the file is play on time not late. any one can help ... The buffer size is…
user3835770
  • 31
  • 12
0
votes
1 answer

Monodroid(Xamarin) how to play multiple mp3 in sync

My project needs to have an mp3 player where multiple mp3 files play together completely in sync. I've tried MediaPlayer but the problem is that when in my loop I start two mp3 files they are slightly off sync. Of course they are created and…