DirectSound: List of further ideas

This forum is currently in read-only mode.
From the Asset Store
Template for scrollable list, fully documented in comment and video
  • I would like some automations available in the directsound object regarding music. Some features that would greatly benefit me would be

    Autoplay music to channel - allow me to control which channel the music plays on. Reserving and controlling channels without having to always add play events will greatly simplify things.

    Auto fade music / channel to (volume) for (time).

    Auto fade out music / channel for (time) and stop playing.

    Autoplay with fade in for (time).

    And if it were a perfect world, a little bit of math applied to the automations could provide

    Fade Style:

    Linear

    Exponential (slow rise/fall)

    Exponential (fast rise/fall)

    Anybody have any more to add?

  • Getting music to fade should be easy with events. Use a variable for the volume and modify it as necessary.

    If variable 'volume' is greater than x (x=desired volume) then subtract amount*timedelta from variable 'volume'.

    Amount is how much you want per second. 100*timedelta will go from 100 to 0 in 1 second. 50 will take 2 seconds. If variable volume is 0, stop playing.

    You can use a second variable to affect the amount, though that gets a little tricker.

    Admittedly, my sound card isn't working, so I can't test it. But it should work in theory.

  • Good ideas. I wanted to do Play Music on Channel, but it's a bit complicated (means decompressing an MP3/OGG/module or whatever to a WAV buffer), but I'll see what I can do.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Didn't know the music-to-channel was complicated. To be honest, if that process would be anything other than instantaneous I'd rather do without it.

    I have been encountering bugs where Directsound will duplicate my music played, and it will lose the ability to control one of the two instances of that music. I have already filed this bug on SourceForge. But it kinda tells me that the ability to play more than one mp3 with the object exists, even if at this point both cannot be controlled separately.

    Arima:

    Yes, events would provide a means for most of what I want to accomplish. In the case where the same functions will be used multiple times across layouts and programs, having these abilities automated by the object will do wonders.

    In either case, I will be uploading tutorial .caps when I get around to working with directsound more closely.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)