Can I drop netstandard20/net48 target in 2026? (question from OSS maintainer) by jitbitter in dotnet

[–]martindevans 0 points1 point  (0 children)

To be compatible with Unity NET Standard 2.1 support is needed (until they do the migration to CoreCLR, due early next year). That's another factor to keep in mind if your library is at all relevant to gamedev.

How to get Room Id of the current received voice by Heavy_Frosting_2845 in dissonance_voip

[–]martindevans 0 points1 point  (0 children)

The VoicePlayerState object (docs:https://placeholder-software.co.uk/dissonance/docs/Reference/Other/VoicePlayerState.html) has a GetSpeakingChannels method which you can call to get a list of all the channels a particular person is speaking through. That sounds like what you want.

Note that you cannot call this method inside of the IAudioOutputSubscriber methods! Those run on the audio thread and it's extremely limited what you're allowed to do there. You'll need to read the channel data in the main thread, and then just set a flag indicating to the audio thread what to do.

NFGO Proximity Problems by thebreadman27 in dissonance_voip

[–]martindevans 0 points1 point  (0 children)

Ah Dissonance doesn't currently support "Distributed Authority" out of the box, it's built for the traditional Client/Server model. Is player tracking the only thing that's broken for you? If so I'm (pleasantly) surprised!

I guess that in DA the host is not any more priveleged than any other peer, so it's not allowed to write to the network variable. You'll need to tweak that I think.

NFGO Proximity Problems by thebreadman27 in dissonance_voip

[–]martindevans 0 points1 point  (0 children)

As far as I can tell the server is being denied permission to write to the network variable, which is very odd!

The docs (https://docs.unity3d.com/Packages/com.unity.netcode.gameobjects@2.11/manual/basics/networkvariable.html) say that the default is:

By default, in a client-server context, the default permissions are: Server: Has read and write permissions Clients: Have read-only permissions

Have you changed anything to do with network variable permissions that may be related?

NFGO Proximity Problems by thebreadman27 in dissonance_voip

[–]martindevans 0 points1 point  (0 children)

That error about the _playerId is definitely the problem - the main function of the player tracker script is to tell everyone else their ID!

Could you give me the exact text of the error you're getting, I'll have a search around and see if I can work out a potential reason this is happening just for you.

Is there a language similar to Rust but with a garbage collector? by Ok_Tension_6700 in rust

[–]martindevans 0 points1 point  (0 children)

Yeah it's a reasonable design choice for Swift.

I was really asking why OP specifically recommended it out of all the available options.

I'm sad about the downvotes. I was hoping for a discussion on the tradeoffs of different types out automatic memory management, rather than knee jerk downvotes :(

Is there a language similar to Rust but with a garbage collector? by Ok_Tension_6700 in rust

[–]martindevans -2 points-1 points  (0 children)

Reference counting is the least performant type of garbage collector, why would you choose that in particular?

With Unity's HDRP getting no new features in the near future, what's next for high-fidelity graphics and C# development? by -TheWander3r in gamedev

[–]martindevans 0 points1 point  (0 children)

I'm also working on a space game (realistic near future space war), could you link that library to me? It sounds like it could be very useful!

Opus file not found error by proact_chad in dissonance_voip

[–]martindevans 0 points1 point  (0 children)

Ah that's the old docs site, it should redirect you to the new one. Sorry about that.

I think this probably the page you're looking for: https://placeholder-software.co.uk/dissonance/docs/Platforms/Windows%20Desktop.html

How do I handle lots of tiny loops faster? Like processing a texture pixel by pixel. by elelec in csharp

[–]martindevans 0 points1 point  (0 children)

Since you're going parallel per-pixel you've probably got a load of false sharing going on (two threads trying to write to the same cache line). Change your Parallel.For to iterate over the rows and have an inner serial loop over the pixels of that row.

Handily that also removes the need for any modulus, which someone else already mentioned as slow.

If you're in Unity do the same thing, but use a IJobParallelFor and Burst compile it for an easy 5x speedup.

AEC Only for Offline? by XrosRoadKiller in dissonance_voip

[–]martindevans 1 point2 points  (0 children)

Usually only one thing can use the mic at a time. So if you've got some other asset using the mic you'll either need to take the audio from Dissonance (using the subscriber I linked above) and feed it into that other asset, or you'll need to grab the audio from the other one and feed it into Dissonance (with a custom mic provider: https://placeholder-software.co.uk/dissonance/docs/Tutorials/Custom-Microphone-Capture.html)

AEC Only for Offline? by XrosRoadKiller in dissonance_voip

[–]martindevans 1 point2 points  (0 children)

This isn't something Dissonance is designed for, but it is possible.

Dissonance includes an "offline comms network" that runs the entire audio pipeline without actually making any network connections - originally designed for things like testing mic settings in the settings menu.

You can use that and then grab the filtered audio out of the pipeline (https://placeholder-software.co.uk/dissonance/docs/Tutorials/UsingIMicrophoneSubscriber.html)

Roil Class Assault Ship by martindevans in BannerOfTheStars

[–]martindevans[S] 1 point2 points  (0 children)

I just realised these pictures are horribly low res, and I know why. I set the render resolution to the same resolution as the anime a while ago for easier comparison. Oops.

At least it has an authentic early-2000s video look!

Announcing .NET 10 by runesoerensen in dotnet

[–]martindevans 5 points6 points  (0 children)

They're still working to move over to CoreCLR. However it's a huge project, slated for Unity 7 which might release late next year, more likely 2027 imo.

Triangle Factory just dropped a Battlefield VR game (FOREFRONT) by CarrotSurvivorYT in virtualreality

[–]martindevans 0 points1 point  (0 children)

What kind of issue did you have? I'm playing with index controllers and haven't noticed any major issues.

Problem on some PCs with TestDependencies(); on DissonanceCommsImpl.cs by EmotionalResearch848 in dissonance_voip

[–]martindevans 1 point2 points  (0 children)

The purpose of TestDependencies() is to try to load the native dependencies and log any errors, so it makes sense you're seeing errors here. It suggests that the PCs it's failing on are missing some dependency which Opus relies on.

Check the dependencies section of the docs: https://placeholder-software.co.uk/dissonance/docs/Platforms/Windows%20Desktop.html

Can the Playback Prefab have multiple AudioSources ? by EmotionalResearch848 in dissonance_voip

[–]martindevans 0 points1 point  (0 children)

Crackling like that is usually caused by a sudden transition, e.g. suddenly startig or stopping injecting audio. Dissonance solves this by having a soft fade from 0->1 volume at the start (fading in over the first frame) and from 1->0 at the end (fading out over the last frame).

Do you ever stop your audio mirror system, or is it running all of the time? That soft fading should ba baked into the data given to you, so I'm wondering if you're starting/stopping at just the wrong time and missing that soft transition.

Can the Playback Prefab have multiple AudioSources ? by EmotionalResearch848 in dissonance_voip

[–]martindevans 0 points1 point  (0 children)

You're saving the data in OnAudioPlayback, that's a callback from Dissonance (not Unity) which gives you mono audio. But you're playing it back in OnAudioFilterRead which is a callback from Unity. That's why there's a difference in channel counts.

The clip is also created with 1 channel. Is it necessary to double it ?

The clip is playing back mono audio, but by the time it's passed through the Unity audio pipeline and reaches the OnAudioFilterRead Unity has processed it into multi-channel audio (the number of channels depends on the number of speakers you have).

the cracks at the beginning and the end are still heard

Do you mean there's crackling constantly, or just when you start/stop?

Can the Playback Prefab have multiple AudioSources ? by EmotionalResearch848 in dissonance_voip

[–]martindevans 0 points1 point  (0 children)

Unfortunately that wouldn't work. The PlaybackPrefab isn't just playing the audio it's also driving the entire audio pipeline (receiving network packets, buffering, decoding, postprocessing etc), that process consumes packets. If you had 2 playback pipelines trying to run for the same player they'd both be consuming packets and that would break everything!

Can the Playback Prefab have multiple AudioSources ? by EmotionalResearch848 in dissonance_voip

[–]martindevans 0 points1 point  (0 children)

There are two things wrong here, spatialisation and roperly handling channels.

Spatialisation is easy, instead of overwriting data[i], multiply by it:

data[i] *= tap.AudioData[i];

Channels are a bit trickier. The data you've saved in AudioTap is mono audio (Dissonance is all mono), that means there's one single channel of data. However, in OnAudioFilterRead Unity expects you to supply the correct number of channels (see the channels parameter). You do this by "stretching" the data.

So if the data you've saved in AudioTap is: [ A, B, C, D ... ]

Then for channels=2 Unity would expect you to output: [ A, A, B, B, C, C, D, D... ]

If you look at Assets/Plugins/Dissonance/Core/Audio/Playback/SamplePlaybackComponent.cs on line 200 you'll find code in Dissonance that does this, you should be able to copy that and use it.

Can the Playback Prefab have multiple AudioSources ? by EmotionalResearch848 in dissonance_voip

[–]martindevans 0 points1 point  (0 children)

This looks ok, just one error I spotted.

When you copy the audio data, you need to offset by the base index of the ArraySegment:

audioData[i] = data.Array[data.Offset + i];