Skip to content

Commit

Permalink
Merge branch 'develop' of github.com-myrobotlab:MyRobotLab/myrobotlab…
Browse files Browse the repository at this point in the history
… into inmoov2-heart
  • Loading branch information
supertick committed Apr 1, 2024
2 parents ac4edd4 + 1a879a5 commit 11e9cfc
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 5 deletions.
10 changes: 8 additions & 2 deletions src/main/java/org/myrobotlab/audio/AudioProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,17 @@ public AudioData play(AudioData data) {
}

final double value = peak * (double) audioFile.getPeakMultiplier();


// skew publish forwards in time
if (audioFile.getConfig().peakDelayMs == null) {
audioFile.invoke("publishPeak", value);
} else {
delayScheduler.schedule(() -> audioFile.invoke("publishPeak", value), audioFile.getConfig().peakDelayMs, TimeUnit.MILLISECONDS);
delayScheduler.schedule(() -> audioFile.invoke("publishPeak", value), audioFile.getConfig().peakDelayMs, TimeUnit.MILLISECONDS);
}

// reset to 0 after millis
if (audioFile.getConfig().publishPeakResetDelayMs != null) {
delayScheduler.schedule(() -> audioFile.invoke("publishPeak", 0), audioFile.getConfig().peakDelayMs + audioFile.getConfig().publishPeakResetDelayMs, TimeUnit.MILLISECONDS);
}
}
}
Expand Down
11 changes: 8 additions & 3 deletions src/main/java/org/myrobotlab/service/config/AudioFileConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,20 @@ public class AudioFileConfig extends ServiceConfig {
/**
* a multiplier to scale amplitude of output waveform
*/
public double peakMultiplier = 100.0;
public double peakMultiplier = 300.0;

/**
* sample interval for peak
*/
public double peakSampleInterval = 15;
public double peakSampleInterval = 2.0;

/**
* delay to synchronize publishing of peak with actual sound in milliseconds
*/
public Long peakDelayMs = null;
public Long peakDelayMs = 10L;

/**
* resets the peak to 0 after this many milliseconds
*/
public Long publishPeakResetDelayMs = 100L;
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,22 @@
<td>volume</td>
<td>{{service.volume.toFixed(2) * 100}}</td>
</tr>
<tr>
<td>peak volume multiplier</td>
<td>{{service.config.peakMultiplier }}</td>
</tr>
<tr>
<td>peak volume sample interval</td>
<td>{{service.config.peakSampleInterval }}</td>
</tr>
<tr>
<td>peak volume delay</td>
<td>{{service.config.peakDelayMs }}</td>
</tr>
<tr>
<td>peak reset delay</td>
<td>{{service.config.publishPeakResetDelayMs }}</td>
</tr>
</table>
<br/>
<!--Selected playlist: {{service.currentPlaylist}}<br/>-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ <h4>Location</h4>
<tr>
<td colspan="2">{{getBotPath()}}</td>
</tr>
<tr><td><h4>Use Language Model Fallback</h4></td><td>
<button class="btn btn-default" ng-show="predicates['gpt3'] != 'enabled'"
ng-click="msg.setPredicate('gpt3', 'enabled');msg.getPredicates()">off</button>
<button class="btn btn-info" ng-show="predicates['gpt3'] == 'enabled'"
ng-click="msg.setPredicate('gpt3', '');msg.getPredicates()">on</button>
<span ng-show="peer.isPeerStarted(service, 'gpt3')">
<img src="settings.png" width="30" title="Open" ng-click="mrl.changeTab(peer.getActualName(service, 'gpt3'))"/>
</span>
</td></tr>
<tr>
<td colspan="2">
<h4>Manifest</h4>
Expand Down Expand Up @@ -109,7 +118,13 @@ <h4>Properties</h4>
<img src="../service/img/hide_info.png">
</a>
</div>




</div>


<!-- good for debugging
<div class="chatBalloonBotLast">
<div class="chatContent">{{lastResponse}}
Expand All @@ -125,6 +140,7 @@ <h4>Properties</h4>
</div>
</div>
</div>
-->
<!-- tableBottom -->
<div class="BottomContent">
Expand Down

0 comments on commit 11e9cfc

Please sign in to comment.