SFML community forums

Bindings - other languages => DotNet => Topic started by: s.baus on October 28, 2014, 07:34:57 pm

Title: Setting PlayingOffset before starting playback
Post by: s.baus on October 28, 2014, 07:34:57 pm
Hello everybody,

I'm using SFML in my Cuesheet Application and have problem with audio playback. I want to start the playback at an offset, which is not the start of the file. Therefore I use this code:

if (this.music != null)
            {
                this.music.PlayingOffset = offset;
                this.music.Play();
                this.music.Volume = this.fVolume;
                this.tUpdateGUI.Start();
                playing = true;
            }

But the playback starts at the beginning, not the offset. Any idea why? Thanks for your help :).

Sven
Title: Re: Setting PlayingOffset before starting playback
Post by: Ixrec on October 28, 2014, 07:52:30 pm
If I recall correctly, you have to set the playing offset *after* playing starts for it to have an effect, so try swapping those first two lines.

I could've sworn there was another thread on this somewhere but I can't seem to find it now.
Title: Re: Setting PlayingOffset before starting playback
Post by: eXpl0it3r on October 28, 2014, 08:09:46 pm
Are you using the latest version of SFML (the C++ version which gets used by the CSFML wrapper)? This issue has been fixed in master, so you might want to upgrade.
Title: Re: Setting PlayingOffset before starting playback
Post by: s.baus on October 30, 2014, 08:04:53 am
Are you using the latest version of SFML (the C++ version which gets used by the CSFML wrapper)? This issue has been fixed in master, so you might want to upgrade.
I use the SFML Binaries provided by SFML.Net package (in /ext/lib) on Windows, and on Linux the standard package of SFML 2.1. Was the bug fixed in 2.1 already, or is the fix in the master branch beyond version 2.1?

Thanks for your information :).
Title: AW: Setting PlayingOffset before starting playback
Post by: eXpl0it3r on October 30, 2014, 08:09:34 am
I'll let you guess once...

It's after 2.1 that's why I said you should use the master...