Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openmpt source loops even when told not to #35

Open
walksanatora opened this issue Dec 19, 2023 · 2 comments
Open

openmpt source loops even when told not to #35

walksanatora opened this issue Dec 19, 2023 · 2 comments

Comments

@walksanatora
Copy link

Expected behavior:

calling openmpt::set_looping(false) should prevent it from looping

Actual behavior:
audio still loops

Steps to reproduce the problem:

I was using Wind of Fjords and it looped after the song finished even with loop set to false and loop count set to 0 (confirmed by printing with soloud.looping(handle) and soloud.loop_count(handle)

SoLoud version, operating system, backend used, any other potentially useful information:

SoLoud crate version: 1.0.5
default backend for that version
arch linux on kde plasma
cargo version: cargo 1.74.1 (ecb9851af 2023-10-18)

Code example

    let mut sl = Soloud::default().unwrap();
    let mut openmpt = audio::Openmpt::default();
    
    openmpt.load("a-windf.it").unwrap();
    openmpt.set_looping(false);
    
    let handle = sl.play(&openmpt);
    
    while sl.voice_count() > 0 {
        println!("duration: {:?}\nvoices: {}\nauto_stop: {}\nlooping: {}\nloopcount: {}",
        Duration::from_secs_f64(sl.stream_position(handle)),
        sl.active_voice_count(),
        sl.auto_stop(handle),
        sl.looping(handle),
        sl.loop_count(handle),
        );
        std::thread::sleep(std::time::Duration::from_millis(100));
    }

which this prints (at the time of writing and letting it run)

duration: 688.277669046s
voices: 1
auto_stop: true
looping: false
loopcount: 0

which that duration is a bit above the 3:36 that Wind of Fjords is

@MoAlyousef
Copy link
Owner

Thank you for the report. I’ll try to investigate the issue over the weekend.

@MoAlyousef
Copy link
Owner

I was able to get the same behavior and it seems to be an upstream issue. Check the documentation of Openmpt.setLooping here:
https://solhsa.com/soloud/modplug.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants