Dynamische Sprachausgabe mit Airplay wiedergeben

User stellen ihre Haussteuerung vor

Moderator: Co-Administratoren

Benutzeravatar
joni-blue
Beiträge: 1171
Registriert: 04.01.2012, 12:20
System: CCU
Wohnort: Hannover
Hat sich bedankt: 6 Mal
Danksagung erhalten: 1 Mal

Re: Dynamische Sprachausgabe mit Airplay wiedergeben

Beitrag von joni-blue » 09.04.2014, 18:17

joni-blue hat geschrieben:
unlight hat geschrieben:Bin im Moment im Urlaub. Danach gerne!

Gesendet von meinem HUAWEI Y300-0100 mit Tapatalk
Danke


Sent from my iPad using Tapatalk
bist du schon zurück?
Reboot tut gut ! ! !

Xanon
Beiträge: 196
Registriert: 26.04.2014, 07:24

Re: Dynamische Sprachausgabe mit Airplay wiedergeben

Beitrag von Xanon » 26.04.2014, 07:54

joni-blue hat geschrieben:
joni-blue hat geschrieben:
unlight hat geschrieben:Bin im Moment im Urlaub. Danach gerne!

Gesendet von meinem HUAWEI Y300-0100 mit Tapatalk
Danke


Sent from my iPad using Tapatalk
bist du schon zurück?

Würde mich auch interessieren, ob du wieder zurück bist :lol:
Ich finde, dies ist ein extrem spannendes Thema.

Gruß
Marcus

Benutzeravatar
unlight
Beiträge: 484
Registriert: 23.12.2012, 13:03
Wohnort: Ruhrpott

Re: Dynamische Sprachausgabe mit Airplay wiedergeben

Beitrag von unlight » 26.04.2014, 08:09

Ja, bin zurück!
Hatte mit joni-blue per PN kommuniziert.
Mein aktuelles Script sieht so aus und kann spotify nach wie vor steuern:

Code: Alles auswählen

property tick : 2 -- raise volume level by this many each loop
property thismany : 0.1 -- seconds to wait before making next increment to volume
global returner
on appIsRunning(appname)
	tell application "System Events" to (name of processes) contains appname
end appIsRunning
tell application "Safari" to open location "http://www.wetter.net/319/Duisburg"
delay 15
set theSource to ""
tell application "Safari" to set theSource to the text of document 1
set AppleScript's text item delimiters to {"Wettervorhersage für heute"}
set theText to text item 2 of theSource
set AppleScript's text item delimiters to {"Wetterbericht der nächsten Tage"}
set myText to text item 1 of theText
set AppleScript's text item delimiters to {""}

tell application "Safari" to quit
if appIsRunning("Airfoil") then
	
	tell application "/Applications/Airfoil.app"
		set returner to (get name of current audio source)
		if (get name of current audio source) is "iTunes" then
			tell application "iTunes"
				if (get sound volume) is less than 50 then
					repeat
						if (get sound volume) is greater than 50 - 5 then
							set sound volume to 50
							exit repeat
						end if
						set sound volume to (sound volume + tick)
						delay thismany
					end repeat
				else if (get sound volume) is greater than 50 then
					repeat
						if (get sound volume) is less than 50 + 5 then
							set sound volume to 50
							exit repeat
						end if
						set sound volume to (sound volume - tick)
						delay thismany
					end repeat
				end if
			end tell
			set volume output volume 45
		else if (get name of current audio source) is "Spotify" then
			tell application "Spotify"
				if (get sound volume) is less than 50 then
					repeat
						if (get sound volume) is greater than 50 - 5 then
							set sound volume to 50
							exit repeat
						end if
						set sound volume to (sound volume + tick)
						delay thismany
					end repeat
				else if (get sound volume) is greater than 50 then
					repeat
						if (get sound volume) is less than 50 + 5 then
							set sound volume to 50
							exit repeat
						end if
						set sound volume to (sound volume - tick)
						delay thismany
					end repeat
				end if
			end tell
		end if
		set volume output volume 45
		set aSource to first system source
		set current audio source to aSource
	end tell
	
	say myText
	
	tell application "/Applications/Airfoil.app"
		if returner is "iTunes" then
			tell application "iTunes"
				if (get sound volume) is less than 100 then
					repeat
						if (get sound volume) is greater than vol - 5 then
							set sound volume to 100
							exit repeat
						end if
						set sound volume to (sound volume + tick)
						delay thismany
					end repeat
				else if (get sound volume) is greater than 100 then
					repeat
						if (get sound volume) is less than 100 + 5 then
							set sound volume to 100
							exit repeat
						end if
						set sound volume to (sound volume - tick)
						delay thismany
					end repeat
				end if
			end tell
			set aSource to make new application source
			set application file of aSource to "/Applications/iTunes.app"
			set current audio source to aSource
			
		else if returner is "Spotify" then
			tell application "Spotify"
				if (get sound volume) is less than vol then
					repeat
						if (get sound volume) is greater than 100 - 5 then
							set sound volume to 100
							exit repeat
						end if
						set sound volume to (sound volume + tick)
						delay thismany
					end repeat
				else if (get sound volume) is greater than 100 then
					repeat
						if (get sound volume) is less than 100 + 5 then
							set sound volume to 100
							exit repeat
						end if
						set sound volume to (sound volume - tick)
						delay thismany
					end repeat
				end if
			end tell
			set aSource to make new application source
			set application file of aSource to "/Applications/Spotify.app"
			set current audio source to aSource
		end if
	end tell
	set volume output volume 30
