Code Monkey home page Code Monkey logo

Comments (3)

Danielku15 avatar Danielku15 commented on August 19, 2024

The problem is caused only when alphaTab uses the "ScriptProcessorNode" instead of the "AudioWorklets". AudioWorklets are not available if:

  1. AlphaTab is bundled with WebPack (webpack has only very limited audio worklet support, not compatible with alphaTab)
  2. AlphaTab is used in a non-secure context
  3. The browser really doesn't support AudioWorklets

On alphaTab.net rule 1. applies.

And the root cause seem to be an inconsistency in the time calculation. For this file (only on the second round) the "tick position" indicates that the player has not yet finished, but the "time position" marks the file as finished.

There must be somewhere an inconsistency in the reporting of played samples. Maybe some samples from the previous playback are still in the buffer and played additionally leading to a wrong calculation on the positions.

from alphatab.

Danielku15 avatar Danielku15 commented on August 19, 2024

Update: I could now reproduce it also on the AudioWorklets.

from alphatab.

goodgame365 avatar goodgame365 commented on August 19, 2024

Update: I could now reproduce it also on the AudioWorklets.

I found a temporary solution, which is to add a stop() method when he plays to the end and there is no set to replay, forcing it to return to its initial state.

\playground\control.js

at.playerPositionChanged.on(function (args) {
... ....

    //Add new code here.
    if (!at.isLooping && args.currentTime === 0 && args.endTime > 0) {

        at.stop();
    }
});

from alphatab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.