dennis / slipstream

ISC License
5 stars 0 forks source link

Audio select device #42

Closed dennis closed 3 years ago

dennis commented 3 years ago

Solves https://github.com/dennis/slipstream/issues/34

Example

Change init-0.4.0

register_plugin("AudioPlugin:Default", "AudioPlugin")
register_plugin("AudioPlugin:Other", "AudioPlugin")

scripts/audio.lua

audio:send_devices("AudioPlugin:Default") -- you will receive AudioOutputDevice events here
audio:set_output("AudioPlugin:Other", 2) -- "2" is a device reported by the above command
audio:say("AudioPlugin:Other", "Hello", 0.3)
audio:play("AudioPlugin:Default", "aww-sound-effect.mp3", 0.3)

Note: This breaks all say and play, as there now is a 3rd argument, that decides which plugin to use

dennis commented 3 years ago

uh. Forgot to update CHANGELOG.md