Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7640891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:47:10+00:00 2026-05-31T08:47:10+00:00

I am having a problem With SoundPool as it refuses to work with my

  • 0

I am having a problem With SoundPool as it refuses to work with my .ogg files. I am getting this error:

AudioFlinger could not create track, status: -12
 Error creating AudioTrack

I’ve found a thread concerning this and the (possible) answer is:

Make sure you use .ogg media files with constant bitrate!

Is this the case? If yes – which application to use (Audacity doesn’t support .ogg custom export settings). If not – what else could be wrong?

As a side note – before I used MediaPlayer but now I want to play a few sounds parallel.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T08:47:12+00:00Added an answer on May 31, 2026 at 8:47 am

    MAJOR EDIT: FOUND A WAY TO FIX YOUR DAY!! SCROLL DOWN BELOW!!

    I’m in the same boat with you. Before reading, I must let you know that I failed to provide an answer that can fix this problem.

    I have seen many, many Stack Overflow topics regarding SoundPool, but I haven’t seen a lot of SoundPool problems with this in regard with Java code from an Android book:

    AudioTrack: AudioFlinger could not create track, status -12.
    SoundPool: Error creating AudioTrack.

    Here’s the code snipped from Beginning Android 4 Game Development source code provided here (see below). You get the explosion.ogg file there (in the trunk, find the /asset folder of Chapter 4 – Android Basics). You have to click on “View raw file” on your right to obtain the file.

    All I did was I copied the source code directly into Eclipse, and added the explosion.ogg file provided from the trunk, into my project. I executed Android emulator, tried playing the file, and I can tell you I still get the same Logcat errors quoted above.

    A person provided a video on Youtube stating that SoundPool works normally. Video link is given below. I did what the video instructed me to code, I grabbed the same explosion.ogg file I got from the second link provided above. I still get these errors:

    03-13 05:17:10.143: E/AudioTrack(3370): AudioFlinger could not create track, status: -12
    03-13 05:17:10.143: E/SoundPool(3370): Error creating AudioTrack

    I do know that SoundPool exists since Android 1.0, at API level 1. There shouldn’t be any reason for SoundPool to fail to work, even when I have proof that SoundPool works (the video link, 2nd one).

    These are my findings and may or may not help others in a good way. In short, you’re not alone here.

    Source:

    1. http://code.google.com/p/beginning-android-games/source/browse/trunk/ch04-android-basics/src/com/badlogic/androidgames/SoundPoolTest.java
    2. http://www.youtube.com/watch?v=ioGWpu8Ud7A

    EDIT: I am able to play sounds from SoundPool.

    Here’s my code:

    package nttu.edu.test;
    
    import nttu.edu.R;
    import android.app.Activity;
    import android.media.AudioManager;
    import android.media.SoundPool;
    import android.os.Bundle;
    import android.view.View;
    import android.view.View.OnClickListener;
    import android.widget.TextView;
    
    public class SoundPoolTest extends Activity implements OnClickListener {
        SoundPool soundPool = null;
        int explosionId = 0;
    
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            TextView v = new TextView(this);
            v.setOnClickListener(this);
            setContentView(v);
            this.setVolumeControlStream(AudioManager.STREAM_MUSIC);
            v.setText("Click anywhere to play the sound.");
        }
    
        protected void onResume() {
            super.onResume();
            if (soundPool == null) {
                soundPool = new SoundPool(5, AudioManager.STREAM_MUSIC, 0);
                explosionId = soundPool.load(this, R.raw.explosion, 1);
            }
        }
    
        protected void onPause() {
            super.onPause();
            if (soundPool != null) {
                soundPool.release();
                soundPool = null;
            }
        }
    
        public void onClick(View v) {
            if (explosionId != 0)
                soundPool.play(explosionId, 1, 1, 0, 0, 1);
        }
    }
    

    What I did was refactor my code around. I learned this tip from one of the comments in the Youtube video link, where the author of the comment goes by the name of “ErichLancaster”. All credits go to him. I hoped this helped you out.

    I also set the Android emulator resolution size to QVGA, if it really matters or not.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having problem getting the source and header files added into my Eclipse CDT
I am having problem with writing PDF files to browser. Other mime types work
Having problem with the middle Div not expanding to the width http://acs.graphicsmayhem.com/images/middiv.jpg Ok, how
We're having problem with a huge number of legacy stored procedures at work. Do
I am having problem in getting reference of Ajax control extender using $find() or
I'm having problem selecting an element with an id like this <li =0f:Bactidol_Recorder.mp4>. I
Having problem with this bit of code qith jQuery. it should pick the values
I having problem to update the counter (integer value). this is the definitions of
having problem with null pointer exception and i read few article bout that error
i having problem with sessions in localhost, the problem is the session doesn't work

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.