techdiem / BeatSaberMicMuter

A Beat Saber mod that automatically mutes a selected microphone while ingame
MIT License
7 stars 0 forks source link

Please update for 1.34.2 <3 #1

Closed Fatalution closed 1 month ago

Fatalution commented 8 months ago

Hello!

I used to have your mod but can't use it now because of the Unity and BSIPA changes. It would be really great if you could fix this mod for the 1.34.2 verison of the game. The mod itself is VERY useful, at least to me.

Thanks in advance!

techdiem commented 2 months ago

Hello Fatalution, thank you for your patience, I tried updating my mod for the changes you mentioned, but I ran into a problem. The game crashes at soon as my mod accesses the windows sound API (in this case right at launch, because it fetches the list of installed microphones) I switched the library used to interact with the API, this allowed me to trace the issue, but it doesn't solve it. If I create a little test console application which executes the exact same call as the mod, it works like a charm. It seems like the problem lays in the interaction with APIs of the underlying Unity runtime, I found this forum post from a long time ago which mentions exactly my problem: Unity forums (Except that I'm not using NAudio, but its the same API call)

Because I have no experience developing in c++, I currently cannot implement the workaround mentioned in this post and therefore not make the mod working again. I wonder how it worked in the first place, because this issue already exists quite some time. Maybe someone from the BSMG discord can give a hint, but this is a rather specific problem, but I will try. Sorry for the inconvenience.

Fatalution commented 1 month ago

Hello Fatalution, thank you for your patience, I tried updating my mod for the changes you mentioned, but I ran into a problem. The game crashes at soon as my mod accesses the windows sound API (in this case right at launch, because it fetches the list of installed microphones) I switched the library used to interact with the API, this allowed me to trace the issue, but it doesn't solve it. If I create a little test console application which executes the exact same call as the mod, it works like a charm. It seems like the problem lays in the interaction with APIs of the underlying Unity runtime, I found this forum post from a long time ago which mentions exactly my problem: Unity forums (Except that I'm not using NAudio, but its the same API call)

Because I have no experience developing in c++, I currently cannot implement the workaround mentioned in this post and therefore not make the mod working again. I wonder how it worked in the first place, because this issue already exists quite some time. Maybe someone from the BSMG discord can give a hint, but this is a rather specific problem, but I will try. Sorry for the inconvenience.

All good! Kepp in mind that 1.29.4+ uses newer Unity version. It might be the case that the bug wasn't present in Unity 2019 (Beat Saber uses Unity 2021.3.16f1 currently)

techdiem commented 1 month ago

I looked into it and got it working with a custom written c++ dll library. I just need to clean up the code, figure out the correct build process and test all the features of the mod. So stay patient, it took a long time, but I finally found time to maybe get the mod compatible with the newest version again.

Fatalution commented 1 month ago

I looked into it and got it working with a custom written c++ dll library. I just need to clean up the code, figure out the correct build process and test all the features of the mod. So stay patient, it took a long time, but I finally found time to maybe get the mod compatible with the newest version again.

Would be awesome if you could compile for 1.34.2 and 1.37.1 separately, as some people are still using 1.34.2 (me included) as some mods are being updated to 1.37.1 :)

Thanks for doing all this!

techdiem commented 1 month ago

Hello, I got it to work without the c++ dll using a more recent version of the audio lib, which fixed issues related to unity compatibility. Check out the releases section for new builds. Thank you for your patience!