Kodi Community Forum

Full Version: Help with json script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Not sure where to post this.

I am looking for a sample of json command that would retrieve what sound track is currently being played from a movie file. I.E. 2 channel or 5.1 channel.

I found a command that retrieves the stream details, but that just gives me a list of all the audio tracks. I would like one that gives me which one is playing.

Thanks
Mike
It would be better in add-on development - I'll move it there.
i think you can use the Player.GetProperties method to retrieve the currentaudiostream (Player.Audio.Stream.Extended) value.
Sorry should have stated that the program I am using to retrieve data can only send simple one line request like the sample below,

jsonrpc?request={"jsonrpc": "2.0", "method": "Player.GetItem", "params": { "properties": ["streamdetails"], "playerid": 1 }, "id": "VideoGetItem"}

I looked at the Player.Audio.Stream.Extended section but what would the command struct look like?
i assume it would be something like:
jsonrpc?request={"jsonrpc": "2.0", "method": "Player.GetProperties", "params": { "properties": ["currentaudiostream"], "playerid": 1 }, "id": "VideoGetItem"}
thanks, that worked