Giter Site home page Giter Site logo

Timed play for music streams about sdl-mixer-x HOT 3 OPEN

kcgen avatar kcgen commented on June 3, 2024
Timed play for music streams

from sdl-mixer-x.

Comments (3)

Wohlstand avatar Wohlstand commented on June 3, 2024

So, you probably need the Timed play music call, right? The Chunks API had timed functions, but music lacks that, so, yeah, I'll try add that at evening.

from sdl-mixer-x.

kcgen avatar kcgen commented on June 3, 2024

Ahh, I didn't even see that Timed channel functions! Yes, the equivalent functionality for music would be perfect.

from sdl-mixer-x.

kcgen avatar kcgen commented on June 3, 2024

Thinking about timed play, maybe each stream (and music stream) can have a their own data consumption count-down value instead of relying on SDL timers/ticks.

Their data consumption values would be calculated once when their play function is called with the desire play duration.

The data count depends on us knowing the particular stream's sample rate, bytes per sample, and number of channels (if we support mono/5.1, etc..). So when the user opens the file/RW the first time, we'd want to query the decoder and save those properties.

Every time the callback fires, all the streams' data consumed values would be decremented by their given decoded amount of data (prior to mixing/interpolating up to a common sample rate, bit depth, and number of channel); which would allow each stream to have a unique count-down.

Once a stream's data countdown hits 0 (or less), that stream is no longer played.

from sdl-mixer-x.

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.