Class Audio
- java.lang.Object
-
- org.openhab.core.model.script.actions.Audio
-
@NonNullByDefault public class Audio extends Object
The static methods of this class are made available as functions in the scripts. This allows a script to use audio features.- Author:
- Kai Kreuzer - Initial contribution, Christoph Weitkamp - Added parameter to adjust the volume
-
-
Constructor Summary
Constructors Constructor Description Audio()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
decreaseMasterVolume(float percent)
static float
getMasterVolume()
static void
increaseMasterVolume(float percent)
static void
playSound(String filename)
static void
playSound(String sink, String filename)
static void
playSound(String sink, String filename, PercentType volume)
static void
playSound(String filename, PercentType volume)
static void
playStream(String url)
static void
playStream(String sink, String url)
static void
setMasterVolume(float volume)
static void
setMasterVolume(PercentType percent)
-
-
-
Method Detail
-
playSound
public static void playSound(String filename)
-
playSound
public static void playSound(String filename, PercentType volume)
-
playSound
public static void playSound(String sink, String filename, PercentType volume)
-
playStream
public static void playStream(String url)
-
getMasterVolume
public static float getMasterVolume() throws IOException
- Throws:
IOException
-
setMasterVolume
public static void setMasterVolume(float volume) throws IOException
- Throws:
IOException
-
setMasterVolume
public static void setMasterVolume(PercentType percent) throws IOException
- Throws:
IOException
-
increaseMasterVolume
public static void increaseMasterVolume(float percent) throws IOException
- Throws:
IOException
-
decreaseMasterVolume
public static void decreaseMasterVolume(float percent) throws IOException
- Throws:
IOException
-
-