logo       

[android-developers] Heap size overflow after I loaded audio file in SoundP: msg#04189

AndroidDevelopers

Subject: [android-developers] Heap size overflow after I loaded audio file in SoundPool!!


After the program executed "SoundPool.load( "/sdcard/audio.MP3", 1 )"
sentence, the program crashed and threw the log "Heap size overflow!
req size: 1073664, max size: 1048576".

My source code is listed as blow. What is the root cause for this
error?? Thanks!!

/*============================================================
private final String SPEECH_FILE_FULL_NAME = "/sdcard/audio.mp3";

AudioManager mAudioManager = ( AudioManager )( getSystemService
( Context.AUDIO_SERVICE ) );
float mVolume = mAudioManager.getStreamVolume
( AudioManager.STREAM_MUSIC );

int mSoundId = mSoundPool.load( SPEECH_FILE_FULL_NAME, 1 );
mSoundPool.setRate( mSoundId, 1.2f );
mSoundPool.play( mSoundId, mVolume, mVolume, 1, 0, 1.2f );
/*============================================================
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
android-developers-unsubscribe@xxxxxxxxxxxxxxxx
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | Mail Home | sitemap | FAQ | advertise