Sony's Developer World forum

    • Home
    • Forum guidelines

    Upcoming maintenance 

     

    Dear Customers and Partners.

    This website will be undergoing scheduled maintenance on June 14, 2023. Please be aware there may be disruption to the developer portal website and associated services during the scheduled maintenance period.

    This upgrade is essential to ensure the continued performance, reliability, and security of Developer World.

    We apologize for any inconvenience.

     

     

    setAudioVolume "-N" not working on STR-DN860

    Audio Control API
    3
    6
    6045
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    This topic has been deleted. Only users with topic management privileges can see it.
    • root
      root last edited by root

      I own a STR-DN860 (latest firmware - M29.R.0476 ) and I'm able to control the receiver's volume using setAudioVolume.
      However decreasing by 1 isn't working.
      I can set the "volume" parameter to any number and the volume changes to that number. Or I can set it to "+1" and it increases by 1.
      However sending "-1" also increases the volume.

      Does it work correctly for anybody?

      1 Reply Last reply Reply Quote
      • D
        david DeveloperWorld last edited by

        We had what same result in earlier versions of the firmware for STR-DN1080 also, but I believe that is fixed for that receiver (don't have the possibility to test right now). Looks like the firmware for STR-DN860 is not updated since then (I don't know if the firmware will be updated for STR-DN860).

        G 1 Reply Last reply Reply Quote
        • G
          grolschie last edited by grolschie

          (edited) I specify an N value for the volume. Sure it means keeping track of the current volume, or you can (probably should) query that first. Not so handy if you are just wanting a simple script though.

          root 1 Reply Last reply Reply Quote
          • G
            grolschie @david last edited by

            @david It would be really great if Sony rolled out API updates to older models to tidy things up. Even if there are no other fixes, just the API updates.

            1 Reply Last reply Reply Quote
            • root
              root @grolschie last edited by root

              @grolschie Yes, that's what I'm currently doing.
              Here's my AutoHotKey 2 script, perhaps someone finds it useful.
              It increases/decreases volume when middle mouse button is pressed together with volume up/down.

              ~Volume_Down & MButton::
              ~MButton & Volume_Down::
              {
              req := ComObject("WinHttp.WinHttpRequest.5.1")
              req.Open("POST", "http://192.168.0.110:10000/sony/audio")
              jsonbody := '{"method":"getVolumeInformation", "id":33, "params":[{}], "version":"1.1"}'
              req.Send(jsonbody)
              req.WaitForResponse()
              currVol := Integer(RTrim(SubStr(req.responseText, 94, 2),"}"))
              currVol--
              
              whr := ComObject("WinHttp.WinHttpRequest.5.1")
              whr.Open("POST", "http://192.168.0.110:10000/sony/audio")
              whr.SetRequestHeader("Content-Type", "application/json")
              voldown := '{ "method":"setAudioVolume", "id":98, "params":[{ "volume": "' . currVol . '"}], "version":"1.1" }'
              whr.Send(voldown)
              
              }
              
              ~Volume_Up & MButton::
              ~MButton & Volume_Up::
              {
              whr := ComObject("WinHttp.WinHttpRequest.5.1")
              whr.Open("POST", "http://192.168.0.110:10000/sony/audio")
              whr.SetRequestHeader("Content-Type", "application/json")
              jsonbody := '{ "method":"setAudioVolume", "id":98, "params":[ {"volume":"+1"}], "version":"1.1" }'
              whr.Send(jsonbody)
              }
              
              G 1 Reply Last reply Reply Quote
              • G
                grolschie @root last edited by

                @root Very cool. Thanks for sharing the script.

                1 Reply Last reply Reply Quote
                • Referenced by  S Svenkka 1 
                • First post
                  Last post
                Developer World
                Copyright © 2021 Sony Group Corporation. All rights reserved.
                • Contact us
                • Legal