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
6
votes
1 answer

Sample code for Android AudioTrack Mixing

I have two PCM sound file in resource folder. I used inputstream and converted them into bytearray. Then I processed them by normalized and adding music1 and music2 and output to the byte array output. Finally, put the output array and feed it…
jason white
  • 687
  • 4
  • 11
  • 28
6
votes
1 answer

Playing sound over speakers while playing music through headphones

I have an AudioTrack streaming via headphones. I have to send a SoundPool to built-in speakers only, without interrupting the AudioTrack playing over the headphones. Any hacks gangsters?
5
votes
1 answer

Merge two audio tracks into one track

I am having a issue in combining two audio tracks into one, in order to add the whole merged audio to a video track. this.promises = [navigator.mediaDevices.getUserMedia({ audio: true, video: true })]; if (navigator['getDisplayMedia']) { …
5
votes
1 answer

Record multi audio tracks available in a stream with MediaRecorder

I'm building a screen recorder plugin for chrome store. I'm adding microphone's audio track to the media stream that contains (Screen's video track + System audio track). So final stream contain 2 audio tracks one of microphone and other one of…
5
votes
0 answers

Android audio too fast on some devices with MediaCodec and AudioTrack

I am decoding audio using MediaExtractor, MediaCodec, and AudioTrack. I am configuring the AudioTrack using the MediaFormat returned by MediaCodec.getOutputFormat() after receiving MediaCodec.INFO_OUTPUT_FORMAT_CHANGED from the MediaCodec. On some…
Tad
  • 4,668
  • 34
  • 35
5
votes
0 answers

How to stream data from MediaCodec to AudioTrack with Xamarin for Android

I'm trying to decode a mp3 file and stream it to AudioTrack. It all works fine but causes a lot of GC on the Java side. I've made sure to not allocate memory in my play/stream loop and blame ByteBuffer.Get(byte[], int, int) binding of allocating a…
5
votes
1 answer

Precisely Sync Looped Audio with Animation in Android

Question: Is there any way to use AudioTrack and setLoopPoints() to configure a loop with accuracy based on samples/frames per millisecond? Edit: I understand that perfect accuracy can't be expected from the processing power that most android…
5
votes
4 answers

Android sound synthesis

I am trying to play a synthesized sound (basically 2 sine waves and some noise) using the AudioTrack class. It doesn't seem to be any different than the SourceDataLine in javax.sound.sampled, BUT the synthesis is REALLY SLOW. Even for ARM standards,…
dosse91214
  • 561
  • 1
  • 5
  • 17
5
votes
2 answers

Android - Mixing multiple static waveforms into a single AudioTrack

I am making a class that takes an array of frequencies values (i.e. 440Hz, 880Hz, 1760Hz) and plays how they would sound combined into a single AudioTrack. I am not a sound programmer, so this is difficult for me to write myself, where I believe…
mas
  • 137
  • 2
  • 10
5
votes
1 answer

using Android's AudioTrack to combine bytes of sound samples produces noise

I'm building a fairly simple Android app (sdk revision 14: ICS) which allows users to pick two audio clips at a time (all are RIFF/WAV format, little-endian, signed PCM-16 bit encoding) and combine them in various ways to create new sounds. The…
CCJ
  • 1,619
  • 26
  • 41
4
votes
1 answer

Playing music with AudioTrack buffer by buffer on Eclipse - no sound

i'm programming for Android 2.1.Could you help me with the following problem? I have three files, and the general purpose is to play a sound with audiotrack buffer by buffer. I'm getting pretty desperate here because I tried about everything, and…
vinntec
  • 455
  • 1
  • 4
  • 11
4
votes
2 answers

Play MultipleAudioTrack in Roku

I know about Roku doesn't support multiple videos at a time. But, Some Developers are mix up two things multiple playbacks and multiple audio tracks. Roku Does Support Multiple Audio Track? I tried to Play MultipleAudioTrack in Roku. I used the…
4
votes
1 answer

Android Audio Streaming - Getting Static Noise on AudioTrack

I have a streaming server running on localhost. When I try to stream audio from it from my Android application. I'm getting static noise most of the time (The kind you get on radio). Sometimes the complete audio is static noise, sometimes a part of…
Asym
  • 1,836
  • 3
  • 21
  • 36
4
votes
1 answer

AudioRecord not enough memory for AudioTrack

I am trying to build an Android application that records X number of seconds and saves the file in .wav format The problem is that if I input more than 47 seconds ( 48 and above) I get the following errors: 11-29 10:58:39.315 399-1548/?…
Sherbi Bv
  • 79
  • 1
  • 6
4
votes
0 answers

onPeriodicNotification is not working for every 20ms

I need a fetch a new audio frame every 20ms, therefore i create a AudioTrack which has buffer size of 7528 bytes(Maximum of 2 Audio Buffers of 3764 byes each) int minBufferSize = 7528; mAudioTrack = new AudioTrack( AudioManager.STREAM_MUSIC, 44100,…