Comments (9)
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.
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.
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.
I need the above test verified today if it's going into FNA 16.08.
from fna.
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.
Does this commit do it?
from fna.
Knee deep in multiplayer bugs today, I should be able to test tomorrow and confirm fix.
from fna.
This works for our test case. Infinite sound, pitch and volume variation enabled.
from fna.
Cool, this might get interesting depending on how we solve loops, but for now...!
from fna.
Related Issues (20)
- Document a stable .NET 7 workflow HOT 5
- Fn HOT 2
- [MojoShader] Preshaders with bool outputs aren't supported HOT 3
- mono_thread_internal_set_priority: unknown policy 5
- Expose FAudioContext or Device Handle HOT 3
- arm64 fnalibs for Apple Silicone Macs HOT 3
- Add GitHub Actions HOT 1
- Terraria: sigsegv when using vulkan renderer in newer versions of FNA HOT 3
- Add DPI Awareness hint for Windows
- Do a second take of #442 HOT 1
- Support for net8.0-ios targets HOT 2
- Incorrect Wiki instructions: Chapter 5 Creating New Projects HOT 1
- SharpFont + SpriteFont HOT 2
- VertexPositionColorNormalTexture HOT 3
- System.NullReferenceException when using BasicEffect HOT 2
- Question about the process of porting NativeAOT to Consiles HOT 3
- Newer Shader Models
- Add extension method for loading mipmap texture from stream HOT 3
- White artifacts on certain color values in DDS HOT 5
- [BUG] Can't download clone the Wiki HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fna.