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

前端 未结 7 1786
花落未央
花落未央 2020-12-24 14:27

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
 Erro         


        
相关标签:
7条回答
  • 2020-12-24 15:08

    I had to play around 10 Sounds in parallel for a Drumkit-Simulation. Therefore, I put every sound in an own soundpool and used StreamIds to identify and stop any equal sound, in case it was already playing.

    int newStreamID = soundPool.play(soundIDs.get(0), volume, volume, 1, 0, randomFloatRate);
    if (StreamID != null) {
        soundPool.stop(StreamID);
    }
    StreamID = newStreamID;
    

    As far as I know Soundpool decompresses the audiofiles, so you can save CPU-Usage by using the .wav format.

    For changing Audio formats I use FormatFactory

    0 讨论(0)
提交回复
热议问题