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

Consider format specific extensions #98

Open
ericoporto opened this issue Mar 31, 2024 · 0 comments
Open

Consider format specific extensions #98

ericoporto opened this issue Mar 31, 2024 · 0 comments

Comments

@ericoporto
Copy link
Contributor

ericoporto commented Mar 31, 2024

Currently the SDL_sound interface is opaque and there isn't difference when interfacing with different formats.

As such seeking, duration and everything else uses milliseconds. This is fine in general.

Some issues may arise though, when using "tracker-like" formats as mentioned in this comment here

/* Seek to a particular position in the song. Note that seeking and MODs don't mix very
* well. Some mods will be missing instruments for a short time after a seek, as ModPlug
* does not scan the sequence backwards to find out which instruments were supposed to be
* playing at that time. (Doing so would be difficult and not very reliable.) Also,
* note that seeking is not very exact in some mods -- especially those for which
* ModPlug_GetLength() does not report the full length. */
MODPLUG_EXPORT void ModPlug_Seek(ModPlugFile* file, int millisecond);

In old AGS versions, before we switched to SDL_sound, beside using milliseconds two formats specifically supported an alternative way of using duration and seeking

  • MIDI - which used the beat number
  • MOD/XM/S3M - the pattern number (the "DUMB" library we used called it "orders")

This issue is more a question, if it would be acceptable or not to add some way to add format specific extensions in SDL_sound, and how it would work.

If such a way type of extension is acceptable, then the design could be done in a different issue, as I would like to add these two functionalities to SDL_sound to help us keep our backwards compatibility - looking at the dependencies in the repository it looks like the information is available in them, it's about devising an API to recover.

Additional context

adventuregamestudio/ags#1695

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

1 participant