Questions tagged [soundpool]

Android API : The SoundPool class manages and plays audio resources for applications

594 questions
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?
6
votes
3 answers

How to stop playing a Sound via Soundpool?

Please, have a look at those pieces of code: private SoundPool soundPool; private int soundID; soundPool = new SoundPool(10, AudioManager.STREAM_MUSIC, 0); soundID = soundPool.load(this, R.raw.batimanbailedosenxutos, 1); and when I press the…
CésarQ
  • 107
  • 1
  • 1
  • 6
5
votes
1 answer

Android 2.2 - SoundPool sample 0 is not READY

I have searched StackOverflow and cannot find a situtation like mine. I am using four buttons with each button playing a sound file. I am using SoundPool: SoundPool sound = new SoundPool(4, AudioManager.STREAM_MUSIC, 0); I am also using the…
Tchiak
  • 73
  • 1
  • 6
5
votes
2 answers

Knowing if the loading of a sound with SoundPool has been successful on Android 1.6/2.0/2.1

On Android 2.2+ there is something called SoundPool.OnLoadCompleteListener allowing to know whether a sound has been loaded successfully or not. I am targeting lower API version (ideally 1.6 but could go for 2.1) and I need to know whether a sound…
Vincent Mimoun-Prat
  • 28,208
  • 16
  • 81
  • 124
5
votes
2 answers

and again about memory issues with SoundPool

I am aware that SoundPool was intended to handle small fx like sounds and I made sure my 4 sound clips which I want to play one by one in some sequence are small enough. I used ogg quality 0 and clips are 35kb, 14kb, 21kb and 23kb totaling 92kb of…
mishkin
  • 5,932
  • 8
  • 45
  • 64
5
votes
1 answer

Sound not playing in Android version greater than 4.0

I am using following code to play sound in my app. Everything worked fine before ICS. But on ICS and more recent versions no sound can be heard although there is no error appearing. EDIT: Note, the following code is triggered by a broadcase…
user93796
  • 18,749
  • 31
  • 94
  • 150
5
votes
1 answer

Playing Multiple sounds at the same time in Android

I am unable to use the following code to play multiple sounds/beeps simultaneously. In my onclicklistener I have added: public void onClick(View v) { mSoundManager.playSound(1); mSoundManager.playSound(2); } But this plays only one…
Wrapper
  • 81
  • 1
  • 2
  • 3
5
votes
3 answers

Record/capture internal sound playback of Android app and export mp3?

Is it possible to record the internal sound generated by the app? My app allows you to create and play back musical sequences. soundPool.play(soundIds[i], 1f, 1f, 1, 0, Constants.TIME_RATE); I'd like to be able to record the sequence and export to…
fxfuture
  • 1,910
  • 3
  • 26
  • 40
5
votes
4 answers

Waiting for SoundPool to load before moving on with application

I was following a tutorial to integrate SoundPool into my app, and this is the code which was given in the tutorial: package com.example.soundpoolexample; import android.app.Activity; import android.media.AudioManager; import…
capcom
  • 3,257
  • 12
  • 40
  • 50
5
votes
1 answer

Loading and playing with soundpool from assets

I have a bunch of sounds, assigned to a group of buttons, which i need to play. All my sounds are in asset folder. However, it does not work. The purpose is: to load from assetFodler and play that sounds. I will come out with code examples from my…
Daler
  • 1,205
  • 3
  • 18
  • 39
4
votes
2 answers

How to get the duration of Soundpool

i am using soundpool to play audio files and my objective is to play a audio file and after finishing, play another audio file. Here is my code String source_path = "/sdcard/varun/audio.mp3"; mSoundPool = new SoundPool(10,…
Goofy
  • 6,098
  • 17
  • 90
  • 156
4
votes
4 answers

Sample 1 not ready - Soundpool in Android 2.1

guys i have a audio file which i am reading from sdcard it.On click of a button i am playing the audio file from sdcard.It successfully plays the audio file for 6 to 7 times but after that it shows unable to load (null) sample 1 not ready i am…
Goofy
  • 6,098
  • 17
  • 90
  • 156
4
votes
2 answers

Playing audio file from Sdcard

I would like to play an audio file from the sdcard. How can I read the audio file and play it? Below is my code to play audio file: int sound1; sound1 = mSoundPool.load(this, R.raw.om, 1); mSoundPool.play(sound1, 1, 1, 1, time - 1, 1); Here in…
Goofy
  • 6,098
  • 17
  • 90
  • 156
4
votes
0 answers

Why multiple Android SoundPool.unload calls return true/false depending on order?

According to Android documentation, SoundPool.unload returns true if just unloaded, false if previously unloaded I create the SoundPool, load 5 sounds and store related 5 sound IDs. Then before leaving the Activity I invoke unload for each of…
superjos
  • 12,189
  • 6
  • 89
  • 134
4
votes
0 answers

SoundPool (SDK 4.0.x) int loop, any value other than zero causes crash

I wonder if anyone can help. I'm using Android 4.0.x development kit Win 7 64 bit platform using the code as supplied in http://www.droidnova.com/creating-sound-effects-in-android-part-1,570.html testing out SoundPool examples as supplied on the…