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

Author Topic: Point looping on sounds and music  (Read 2906 times)

0 Members and 1 Guest are viewing this topic.

NinjaFighter

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
    • http://www.sebagames.wordpress.com
Point looping on sounds and music
« on: May 28, 2012, 08:56:04 pm »
I know that the ogg files have "tags" that could be useful to make point loops in a bgm or sound. Usually, these tags in games are specially useful to make some type of sounds, and a full bgm single file that will be capable to rendering a music from the start, and looping it from the LOOP point, instead of the start.
Example:
The music have 3 sections:
Start --------> LoopStart ---------> LoopEnd --------> (end of file)

With this practice, the music starts from Start point, and when the music is "Looping" and reach to LoopEnd tag,  the stream go to LoopStart tag, if not is "Looping", the streaming continues until reach end of file.  :)

If you put this functionality on SFML2 (I'm not sure if it's possible or not, but some applications can do this (RPG Maker for example)), SFML2 could be one step forward than XNA and other common frameworks.

This feature is very useful for various reasons:
1) There's no required changes in the methods of sfml2, at least, can require a bool property named "UseLoopPoints" if you want to deactivate them. (can be deactivated by defalut if you want)
2) If you want to put a large 3 section bgm file (the usual way in various game music) you don't have to repeat the music on the file, and you can loop infinitely, without hear any fadeout or end of file.
3) (similar to 2) The music can start with a intro section that cannot be repeated never.
4) The music file size that can be much smaller. ;)

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Re: Point looping on sounds and music
« Reply #1 on: May 28, 2012, 10:08:39 pm »
Does it concern the Ogg container of the Vorbis audio codec ?

Anyway, shouldn't it be automatically handled by the Ogg demuxer or Vorbis decoder ?
What I find odd though, is that you could have musics of infinite duration. But why not.
Want to play movies in your SFML application? Check out sfeMovie!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Point looping on sounds and music
« Reply #2 on: May 28, 2012, 10:56:37 pm »
Please search before posting >:(
https://github.com/SFML/SFML/issues/177
Laurent Gomila - SFML developer

NinjaFighter

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
    • http://www.sebagames.wordpress.com
Re: Point looping on sounds and music
« Reply #3 on: May 28, 2012, 11:01:38 pm »
whops! sorry :-X