Hallo Zusammen!
Frage: Gibt es eine Funktion die eine laufende Musik langsam lauter ( ab EIN) und beim Abschalten langsam leiser (bis AUS) machen kann? Zeitraum einstellbar wäre cool.
Hintergrund: Ich möchte sobald jemand das WC betritt Musik spielen lassen. Es sollte aber nicht so abrupt ein und ausgeschalten werden.
RamptoVolume geht ja angeblich nur ein paar Sekunden…
Habe das von Burkhart gefunden:
[IMG]https://www.symcon.de/forum/images/misc/quote_icon.png[/IMG] Zitat von [b]PHPSonos Doku[/b]
[b]RampToVolume($ramp_type, $volume)
[/b]
Function Parameters:
string $ramp_type: Ramps Volume to $volume using the Method mentioned in $ramp_type as string:
"SLEEP_TIMER_RAMP_TYPE" - mutes and ups Volume per default within 17 seconds to desired Volume
"ALARM_RAMP_TYPE" - Switches audio off and slowly goes to volume
"AUTOPLAY_RAMP_TYPE" - very fast and smooth; Implemented from Sonos for the autoplay feature.
string $volume: DesiredVolume
Das haut irgendwie nicht hin:
Korrigiere mich! Es geht doch, aber es dauert nur gefühlte 5 Sekunden und sicher nicht 17 Sekunden.
$name = "Gästebad";
SNS_SetGroup(25480, 0);
SNS_SetPlaymode(25480, 4);
SNS_SetPlaylist(25480, $name);
SNS_RampToVolume(25480, 1, 20);
SNS_Play(25480);
Das Problem ist das „Fade Out“.
SNS_RampToVolume(25480, 2, 0);
Danke für eure Hilfe!
lg Chris