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

Android GC and AudioTrack, GC thread stuck in dlmalloc_inspect_all and AudioTrack stuck .. tryLock

A quick background: The app is an audio player, ffmpeg is compiled as a native shared object and used for decode, a separate native library is compiled as a shared object and used for audio processing, and AudioTrack is used to output the processed…
samc
  • 31
  • 4
3
votes
2 answers

Is there a way to listen for the tempo/bpm of audio playing in Android?

The Android app I'm building has to listen to music (either playing on the phone or picked up by the device's mic) and then do something based on the music. So what I was thinking of doing is to listen for the tempo/bpm of the music playing and…
marienke
  • 2,465
  • 4
  • 34
  • 66
3
votes
1 answer

android sdk realtime audio record

I use this code to record and play back recorded audio in real time using the AudioTrack and AudioRecord package com.example.audiotrack; import android.app.Activity; import android.media.AudioFormat; import android.media.AudioManager; import…
Jeff Bic
  • 546
  • 1
  • 6
  • 15
3
votes
1 answer

Trying to build "Hello, world!" media player activity using Jelly Beans new low-level media API

I'm trying to test the new low-level media API feautures, MediaExtractor and MediaCodec. I am following this guide: http://dpsm.wordpress.com/2012/07/28/android-mediacodec-decoded/ I put together this function, where…
3
votes
2 answers

Not able to pause on Audiotrack Object : android

In my application i have successfully recorded the audio and now I am playing it using following function: public void playfile() { System.out.println("Play Pressed"); speechLength = (int)(file.length()/2); speech2 = new…
Shikha Shah
  • 753
  • 3
  • 12
  • 34
2
votes
1 answer

How to play multiple ogg or mp3 at the same time..?

I'm trying to play 20 ogg files at the same time using MediaPlayer. This is because I want to make a mixing effect. While one music is playing, other files also have to be played. Actually, I already made an application with this function by iOS,…
user1292204
  • 21
  • 2
  • 4
2
votes
1 answer

Audio sample not playing as expected on android11

I am trying to extract and play audio samples from a video file in Android 11. However, I have followed some tutorials from the official documentation, but it still doesn't work. All I get is noise for a shorter duration of the audio. Please check…
2
votes
1 answer

AudioTrack: how to detect end of sound?

I'm using AudioTrack to play a PCM WAV sound file on Android (see also here). Streaming mode, worker thread. I'm wondering how do I detect the end of sound so that I can release and free the AudioTrack. The write() call, it seems, is blocking - but…
Seva Alekseyev
  • 59,826
  • 25
  • 160
  • 281
2
votes
4 answers

uninitialized AudioTrack exception when I try to generate tone on 22nd time

I have a requirement that I need to display a dial pad like screen and I have to generate 1khz tone (not DTMF tone) whenever user presses on a dial pad buttons. I have used the code from the below link to generate 1 khz tone: Playing an arbitrary…
brig
  • 3,721
  • 12
  • 43
  • 61
2
votes
1 answer

Flutter Audio Editing SDK

I am looking for an SDK which supports Audio editing features. The features I am looking for are as below Audio Trimming Audio Splitting Audio Volume management Adding another audio Merge Audio Undo/Redo actions Please suggest if there are any…
Vivek Makwana
  • 166
  • 3
  • 13
2
votes
0 answers

Unable to get Metadata form video using exoplayer without playback

I am trying to get video metadata using exoplayer without playback as mentioned in document when i try to run i cannot get list of audio track and subtitle track from local video file. MediaItem mediaItem = MediaItem.fromUri(videoUrl); …
sanoj lawrence
  • 951
  • 5
  • 29
  • 69
2
votes
1 answer

Flush AudioTrack in Xamarin.Android in an async way

AudioTrack.Flush doesn't finish his work, I found out that while AudioTrack is flushing (in an other thread), if I write some data, it stop flush, so I tried to lock AudioTrack while is flushing (no changes), so I tried to ignore the writing of data…
2
votes
1 answer

AudioTrack - IllegalStateException: play() called on uninitialized AudioTrack

I have a Thread with AudioTrack that I call on button DOWN, on button UP i want to stop the audio. So far so good. My app have Activity A and Activity B. Activity A is some menu from where I start Activity B that is the Main Activity where I call…
2
votes
1 answer

What is android.media.AudioTrack equivalent in flutter?

I want to use flutter for a musical application. In android SDK, I have worked with android.media.AudioTrack to produce sound. I couldn't use Mediaplayer and Soundpool for that purpose. Is there any class in flutter SDK like AudioTrack? I want to…
Payam Roozbahani
  • 1,225
  • 15
  • 27
2
votes
1 answer

Android AudioTrack getPlaybackHeadPosition always returns 0

I am writing some code that intends to take a Wave file, and write it out to and AudioTrack in mode stream. This is a minimum viable test to get AudioTrack stream mode working. But once I write some buffer of audio to the AudioTrack, and…
Scorb
  • 1,654
  • 13
  • 70
  • 144