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

Seeking #6

Open
7 of 9 tasks
p0nce opened this issue Apr 10, 2020 · 9 comments
Open
7 of 9 tasks

Seeking #6

p0nce opened this issue Apr 10, 2020 · 9 comments
Labels
enhancement New feature or request

Comments

@p0nce
Copy link
Contributor

p0nce commented Apr 10, 2020

  • MP3
  • WAV
  • OGG
  • XM
  • MOD
  • FLAC
  • OPUS
  • implement a canSeek function, and a isModule function
  • complete seeking for modules
@p0nce
Copy link
Contributor Author

p0nce commented Oct 31, 2021

OGG seek fails, we're at stb_vorbis 1.10

The subsequent commits that talks about seeking are:
commit 7c4eb44a636ab398b1aea872e4f5792ad66d7706
Author: Dougall Johnson <dougallj@gmail.com>
Date:   Tue Oct 1 20:47:29 2019 +1000

    stb_vorbis: fix seeking in files with audio packets in header pages

    Fixes #682, #580

commit 2abc5c6ced37e2d70a5e7401dbbb9cfc5700995e
Author: Dougall Johnson <dougallj@gmail.com>
Date:   Tue Oct 1 16:37:22 2019 +1000

    stb_vorbis: fix seek_to_sample_coarse failure near page end

commit 6ca87a9e0ec90ace080f172ecda3e1850c8b4beb
Author: Dougall Johnson <dougallj@gmail.com>
Date:   Tue Oct 1 16:36:41 2019 +1000

    stb_vorbis: fix theoretical seek performance problem


commit d2de2be10fdb1cf459e194b40302af8f6a8a0c7b
Author: Sean Barrett <sean@nothings.org>
Date:   Fri Mar 3 05:48:37 2017 -0800

    vorbis: propagate errors better on seek failure (e.g. when coarse seek fails)

@p0nce
Copy link
Contributor Author

p0nce commented Oct 31, 2021

Backported 2abc5c6ced37e2d70a5e7401dbbb9cfc5700995e and 7c4eb44a636ab398b1aea872e4f5792ad66d7706 but no better with OGG.

@p0nce
Copy link
Contributor Author

p0nce commented Oct 31, 2021

For OGG best course of action is to re-re-translate stb_vorbis.c

@p0nce
Copy link
Contributor Author

p0nce commented Oct 31, 2021

Current situation:

  • WAV seeking works, is sample accurate.
  • MP3 seeking works, haven't check accuracy. (EDIT: sample-accurate)
  • FLAC seeking works, is sample accurate.
  • OPUS is not sample accurate (usually a 64ms difference), haven't checked mono support.

Others not implemented.

@p0nce
Copy link
Contributor Author

p0nce commented Oct 31, 2021

Tag v1.3.6 for that above state.

@p0nce
Copy link
Contributor Author

p0nce commented Nov 7, 2021

OGG seeking with new stb_vorbis 1.22 translation in v1.3.7

@p0nce
Copy link
Contributor Author

p0nce commented Nov 29, 2021

@LunaTheFoxgirl I think canSeek can be instead isModule?

Spec time!

If isModule, then you get to use the module function you introduced.
if !isModule, then you can use seekPosition() and tellPosition() ; those do not make sense in tracker module.

What do you think? (also, name for isModule?)

@LunaTheFoxgirl
Copy link
Collaborator

LunaTheFoxgirl commented Nov 29, 2021

Maybe both? There may be audio formats added in the future that don't support seeking right away, you'd need to be able to query that too.

Also if more tracker formats are added later you'd need to be able to tell if that's seekable too (MOD files weren't initially seekable so I had to write my own small implementation for that, for example)

@p0nce
Copy link
Contributor Author

p0nce commented Nov 29, 2021

Both then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants