Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Setting PlayingOffset before starting playback  (Read 3738 times)

0 Members and 1 Guest are viewing this topic.

s.baus

  • Newbie
  • *
  • Posts: 45
    • View Profile
Setting PlayingOffset before starting playback
« 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
AudioCuesheetEditor, your #1 CuesheetEditor.

http://sourceforge.net/projects/audiocuesheet

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: Setting PlayingOffset before starting playback
« Reply #1 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.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Setting PlayingOffset before starting playback
« Reply #2 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.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

s.baus

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: Setting PlayingOffset before starting playback
« Reply #3 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 :).
AudioCuesheetEditor, your #1 CuesheetEditor.

http://sourceforge.net/projects/audiocuesheet

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
AW: Setting PlayingOffset before starting playback
« Reply #4 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...
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/