Questions tagged [android-sound]

31 questions
11
votes
3 answers

Android SoundPool doesn't play same sound for second time until playing another sound

Here is my Activity: public class MainActivity extends AppCompatActivity { private SoundPool soundPool; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); …
Misagh Emamverdi
  • 3,654
  • 5
  • 33
  • 57
3
votes
0 answers

Best audio format/settings for sound effects

My app will have quite a few sound effects played using Soundpool. Is there a preferred audio file format/settings for sound effects? For example what bitrate is considered to be overkill? Compressed or uncompressed format better and etc.
wilkas
  • 1,161
  • 1
  • 12
  • 34
2
votes
1 answer

SoundPool play()... better in a thread or in main UI thread?

I noticed that when playing a SFX with soundpool in a thread, it generates a FPS slowdown in the game and when playing the SFX in main thread the game doesn't slow down. Why soundpool works better playing from mainthread? This is the play…
NullPointerException
  • 36,107
  • 79
  • 222
  • 382
2
votes
1 answer

Android don't play sound effect when Do not Disturb is on

I'm using the MediaPlayer to play a sound effect. However when DnD (Do not Disturb) is turned on it still plays the sound. This is my code: public static void playSound(Context context, @RawRes int soundId) { MediaPlayer mp =…
2
votes
1 answer

Android noise level detection and decibel calculation

I have tried many examples of noise level detection from that some following examples I tried and debug: Detect noise or blow sound Android detect sound level Google SplMeter sample code But I am get little bit confused on the following…
2
votes
2 answers

soundpool unable to load sample (null)

I'm developing a game, when I wanna load some of sounds, I got this error ” soundpool unable to load sample (null) " (I see it in logcat and It doesn't throw any exceptions). I googled it but can't find anything. Any suggestion?thanks for your…
MehDi
  • 504
  • 6
  • 20
2
votes
2 answers

Mediaplayer stops in android after 30 clicks

I've seen other posts on this but I cant figure out problem. So I'm designing a calculator and all the numbers have one onclick method and all the operators have different . I have a method playSound() where the code is: public void playSound(){ …
Sagar
  • 416
  • 7
  • 23
1
vote
1 answer

.NET MAUI native audio player

I am interested is there a way to play mp3 files from the phone internal memory using the built in native audio player. I am asking this, because I want to implement an equalizer too, so I am guessing I will have to work with streams. I know for the…
Wasyster
  • 2,279
  • 4
  • 26
  • 58
1
vote
0 answers

Adding custom DTMF tones

So as far as I know there are 12 DTMF tones that you can send over a call (0-9,*,#). Now I wish to develop an app that can send DTMF tones in a set pattern. But I need more than 12 existing tones. So is there either If there already exist more than…
1
vote
2 answers

Open another activity when sound stops playing

I have below adapter for RecyclerView.There are particular sounds associated to each RecyclerView item as you can see.How to make the item click wait until the related sound finishes playing?Currently, when RecyclerView item is clicked, it…
1
vote
2 answers

Android foreground service holds microphone access even after being killed

I'm using a foreground service on Android that plays audio. I also use microphone input through NDK from Android Oboe library on a fragment, unrelated to the service. However, after I close the app, the microphone is inacessible to other apps, even…
PPP
  • 1,279
  • 1
  • 28
  • 71
1
vote
1 answer

Play sound with Android's media player Processing

So I found this code online but for some reason, it doesn't work. I mean it didn't crash but it just couldn't play the file code: import android.media.MediaPlayer; import android.content.res.AssetFileDescriptor; import…
Aaron P
  • 13
  • 5
1
vote
1 answer

Android - How to mute SoundPool in TimerTask without stopping it

I am trying to create a metronome sound, however, what isn't working is the ability to mute it. I would like the ability to mute it without stopping the TimerTask since I want the rate to be consistent once it is unmuted. Here is my code: public…
Pink Jazz
  • 784
  • 4
  • 13
  • 34
1
vote
1 answer

Is it possible to set the volume of sound in Twilio Programmable Voice for Android?

Is it possible to set the volume of the stream using Twilio Programmable Voice SDK for Android? I have an use case where user needs to play sound from other apps (such as Spotify) and my Twilio client app at the same time. What I'm trying to…
1
vote
1 answer

Sound Level not showing

What am i trying to do? I am trying to make an app that records the ball bounces of a football (soccer ball). This is my first time writing an app, and first time using java. One of my steps is to record the sound and displaying the amplitude of…
RubenDefour
  • 31
  • 1
  • 10
1
2 3