T-022: Geschwindigkeit 0,5–3,0× (audio-pitch-correction, Scaletempo) im Player-Select

This commit is contained in:
2026-11-06 20:32:38 +01:00
parent f7943e2b14
commit 0dcc23cb62
4 changed files with 22 additions and 0 deletions

View File

@ -156,6 +156,7 @@ impl MpvPlayer {
"--no-resume-playback",
"--keep-open=no",
"--loop=no",
"--audio-pitch-correction=yes",
])
.stdin(Stdio::null())
.stdout(Stdio::null())

View File

@ -11,6 +11,7 @@
playerSetChapter,
playerStop,
playerSnapshot,
playerSetSpeed,
onPlayerState,
fmtClock,
assetUri,
@ -530,6 +531,15 @@
<button class="ghost" title="Kapitel vor" onclick={() => playerSetChapter(player.chapter + 1)}><Icon name="nextch" /></button>
</div>
<span class="mtime muted small">{fmtClock(player.position)} / {fmtClock(player.duration)}</span>
<select
class="speedsel"
title="Wiedergabegeschwindigkeit (Tonhöhe bleibt)"
onchange={(e) => playerSetSpeed(Number(e.currentTarget.value))}
>
{#each [0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.5, 3.0] as sp}
<option value={sp} selected={Math.abs(player.speed - sp) < 0.01}>{sp}×</option>
{/each}
</select>
<input
class="seek"
type="range"

View File

@ -379,3 +379,12 @@ code {
min-width: 6rem;
accent-color: var(--accent);
}
.playerbar .speedsel {
border: 1px solid var(--border);
border-radius: 6px;
background: var(--bg);
color: var(--fg);
font-size: 0.85rem;
padding: 0.25rem 0.4rem;
}

View File

@ -60,6 +60,8 @@ export const playerSetPosition = (pos: number) =>
invoke<PlayerState>('player_set_position', { pos })
export const playerSetChapter = (idx: number) =>
invoke<PlayerState>('player_set_chapter', { idx })
export const playerSetSpeed = (speed: number) =>
invoke<PlayerState>('player_set_speed', { speed })
export const playerStop = () => invoke<PlayerState>('player_stop')
export const playerSnapshot = () => invoke<PlayerState>('player_snapshot')
export const onPlayerState = (cb: (s: PlayerState) => void) =>