Added limiter to peak meter

This commit is contained in:
Pax1601 2024-10-09 18:41:40 +02:00
parent b282e5d676
commit 12b9337026
2 changed files with 6 additions and 4 deletions

View File

@ -15,7 +15,7 @@ export function AudioSourcePanel(props: { source: AudioSource }) {
useEffect(() => {
setInterval(() => {
setMeterLevel(props.source.getMeter().getPeaks().current[0]);
setMeterLevel(Math.min(100, props.source.getMeter().getPeaks().current[0]));
}, 50);
}, []);
@ -92,14 +92,16 @@ export function AudioSourcePanel(props: { source: AudioSource }) {
</div>
<OlRangeSlider
value={props.source.getVolume() * 100}
min={0}
max={200}
onChange={(ev) => {
props.source.setVolume(parseFloat(ev.currentTarget.value) / 100);
}}
className="absolute top-[18px]"
/>
</div>
<div className="h-[40px] min-w-[40px] p-2">
<span>{Math.round(props.source.getVolume() * 100)}</span>
<div className="h-[40px] min-w-[60px] p-2 text-md">
<span>{Math.round(props.source.getVolume() * 100)}%</span>
</div>
</div>
</div>

View File

@ -9,7 +9,7 @@
"redCommanderPassword": "302bcbaf2a3fdcf175b689bf102d6cdf9328f68a13d4096101bba806482bfed9"
},
"frontend": {
"port": 3001,
"port": 3000,
"elevationProvider": {
"provider": "https://srtm.fasma.org/{lat}{lng}.SRTMGL3S.hgt.zip",
"username": null,