Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Resolved Recorder gives error when starting recording programmatically

Discussion in 'Audio & Video' started by KayH, Mar 23, 2023.

  1. KayH

    KayH

    Joined:
    Jan 6, 2017
    Posts:
    107
    I'm using Unity 2021.3.21f1, Recorder version is 3.0.3.

    I have a script that is supposed to automatically start a recording with RecorderWindow.StartRecording. But I get some errors:

    When I start a recording by pressing the according button in the editor tab, it works as expected. So the issue only occurs when trying to start the recording programmatically.

    I get the RecorderWindow in the Start function and store it in a variable rw. Then in Update, after preparations have been triggered with a button press I check for a ready state; once reached, I call rw.StartRecording(). This is when the error occurs.
     
  2. rooose

    rooose

    Unity Technologies

    Joined:
    Jun 8, 2022
    Posts:
    30
    Hi KayH,

    Would you mind sharing your RecorderWindow settings and the script you are using to start the recording? I am having some trouble reproducing the issue.
     
  3. KayH

    KayH

    Joined:
    Jan 6, 2017
    Posts:
    107
    Thanks for taking the time to try to reproduce the problem. Turns out I was starting the recording repeatedly because of a missing check for a bool.
     
    rooose likes this.