end if
“Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.”

Benutzeravatar
joni-blue
Beiträge: 1171
Registriert: 04.01.2012, 12:20
System: CCU
Wohnort: Hannover
Hat sich bedankt: 6 Mal
Danksagung erhalten: 1 Mal

Re: Dynamische Sprachausgabe mit Airplay wiedergeben

Beitrag von joni-blue » 26.04.2014, 09:57

Spotify lässt sich nicht mehr Steuern[UNAMUSED FACE]


Sent from my iPhone using Tapatalk
Reboot tut gut ! ! !

Benutzeravatar
unlight
Beiträge: 484
Registriert: 23.12.2012, 13:03
Wohnort: Ruhrpott

Re: Dynamische Sprachausgabe mit Airplay wiedergeben

Beitrag von unlight » 26.04.2014, 10:36

joni-blue hat geschrieben:Spotify lässt sich nicht mehr Steuern[UNAMUSED FACE]
Gerade aufgenommen mit dem aktuellen Spotify und aktuellem Mountain Lion!

http://youtu.be/tN5Vcsp4SGg

Also bei mir klappts nach wie vor!

Gruß
Unlight
“Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.”

Benutzeravatar
joni-blue
Beiträge: 1171
Registriert: 04.01.2012, 12:20
System: CCU
Wohnort: Hannover
Hat sich bedankt: 6 Mal
Danksagung erhalten: 1 Mal

Re: Dynamische Sprachausgabe mit Airplay wiedergeben

Beitrag von joni-blue » 26.04.2014, 11:59

Mit OS X 10.9.2 klappt es nicht


Sent from my iPhone using Tapatalk
Reboot tut gut ! ! !

Benutzeravatar
unlight
Beiträge: 484
Registriert: 23.12.2012, 13:03
Wohnort: Ruhrpott

Re: Dynamische Sprachausgabe mit Airplay wiedergeben

Beitrag von unlight » 26.04.2014, 13:24

Das Video ist mit 10.9.2 gemacht!
Du hast die normale Spotify App installiert?
Habs mit Free, Unlimited und Premium probiert, geht alles!

Kopier das mal in ein Scriptfenster und starte es:

Code: Alles auswählen

property tick : 2 -- raise volume level by this many each loop
property thismany : 0.1 -- seconds to wait before making next increment to volume

tell application "Spotify"
	repeat
		if (get sound volume) is less than 5 then
			set sound volume to 0
			exit repeat
		end if
		set sound volume to (sound volume - tick)
		delay thismany
	end repeat
end tell
Das sollte die Lautstärke bis auf 0 faden.

Gruß
Unlight
“Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.”

Benutzeravatar
joni-blue
Beiträge: 1171
Registriert: 04.01.2012, 12:20
System: CCU
Wohnort: Hannover
Hat sich bedankt: 6 Mal
Danksagung erhalten: 1 Mal

Re: Dynamische Sprachausgabe mit Airplay wiedergeben

Beitrag von joni-blue » 26.04.2014, 16:31

Was mache ich dann Falsch? die Meldung kommt bei allen alten und deinem script!!!!
Bildschirmausschnitt.png
unlight hat geschrieben:Das Video ist mit 10.9.2 gemacht!
Du hast die normale Spotify App installiert?
Habs mit Free, Unlimited und Premium probiert, geht alles!

Kopier das mal in ein Scriptfenster und starte es:

Code: Alles auswählen

property tick : 2 -- raise volume level by this many each loop
property thismany : 0.1 -- seconds to wait before making next increment to volume

tell application "Spotify"
	repeat
		if (get sound volume) is less than 5 then
			set sound volume to 0
			exit repeat
		end if
		set sound volume to (sound volume - tick)
		delay thismany
	end repeat
end tell
Das sollte die Lautstärke bis auf 0 faden.

Gruß
Unlight
Reboot tut gut ! ! !

Benutzeravatar
unlight
Beiträge: 484
Registriert: 23.12.2012, 13:03
Wohnort: Ruhrpott

Re: Dynamische Sprachausgabe mit Airplay wiedergeben

Beitrag von unlight » 26.04.2014, 17:43

Die Farben in deinem script deuten darauf hin dass Sound und volume nicht als steuerelemente sondern als variablen interpretiert werden. Das passiert eigentlich nur wenn die anzusteuernde app nicht gefunden wird. Hast du spotify evtl nicht im Programmeordner?

Gesendet von meinem HUAWEI Y300-0100 mit Tapatalk
“Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.”

Benutzeravatar
joni-blue
Beiträge: 1171
Registriert: 04.01.2012, 12:20
System: CCU
Wohnort: Hannover
Hat sich bedankt: 6 Mal
Danksagung erhalten: 1 Mal

Re: Dynamische Sprachausgabe mit Airplay wiedergeben

Beitrag von joni-blue » 26.04.2014, 17:45

doch liegt im Programm ordnet
Reboot tut gut ! ! !

Antworten

Zurück zu „Projektvorstellungen“