Skip to content

Commit

Permalink
[multimedia] Add record and transcribe commands (#2295)
Browse files Browse the repository at this point in the history
* [multimedia] Add record and transcribe commands

Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>

* apply pr review

Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>

* fix md errors

Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>

---------

Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
Co-authored-by: stefan-hoehn <mail@stefanhoehn.com>
  • Loading branch information
GiviMAD and stefan-hoehn authored May 19, 2024
1 parent f5f8cc4 commit 9474dc3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
16 changes: 13 additions & 3 deletions configuration/multimedia.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The distribution comes with these options built-in:

| Output Device | Audio Source | Description |
|---------------|-------------------|-------------------------------------------------|
| `javasound` | System Microphone | This uses the Java Sound API for audio capture. |
| `javasound` | System Microphone | This uses the Java Sound API for audio capture. |

Additionally, certain bindings register their supported devices as audio sources, e.g. PulseAudio.

Expand All @@ -46,6 +46,14 @@ openhab> openhab:audio sources

You can define the default audio source either by textual configuration in `$OPENHAB_CONF/services/runtime.cfg` or in the UI in `Settings->Audio`.

You can also record wav audio files using the console, you should provide the desired record duration in seconds and its filename, if you do not specify the source the default will be used:

```text
openhab> openhab:audio record javasound 10 hello.wav
```

The generated record will be saved at the folder `$OPENHAB_CONF/sounds`.

## Audio Playback

openHAB is able to play sound either from the file system (files need to be put in the folder `$OPENHAB_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)).
Expand Down Expand Up @@ -342,15 +350,17 @@ openhab> openhab:voice startdialog --source javasound --sink sonos:PLAY5:kitchen
# list running dialogs
openhab> openhab:voice dialogs
# register a dialog (same as start but persisting the configuration to spawn dialog on restart or temporal service unavailability).
openhab> openhab:voice registerdialog --source javasound --sink sonos:PLAY5:kitchen --hlis system,rulehli --stt voicerss --tts voskstt --keyword terminator --ks rustpotterks
openhab> openhab:voice registerdialog --source javasound --sink sonos:PLAY5:kitchen --hlis system,rulehli --tts voicerss --stt voskstt --keyword terminator --ks rustpotterks
# list dialogs registrations
openhab> openhab:voice dialogregs
# stop a dialog
openhab> openhab:voice stopdialog --source javasound
# unregister a dialog, and stop if running
openhab> openhab:voice unregisterdialog --source javasound
# run single shot dialog
openhab> openhab:voice listenandanswer --source javasound --sink sonos:PLAY5:kitchen --hlis system,rulehli --stt voicerss --tts voskstt --keyword terminator --ks rustpotterks
openhab> openhab:voice listenandanswer --source javasound --sink sonos:PLAY5:kitchen --hlis system,rulehli --tts voicerss --stt voskstt --keyword terminator --ks rustpotterks
# run transcription and output to the console
openhab> openhab:voice transcribe --source javasound --stt voskstt
```

When an argument is not provided in the command line, the default from the voice settings is used.
Expand Down
2 changes: 1 addition & 1 deletion developers/bindings/thing-xml.md
Original file line number Diff line number Diff line change
Expand Up @@ -927,4 +927,4 @@ Modifying or removing update instructions after they have been merged is not per
Each new contribution of update instructions MUST increase the `thingTypeVersion`, even if there was no release.
The `thingTypeVersion` is bound to a thing-type, different thing types may have different versions.

The full XML schema for update instructions can be found here: [https://www.openhab.org/schemas/update-description-1.0.0.xsd](https://www.openhab.org/schemas/update-description-1.0.0.xsd).
The full XML schema for update instructions can be found here: [https://www.openhab.org/schemas/update-description-1.0.0.xsd](https://www.openhab.org/schemas/update-description-1.0.0.xsd).

0 comments on commit 9474dc3

Please sign in to comment.