Kann Spotify angehalten werden, wenn ein Skype-Anruf getätigt wird, ähnlich wie es iTunes macht?

Wenn ich Musik auf iTunes höre, wird die Musik automatisch angehalten, wenn ein Skype-Anruf getätigt wird. Ich wechsle kürzlich zu Spotify für meine Musikressource. Kann ich mit Spotify die gleiche Pausenfunktion wie mit iTunes haben?

Welche Recherchen haben Sie bisher durchgeführt?

Antworten (2)

Es gibt mehrere Möglichkeiten, dies zu erreichen. Hier sind zwei mögliche Lösungen:

Wenn Sie Mac OS (OS X) verwenden, versuchen Sie dieses AppleScript, das ich schnell zusammengeschlagen habe (bitte beachten Sie, dass ich nicht wirklich ein OS X-Entwickler bin und mein Wissen über AppleScript, gelinde gesagt, „mittelmäßig“ ist).

https://github.com/jhuseinovic/skype-spotify-ctrl

(*
This script was developed by John Huseinovic (john@huseinovic.net)
The purpose of the script is to pause any playing track in Spotify when there is a active/incoming call in skype and resume playing after the call is finished.
The script will only monitor if the both Skype and Spotify are running!
*)
set spotify_status to null
set notificationTitle to "Skype-Spotify Controller"
set call_started to false
set music_was_playing to false
repeat
    if application "Skype" is running and application "Spotify" is running then
        tell application "Skype"
            set calls to «event sendskap» given «class cmnd»:"SEARCH ACTIVECALLS", «class scrp»:"AnsweringScript"
            set callID to last word of calls
            if callID is not "CALLS" then

                using terms from application "Spotify"
                    set spotify_status to the player state of application "Spotify" as string
                end using terms from

                set status to «event sendskap» given «class cmnd»:"GET CALL " & callID & " STATUS", «class scrp»:"AnsweringScript"
                set caller to «event sendskap» given «class cmnd»:"GET CALL " & callID & " PARTNER_HANDLE", «class scrp»:"AnsweringScript"
                set call_started to true
                #log "set call_started to " & call_started
                if spotify_status = "playing" then
                    set music_was_playing to true
                    display notification "Active call with " & last word of caller & "! Spotify was " & spotify_status & ", going to pause it." with title notificationTitle
                    tell application "Spotify" to pause
                end if
            else
                #log "call_started is " & call_started
                if call_started is true and music_was_playing is true then
                    display notification "Detected terminated Skype call, resuming Spotify! Enjoy =)" with title notificationTitle
                    tell application "Spotify" to play
                end if
                set call_started to false
            end if
        end tell
        delay 1
    else
        delay 10
    end if

end repeat