Skip to content

[BUG] GetInputAudioTracks() always returns false for all properties #142

@testphpproject01

Description

@testphpproject01

Issue Type

  • Bug

Describe the bug
GetInputAudioTracks() always returns false for all properties

To Reproduce
Steps to reproduce the behavior:

  1. To configure Input Audio Tracks into OBS. (Example: 1 track is active and other is inactive)
  2. in the program, call
    var tracks = obs.GetInputAudioTracks(inputName);
    var o = JObject.FromObject(tracks);
    Console.WriteLine(o);
  3. See error, all property is false
    {
    "track1": false,
    "track2": false,
    "track3": false,
    "track4": false,
    "track5": false,
    "track6": false
    }

Expected behavior
Return to the real state of the settings Input Audio Tracks. For our example
{
"track1": true,
"track2": false,
"track3": false,
"track4": false,
"track5": false,
"track6": false
}

Screenshots
If applicable, add screenshots to help explain your problem.

Versions
OBS Version: 30.2.2 (64-bit)
OBS WebSocket Version:
OBS WebSocket Dotnet (this library) Version: 5.0.0.3
OS: Windows 11

Additional context
The library is waiting for a response from OBS as:
{
"track1": true,
"track2": false,
"track3": false,
"track4": false,
"track5": false,
"track6": false
}
See in source obs-websocket-dotnet-5.0.0.3\obs-websocket-dotnet\Types\SourceTracks.cs

But realy response from OBS is:
{
"inputAudioTracks": {
"1": true,
"2": false,
"3": false,
"4": false,
"5": false,
"6": false
}
}
It needs to be fixed deserialize SourceTracks.
[JsonProperty(PropertyName = "track1")]
need as
[JsonProperty(PropertyName = "1")]

And
public SourceTracks(JObject data)
{
JsonConvert.PopulateObject(data.ToString(), this);
}
need as
public SourceTracks(JObject data)
{
JsonConvert.PopulateObject(data["inputAudioTracks"].ToString(), this);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions