REW Beta Release REW API tips & tricks

serko70

Member
Thread Starter
Joined
Oct 13, 2017
Messages
239
Location
Germany
More  
Preamp, Processor or Receiver
Marantz SR6015
Main Amp
Rotel Michi X3
Computer Audio
Intel NUC
DAC
Oppo 205
Universal / Blu-ray / CD Player
Oppo 205
Front Speakers
Focal Kanta 2
Center Channel Speaker
Linn
Surround Speakers
Focal Dome Flax
Surround Back Speakers
Focal Dome Flax
Front Height Speakers
Focal Dome Flax
Rear Height Speakers
Focal Dome Flax
Subwoofers
Focal Air
Video Display Device
LG 65 3D OLED
Streaming Subscriptions
TIDAL, ROON
Let's explore the new REW Beta API in this thread.

Please feel free to brainstorm more methods and discuss tips & tricks for unlocking the API's full potential!

Here are two very simple HTML scripts (runs in any web browser hence platform free - also happens to be my current capability).

Retrieve REW Beta version information and display on browser window:

<<!DOCTYPE html>
<html>
<body>
<p>REW Version: <span id="version"></span></p>
<script>
fetch('http://localhost:4735/version')
.then(response => response.json())
.then(data => document.getElementById("version").innerText = data.message);
</script>
</body>
</html>


Generate a standard minimum phase version of a REW measurement (first one in this example) which will include mic calibration file effects:

<!DOCTYPE html>
<html>
<body>
<script>
const apiUrl = 'http://localhost:4735/measurements/1/command'; //first measurement
const defaultParameters = {
command: 'Minimum phase version',
parameters: {
"include cal": "true",
"append lf tail": "false",
"append hf tail": "false",
"frequency warping": "false",
"replicate data": "false"
}
};
const response = fetch(apiUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(defaultParameters)
});
</script>
</body>
</html>



Copy paste the above to any text editor, save as "filename.html" and it will run in your default browser. REW API server should have been started (preferences/API) and running on port 4735.
 
Top Bottom