You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: addons/actions.md
+4-13Lines changed: 4 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -35,19 +35,10 @@ As a general rule, is better to call `MyItem.sendCommand(command)` and `MyItem.p
35
35
-`Map<Item, State> storeStates(Item item1, Item item2, ... Item itemn)`: Returns a `Map<Item, State>` with the current state of each Item. All members of Groups are put into the Map but not the Group's state itself.
36
36
-`restoreStates(Map<Item, State> statesMap)`: Restores the items' states from the map. If the saved state can be interpreted as a command (ON/OFF/etc.), a command is sent to the Item. Otherwise an update is sent to the Item.
37
37
38
-
### Audio Actions
39
-
40
-
-`setMasterVolume(float volume)`: Sets the volume of the host machine (volume in range 0-1)
41
-
-`increaseMasterVolume(float percent)`: Increases the volume by the given percent
42
-
-`decreaseMasterVolume(float percent)`: Decreases the volume by the given percent
43
-
-`float getMasterVolume()`: Returns the current volume as a float between 0 and 1
44
-
-`playSound(String filename)`: Plays the given sound file. The file must be an mp3 or wav and located in `${openhab.home}/sounds`
45
-
-`playStream(String url)`: Plays the audio stream at the given url
46
-
-`say(String text)`: Says the given text through Text-to-Speech
47
-
-`say(String text, String voice)`: Says the given text through the given voice (depends on the TTS engine and voices installed)
48
-
-` say(String text, String voice, String device)`: Says the given text through the given voice to the given output device (Mac OSX only).
49
-
50
-
To get a list of available voices use `say -v ?` and to get a list of devices uses `say -a ?`.
38
+
### Audio & Voice Actions
39
+
40
+
The framework supports several multimedia actions.
41
+
They can be found in the article about [openHAB multimedia]({{base}}/configuration/multimedia.html).
Copy file name to clipboardExpand all lines: configuration/multimedia.md
+26-5Lines changed: 26 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,18 @@ title: Multimedia
7
7
8
8
# Multimedia
9
9
10
+
## Volume
11
+
12
+
The framework supports some base [functions](https://www.eclipse.org/smarthome/documentation/javadoc/org/eclipse/smarthome/model/script/actions/Audio.html#getMasterVolume--) to control the audio sinks' volume.
13
+
14
+
### Actions
15
+
16
+
-`setMasterVolume(float volume)` : Sets the volume of the host machine (volume in range 0-1)
17
+
-`setMasterVolume(PercentType percent)` : Sets the volume of the host machine
18
+
-`increaseMasterVolume(float percent)` : Increases the volume by the given percent
19
+
-`decreaseMasterVolume(float percent)` : Decreases the volume by the given percent
20
+
-`float getMasterVolume()` : Returns the current volume as a float between 0 and 1
21
+
10
22
## Audio
11
23
12
24
openHAB is able to play sound either from the file system (files need to be put in the folder `conf/sounds`), from URLs (e.g. Internet radio streams) or generated by text-to-speech engines (which are available as optional [Voice add-ons](/addons/#voice)).
@@ -23,6 +35,8 @@ The distribution comes with these options built-in:
23
35
24
36
Additionally, certain bindings register their supported devices as audio sinks, e.g. Sonos speakers.
25
37
38
+
### Console commands
39
+
26
40
To check, which audio sinks are available, you can use the console:
27
41
28
42
```text
@@ -40,20 +54,25 @@ In order to play a sound, you can use the following command on the console:
40
54
openhab> smarthome:audio play doorbell.mp3
41
55
```
42
56
57
+
### Actions
58
+
43
59
Alternatively the [`playSound()` function](https://www.eclipse.org/smarthome/documentation/javadoc/org/eclipse/smarthome/model/script/actions/Audio.html#playSound-java.lang.String-) can be used in DSL rules:
In order to use text-to-speech, you need to install at least one [TTS service](/addons/#voice).
73
+
74
+
### Console Commands
75
+
57
76
Once you have done so, you will find voices available in your system:
58
77
59
78
```text
@@ -73,15 +92,17 @@ In order to say a text, you can enter such a command on the console (The default
73
92
openhab> smarthome:voice say Hello world!
74
93
```
75
94
95
+
### Actions
96
+
76
97
Alternatively you can execute such commands within DSL rules by using the [`say()` function](https://www.eclipse.org/smarthome/documentation/javadoc/org/eclipse/smarthome/core/voice/VoiceManager.html#say-java.lang.String-):
0 commit comments