Giter Site home page Giter Site logo

Comments (6)

naomiaro avatar naomiaro commented on May 22, 2024 2

Aha! Did this event miss the README? Some of the events previously I had not written in the docs, and had just used them myself. I'll have to update that.

Glad you like the lib!

from waveform-playlist.

Willena avatar Willena commented on May 22, 2024

Yeah, that's right. May be it could be a future feature to add.

For now you can change the track volume by changing the gain property on a track object: playlist.tracks[0].gain = 0.2
but you will need to restart the player ( click play/pause ) so that it can be taken into acount.

from waveform-playlist.

alexander-daniel avatar alexander-daniel commented on May 22, 2024

@Willena Awesome, thanks!

Yup, from my explorations that was the only way to get it to update the track gain. Will roll with that for now, but it would be super cool to update in real-time the same way the master settings can be emitted and changed

from waveform-playlist.

alexander-daniel avatar alexander-daniel commented on May 22, 2024

@Willena Actually, it IS possible!

Just looked into the src:

https://github.com/naomiaro/waveform-playlist/blob/master/src/Playlist.js#L218

and in my code I did: (sorry its contextual, but i basically just get the track object I'm interested in and pass that into the emit function parameters.

function setGain(trackID, gain) {
    const track = getTrackByID(trackID);
    playlist.ee.emit("volumechange", gain * 100, track);
}

no need for the play/pause dance!

from waveform-playlist.

alexander-daniel avatar alexander-daniel commented on May 22, 2024

@naomiaro All good, I should have looked in the src right away! Super clean and easy to see whats going on once you take the plunge.

I might have a few more questions in the following days, but this is great and does what I need it re: gain setting of tracks, so I'll close this! (Unless you want to keep it open until you update the docs)

Cheers!

from waveform-playlist.

naomiaro avatar naomiaro commented on May 22, 2024

Yeah I'll close it when I update the docs, @alexander-daniel thanks!

from waveform-playlist.

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.