Giter Club home page Giter Club logo

Comments (9)

flibitijibibo avatar flibitijibibo commented on August 12, 2024

As far as I can tell both are handled at loop time. What happens is that the current instance plays out...

https://github.com/FNA-XNA/FNA/blob/master/src/Audio/Cue.cs#L503

... then we play the wave again...

https://github.com/FNA-XNA/FNA/blob/master/src/Audio/Cue.cs#L899

... and from there, the pitch/volume are again randomly made, since as far as the CueData is concerned it's a totally new sound, with a check for when the max loopcount is hit:

https://github.com/FNA-XNA/FNA/blob/master/src/Audio/CueData.cs#L837

Note that the AL only does looping if the XACT data indicates both an infinite loop as well as no variation data, as determined at parse time:

https://github.com/FNA-XNA/FNA/blob/master/src/Audio/CueData.cs#L426

You will need to either see if other event types found at parse time have indicators for variation on loop, or determine if there are additional checks needed for avoiding AL loops.

from fna.

teamtwentythree avatar teamtwentythree commented on August 12, 2024

Sound with looping set to infinite repros, setting it to 254 and the repro goes away.

I was able to fix it by updating https://github.com/FNA-XNA/FNA/blob/master/src/Audio/CueData.cs#L525

I just replaced false with minVolume != maxVolume || minPitch != maxPitch

That said I'm not sure what these different events are, so not sure if that fix is correct or not.

from fna.

flibitijibibo avatar flibitijibibo commented on August 12, 2024

That makes sense to me, but what happens if you disable variation on loop for that Cue in the XACT tool? Is it still the same event type? If it falls to the next type that has the known bool, I'm willing to write that fix in and call it a day!

from fna.

flibitijibibo avatar flibitijibibo commented on August 12, 2024

I need the above test verified today if it's going into FNA 16.08.

from fna.

flibitijibibo avatar flibitijibibo commented on August 12, 2024

There's MUCH more to this than I was expecting.

There is indeed a check for variation types, but it depends on the type of variation and which thing is varying. So, take this XACT data for example:

http://www.flibitijibibo.com/Win.zip

  • VYPY is volume variation on loop and pitch variation on loop.
  • VYPN is volume variation on loop and pitch variation fixed.
  • VNPY is volume variation fixed and pitch variation on loop.
  • VYPYADD is volume variation and pitch variation with add instead of replace.

The data for these are stored here:

https://github.com/FNA-XNA/FNA/blob/master/src/Audio/CueData.cs#L510

Here's the hex output:

  • VYPN: 0x3200
  • VNPY- 0x3100
  • VYPY - 0x3300
  • VYPYADD - 0x3304

No idea what the upper 4 bits are, but the second 4 bits are for variation on loop for vol/pitch/freq/qfactor, and the lower 4 bits appear to be tied to add/replace for variation loops. Also dunno what the third set of bits are.

This is going to take more time, so let's skip this for 16.08 and look at it for 16.09.

from fna.

flibitijibibo avatar flibitijibibo commented on August 12, 2024

Does this commit do it?

d5d7d63

from fna.

teamtwentythree avatar teamtwentythree commented on August 12, 2024

Knee deep in multiplayer bugs today, I should be able to test tomorrow and confirm fix.

from fna.

teamtwentythree avatar teamtwentythree commented on August 12, 2024

This works for our test case. Infinite sound, pitch and volume variation enabled.

from fna.

flibitijibibo avatar flibitijibibo commented on August 12, 2024

Cool, this might get interesting depending on how we solve loops, but for now...!

from fna.

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.