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

Feature: Respect AudioContext.outputLatency #1455

Open
Danielku15 opened this issue May 5, 2024 · 0 comments
Open

Feature: Respect AudioContext.outputLatency #1455

Danielku15 opened this issue May 5, 2024 · 0 comments
Assignees
Labels
area-player Related to the audio playback engine. platform-all Affects all platforms state-accepted This is a valid topic to work on. type-feature 💡

Comments

@Danielku15
Copy link
Member

See #1454

AlphaTab currently does not respect the AudioContext.outputLatency describing the timely difference between us passing the audio samples to the context and the actual time it will be heard by the user.

This leads to a shift of the cursor and seen audio.

AlphaTab should correctly expose the time and tick position according to the heard audio on the synthesizer area. Internally it might still need to keep its "synth" timeline. Things to consider:

  • It seems the audio latency is not static but can change any time.
  • There is a time axis within the midi sequencer, and one on the synth level.
    • The sequencer position decides which midi events to play next for audio generation.
    • The one on synth level is handling the actual audio position according to the samples played by the output. Here we likely need adjustment
  • The synth level audio is also used to determine whether the playback finished (and potentially seek back to the start of the desired playback range - if looping is active).
  • When looping and jumping/seeking back to an older position, we need to be careful on just applying the latency wrongly. We might be stopping/seeking too early resulting in a strange cursor jump/positioning.
  • Testing might be tricky as I'm not aware of a way to modify the latency.
@Danielku15 Danielku15 added type-feature 💡 state-accepted This is a valid topic to work on. area-player Related to the audio playback engine. platform-all Affects all platforms labels May 5, 2024
@Danielku15 Danielku15 self-assigned this May 14, 2024
@Danielku15 Danielku15 moved this to Candidate in alphaTab 1.4-1.x May 14, 2024
@Danielku15 Danielku15 moved this from Candidate to Todo in alphaTab 1.4-1.x May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-player Related to the audio playback engine. platform-all Affects all platforms state-accepted This is a valid topic to work on. type-feature 💡
Projects
Status: Todo
Status: No status
Development

No branches or pull requests

1 participant