solarus-games / solarus

This repository was moved to GitLab: https://gitlab.com/solarus-games/solarus
http://www.solarus-games.org
Other
710 stars 133 forks source link

Add support of OGG looping #643

Closed christopho closed 8 years ago

christopho commented 9 years ago

Feature request from GGuy:

I think it would be great if OGG files could loop after playing the intro of a song using the same method as RPG Maker in which metadata tags are used to mark PCM sample points for beginning and ending of loops. Here's an explanation on how this works when creating OGG files for RPG Maker. http://forums.rpgmakerweb.com/index.php?/topic/10987-make-looping-bgm-part-1-ogg-vorbis/ ZDoom also has this feature which is documented here with their source code. http://zdoom.org/Changelog/2424/files

Here's a loopable OGG with proper metadata tags. The engine would need to know how to read the metadata and start the loop at the correct PCM sample point when it hits the loop end tag. BGM_DUNGEON_CASTLE.ogg

"LOOP_START" & "LOOP_END" would be the preferred tag names for this feature as seen in the attached image.

loop

fosamax commented 9 years ago

I second this as there's seems to have a slight increase in performance when using ogg over it which could be usefull for mobile port like the GCW Zero (music tend to stutter when switching screen with the it music and not with the ogg). Unfortunately, most it music use intro/loops.

Alternatively, you could allow the engine to handle 2 files for music : 1 for intro/ 1 for loop but the 2 resulting files would probably use more disk space than 1 with appropriate metadata.

christopho commented 8 years ago

Tags will be LOOPSTART and either LOOPEND or LOOPLENGTH (no underscore). It seems more consistent with other software, at least RPG Maker.