Photon Voice 2.0 causing Unity to freeze

I'm using Unity 2018.2.13, but I've also tested on 2018.2.6 and had the same effect.

When I try to run Photon Voice 2.0 in my scene, it'll sometimes cause Unity to freeze up when I click on the play button. It seems that the first time I try to run it, it works fine, but any subsequent time, it'll freeze up. Sometimes it doesn't seem to follow this pattern so I'm very bewildered.

This bug seems to happen in the example PUN demo that's provided in the asset, but the minimal demo and the UI demo do not seem to have this bug.

My game is a VR game for the Vive and Rift, I see no Freeze/Crash on the Vive, but when I test with the Rift, I'm seeing the game freezing briefly, and then crashing. I put in some debug statements, and it looks like within the MicWrapper constructor, the crash happens in: this.mic = Microphone.Start(device, true, 1, frequency);

I should also add that I too am making a VR game and have imported SteamVR to the project. I did a test with Unity 2018.2.3f1 without SteamVR, ran the Voice Demo and it didn't freeze. but once I imported SteamVR it would freeze after the second or third time I press play. Don't know if I'm the only one getting this result. Would be awesome if @PygmalionTheus or anyone else can test with and without SteamVR.

FYI, I'm also speaking to the support team via email. Thanks to Hamza and Tobias for the great support. It was suggested that I try using the Photon Microphone instead of the Unity Microphone. Making this change eliminated the freezing and crashing, so it's something others may want to try. Now my only remaining problem is that when I test with 2 players entering a room, only the 2nd player entering is able to be heard. The first player to enter cannot be heard by the 2nd. Pretty weird! It's so close to working, but I just have this one remaining issue.

I want to focus on the Unity Editor freezing issue here.Regarding other errors or crashes either start a new discussion or search in the forum if there is one already. For instance, there is this Bug Report here.

Tried in new project: Got a 200 errors.Started another new project, downloaded Pun2 then imported your package:

Assets/Photon/PhotonVoice/Code/Recorder.cs(107,72): error CS1729: The type `UnityEngine.Logger' does not contain a constructor that takes `0' arguments

Assets/Photon/PhotonVoice/Code/Recorder.cs(107,50): error CS1502: The best overloaded method match for `Photon.Voice.AudioInEnumerator.AudioInEnumerator(Photon.Voice.ILogger)' has some invalid arguments

We have updated Photon Voice to 2.1 now, no need for that unreleased package version from Dropbox anymore.So you are using Unity-2018.2.10f, right?Mac, Windows or Linux? or the editor freezing happens on more than one OS?Which target platform? or the editor freezing happens on more than one target platform?

Could you confirm the following:

- In a clean/fresh/new/empty project- You import Photon Voice 2.1 only (do not import any other asset)- In one of the demos scenes, the freezing happens when you enter play mode multiple times? or you need to force code compilation by changing and saving the code?

Could you check if "Photon/PhotonVoice/Code/Editor/ExitPlayModeOnCompilation.cs" exists?

We are using unity 2017.4.15 (LTS) and Photon 2.1.We also notice crashes when we are making use of Photon voice. The Unity Editor keeps freezing the second time we press Play. Without voice our scene is perfectly fine.We tried to reimport after restarting unity without pressing play to avoid issues with the library imports. We tried to put the microphone on Photon instead of Unity. Unfortunately we keep having this issue. The same issue also arose in the DemoVoicePun-Scene (Freezes after 2-3 times using the play-stop button in the unity editor.)Is there anything else we could try?

@JohnTube we've isolated the crash to the Recorder initialization. Manually calling GetComponent().Init() before joining a room causes a crash. I'm guessing that similar code is automatically called when joining to a room, because the game also crashes then.

Also guessing that Recorder initialization interfaces with AudioIn.dll (Windows) and audioinaec.aar (Android) because changing these libraries affects this crash behavior.

Could you start a separate forum discussion about this as crashes are different from Unity Editor freezing?Also in the new discussion provide any crash log/report/dump and tell us if the crash happens in the Unity Editor or using build(s) on actual device(s)? And what platforms does the crash happen on? Windows and Android only? If you also happen to have minimal repro steps to trigger the crash that would be very good to have. Does the crash happen on any of the demos provided in the package?