• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps soundpool issue

prabh0023

Lurker
Hello all,

So, this is what I do.

In core class

Code:
package com.mygdx.game;

import com.badlogic.gdx.
ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;

public class MyGdxGame extends ApplicationAdapter {
  SpriteBatch batch;
  Texture img;

  Sound rocketLoop;
  
  @Override
  public void create () {
    batch = new SpriteBatch();
    img = new Texture("badlogic.jpg");
    rocketLoop = Gdx.audio.newSound(Gdx.files.internal("rocket.ogg"));
    rocketLoop.loop();
  }

  @Override
  public void render () {
    Gdx.gl.glClearColor(1, 0, 0, 1);
    Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
    batch.begin();
    
    batch.draw(img, 0, 0);
    batch.end();
  }
}

After debugging I've traced it down to Soundpool.load().


I get an error, and nothing plays. But, with "Music" it plays.
04-29 15:37:33.580 21325-21381/com.mygdx.game E/OMXMaster: A component of name 'OMX.qcom.audio.decoder.aac' already exists, ignoring this one.

Please help! It works fine with desktop projects. I can't find shit on google.

Thanks
 
Back
Top Bottom