soundpool

Heap size overflow issues with sound clips

眉间皱痕 提交于 2019-12-23 13:13:51
问题 I'm creating an Android app that involves multiple short sound clips. At the moment, I'm using SoundPool to load my sound clips once a 2nd activity is begun by the menu activity. The problem I seem to be having is that once this secondary activity begins, the loading of the sound clips causes multiple heap size overflows and then after a bit the activity actually loads (the emulator never gives an error or a force quit). Would using the MediaPlayer help me here and keep these heap size

What does “status -12” mean in Android AudioTrack?

主宰稳场 提交于 2019-12-21 15:00:45
问题 When using Android soundpool/audioTrack, I keep getting the following error: AudioFlinger could not create track, status: -12 Error creating AudioTrack Can anyone explain what -12 is? Is it the value of some enum from the source code? I've seen other questions that deal with error -12 but nowhere conclusively do I see what that constant actually stands for. Does someone know the list of the possible statuses for AudioFlinger? I've also seen error -22 around, but I don't know what that means

Why is my SoundPool mute?

ぐ巨炮叔叔 提交于 2019-12-21 02:48:10
问题 I setup my SoundPool , and load a sound resource as this in onCreate() : soundPool = new SoundPool(4, AudioManager.STREAM_MUSIC, 0); soundId = soundPool.load(this, R.raw.edible_underwear, 1); And then I try to play this sound twice in a onClick() , one slow mostly in left speaker, and one fast mostly in the right speaker: soundPool.play(soundId, 0.9f, 0.1f, 0, -1, 0.7f); soundPool.play(soundId, 0.1f, 0.1f, 0, -1, 1.5f); No sound can be heard. I have fiddled with the volumes, priorities and

How to stop playing a Sound via Soundpool?

此生再无相见时 提交于 2019-12-19 19:47:11
问题 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 button: soundPool.play(soundID, volume, volume, 1, 0, 1f); if I press this button twice in the same time, it plays the sound togheter, I want to stop the sound and play again if the user press the button while playing I tryed puting an soundPool.stop

Android Soundpool Load(String path, int priority)

被刻印的时光 ゝ 提交于 2019-12-19 09:57:38
问题 I am trying to load a sound from android. The sound is under res/raw/myownsound.wav . I know that I can already load the sound using: soundPool.load(context, R.raw.myownsound, 1) For customization purposes, I would like to load it using: soundPool.load("res/raw/myownsound", 1) ... but I get the following error : error loading res/raw/myownsound . I also tried the following : soundPool.loadSound("android.resource://upg.GraphismeBase/raw/myownsound", 1) .. but I get an error as well : error

Android Soundpool Load(String path, int priority)

扶醉桌前 提交于 2019-12-19 09:57:32
问题 I am trying to load a sound from android. The sound is under res/raw/myownsound.wav . I know that I can already load the sound using: soundPool.load(context, R.raw.myownsound, 1) For customization purposes, I would like to load it using: soundPool.load("res/raw/myownsound", 1) ... but I get the following error : error loading res/raw/myownsound . I also tried the following : soundPool.loadSound("android.resource://upg.GraphismeBase/raw/myownsound", 1) .. but I get an error as well : error

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

坚强是说给别人听的谎言 提交于 2019-12-19 07:36:17
问题 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 mp3. I've looked into Audio Capture but setAudioSource (int audio_source) only seems to accept MIC recording. Thanks 回答1: No, there's no API for getting the audio output, even for your own app (actually that's not entirely true, because you can get

Android: How to mix 2 audio files and reproduce them with soundPool

荒凉一梦 提交于 2019-12-19 04:01:10
问题 I'm trying to develop an Android aplication that uses some sounds and mix them together for creating music compositions. At the beggining I tried just to reproduce sounds at the same time, but when I was doing that, they got disinchronized, and after several hours reading forums I realized that the best way to reproduce several sounds at the same time in loop mode is just to merge the audio files in one and then reproduce them as a single file. Here is the code I'm using: //Oppening file 1

Android audio programming nightmare - soundpool, audiotrack arrghh?

风格不统一 提交于 2019-12-18 16:13:18
问题 I've built a simple music sequencer Android app that plays multiple audio files. Originally I was using SoundPool to play mp3 files and it worked perfectly on 2.3.4 with an old HTC Droid Incredible. Then I tested it on a Galaxy Nexus running 4.3 and the performance was horrendous. The audio timing all over the place and there were glitches/clicks/pops. So I spent several days making a player using AudioTrack including an mp3 decoder and got it working perfectly on both the Galaxy and the HTC.

SoundPool error: no more track names available

耗尽温柔 提交于 2019-12-18 12:56:11
问题 I'm having troubles with the soundpool class. Here it goes: In my game app (music app btw) I need to reproduce at least 32 short sounds at the same time, so I declare my soundpool like that: private SoundPool sp; sp = new SoundPool(128, AudioManager.STREAM_MUSIC, 0); After that I load all the MP3 sounds needed, about 80 sound of 55KB each. I have no troubles loading all the sounds, but its slow! Well it's no the problem. The real trouble is when I play about 20 sounds at the same time, there