开发者

Java Mixer return 1 on Linux(Ubuntu 11.04)

开发者 https://www.devze.com 2023-03-22 19:15 出处:网络
Here my script public static 开发者_JS百科int getMaxSimultaneousSounds( AudioFormat playbackFormat)

Here my script

    public static 开发者_JS百科int getMaxSimultaneousSounds(
    AudioFormat playbackFormat)
{
    DataLine.Info lineInfo = new DataLine.Info(
        SourceDataLine.class, playbackFormat);
    Mixer mixer = AudioSystem.getMixer(null);

    int maxLines = mixer.getMaxLines(lineInfo);
    if (maxLines == AudioSystem.NOT_SPECIFIED) {
        maxLines = 32;
    }

    return maxLines;
}

it's return 1. So i cannot play sound simultaneously but on Windows XP SP2 it return 32 so i can sounds clearly.

How to fix this?

Note: I run Ubuntu 11.04 on VirtualBox

UPDATE: I have tried run on real Ubuntu 11.04(without virtual) but the result is same.

0

精彩评论

暂无评论...
验证码 换一张
取 消