jarikomppa / soloud

Free, easy, portable audio engine for games
http://soloud-audio.com
Other
1.69k stars 270 forks source link

soloud.stop(bus_voice_handle) causes all buses to stop #280

Open VitorioK opened 4 years ago

VitorioK commented 4 years ago

Expected behavior: soloud.stop(bus_voice_handle) - should to stop only one bus.

Actual behavior: All buses stop.

Steps to reproduce the problem:

    SoLoud::Soloud soloud;
    soloud.init();
    SoLoud::Bus bus1;
    SoLoud::Bus bus2;
    printf("1. Active voices: %d\n", soloud.getActiveVoiceCount());
    auto h1 = soloud.play(bus1);
    auto h2 = soloud.play(bus2);
    printf("2. Active voices: %d\n", soloud.getActiveVoiceCount());
    soloud.stop(h2); // Stop only bus2, but all buses stop
    printf("3. Active voices: %d\n", soloud.getActiveVoiceCount());

Output:

  1. Active voices: 0
  2. Active voices: 2
  3. Active voices: 0

SoLoud version: 20200207

Operating system: Windows 10 64-bit

Backend used, any other potentially useful information: WINMM or MINIAUDIO

Anuken commented 3 years ago

Can reproduce this on Linux (possibly Android too) with the latest git version - all buses stop when stop() is called for a specific bus, and every bus voice gets invalidated.