Compare commits
No commits in common. "240b245154d23a9cf04b968d0862141c70015bf2" and "867efce90d3a829c2e4d1efaf7604887f2362cbd" have entirely different histories.
240b245154
...
867efce90d
26 changed files with 27 additions and 29 deletions
|
@ -27,7 +27,7 @@ trigger event="Raid" {
|
||||||
## For developers
|
## For developers
|
||||||
Extending audiencekit's automation abilities is made as simple as possible. For example, a plugin that automatically changes "simp" to "shrimp" in every message (as seen by those consuming this project's output) is simply:
|
Extending audiencekit's automation abilities is made as simple as possible. For example, a plugin that automatically changes "simp" to "shrimp" in every message (as seen by those consuming this project's output) is simply:
|
||||||
```python
|
```python
|
||||||
from ovtk_audiencekit.core import PluginBase
|
from ovtk_audiencekit.plugins import PluginBase
|
||||||
from ovtk_audiencekit.events import Message
|
from ovtk_audiencekit.events import Message
|
||||||
|
|
||||||
class Plugin(PluginBase):
|
class Plugin(PluginBase):
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
|
|
|
@ -17,12 +17,11 @@ import hypercorn
|
||||||
import hypercorn.asyncio
|
import hypercorn.asyncio
|
||||||
import hypercorn.logging
|
import hypercorn.logging
|
||||||
|
|
||||||
|
from ovtk_audiencekit.core import WebsocketServerProcess
|
||||||
from ovtk_audiencekit.core.Config import parse_kdl_deep, kdl_reserved, compute_dynamic
|
from ovtk_audiencekit.core.Config import parse_kdl_deep, kdl_reserved, compute_dynamic
|
||||||
from ovtk_audiencekit.core.Plugins import PluginError
|
|
||||||
from ovtk_audiencekit.core.WebsocketServerProcess import WebsocketServerProcess
|
|
||||||
from ovtk_audiencekit.events import Event, Delete
|
from ovtk_audiencekit.events import Event, Delete
|
||||||
from ovtk_audiencekit.chats.ChatProcess import ShutdownRequest
|
from ovtk_audiencekit.chats.ChatProcess import ShutdownRequest
|
||||||
from ovtk_audiencekit.plugins import builtins
|
from ovtk_audiencekit.plugins import builtins, PluginError
|
||||||
from ovtk_audiencekit.utils import format_exception
|
from ovtk_audiencekit.utils import format_exception
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
from .WebsocketServerProcess import WebsocketServerProcess
|
from .WebsocketServerProcess import WebsocketServerProcess
|
||||||
from .Plugins import PluginBase, PluginError
|
|
||||||
from .MainProcess import MainProcess
|
from .MainProcess import MainProcess
|
||||||
from .Audio import Clip, Stream
|
from .Audio import Clip, Stream
|
||||||
|
|
|
@ -7,4 +7,3 @@ from .Subscription import Subscription
|
||||||
from .Follow import Follow
|
from .Follow import Follow
|
||||||
|
|
||||||
__all__ = ['Event', 'Message', 'SysMessage', 'Delete', 'Control', 'Subscription', 'Follow']
|
__all__ = ['Event', 'Message', 'SysMessage', 'Delete', 'Control', 'Subscription', 'Follow']
|
||||||
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
|
|
||||||
|
|
|
@ -3,13 +3,11 @@ from collections import deque
|
||||||
|
|
||||||
import maya
|
import maya
|
||||||
|
|
||||||
from ovtk_audiencekit.core import PluginBase
|
from ovtk_audiencekit.plugins import PluginBase
|
||||||
from ovtk_audiencekit.core import Clip, Stream
|
from ovtk_audiencekit.core import Clip, Stream
|
||||||
|
|
||||||
class AudioAlert(PluginBase):
|
class AudioAlert(PluginBase):
|
||||||
def setup(self, output=None, timeout_min=1, sample_rate=None, buffer_length=4096, force_stereo=True):
|
def setup(self, output=None, timeout_min=1, sample_rate=None, buffer_length=4096, force_stereo=True):
|
||||||
self._cleanup_task = asyncio.create_task(self._cleanup())
|
|
||||||
|
|
||||||
self.force_stereo = force_stereo
|
self.force_stereo = force_stereo
|
||||||
self.timeout_min = timeout_min
|
self.timeout_min = timeout_min
|
||||||
self.clips = {}
|
self.clips = {}
|
||||||
|
@ -23,6 +21,8 @@ class AudioAlert(PluginBase):
|
||||||
except StopIteration:
|
except StopIteration:
|
||||||
self.logger.warn('Target audio device does not claim to support common sample rates! Attempting playback at native rate of audio')
|
self.logger.warn('Target audio device does not claim to support common sample rates! Attempting playback at native rate of audio')
|
||||||
|
|
||||||
|
self._cleanup_task = asyncio.create_task(self._cleanup())
|
||||||
|
|
||||||
def run(self, path, speed=1, keep_pitch=False, immediate=True, poly=1, **kwargs):
|
def run(self, path, speed=1, keep_pitch=False, immediate=True, poly=1, **kwargs):
|
||||||
poly = int(poly)
|
poly = int(poly)
|
||||||
key = f'{path}@{speed}{"X" if keep_pitch else "x"}'
|
key = f'{path}@{speed}{"X" if keep_pitch else "x"}'
|
||||||
|
|
|
@ -7,7 +7,7 @@ import maya
|
||||||
from requests.exceptions import HTTPError
|
from requests.exceptions import HTTPError
|
||||||
from owoify.owoify import owoify, Owoness
|
from owoify.owoify import owoify, Owoness
|
||||||
|
|
||||||
from ovtk_audiencekit.core import PluginBase
|
from ovtk_audiencekit.plugins import PluginBase
|
||||||
from ovtk_audiencekit.core.Data import CACHE_DIR
|
from ovtk_audiencekit.core.Data import CACHE_DIR
|
||||||
from ovtk_audiencekit.plugins.builtins.Command import Command, CommandTypes
|
from ovtk_audiencekit.plugins.builtins.Command import Command, CommandTypes
|
||||||
from ovtk_audiencekit.events.Message import Message, SysMessage
|
from ovtk_audiencekit.events.Message import Message, SysMessage
|
||||||
|
|
|
@ -2,7 +2,7 @@ import asyncio
|
||||||
|
|
||||||
import mido
|
import mido
|
||||||
|
|
||||||
from ovtk_audiencekit.core import PluginBase
|
from ovtk_audiencekit.plugins import PluginBase
|
||||||
|
|
||||||
|
|
||||||
def matches(msg, attrs):
|
def matches(msg, attrs):
|
||||||
|
|
|
@ -2,7 +2,7 @@ import asyncio
|
||||||
|
|
||||||
import simpleobsws
|
import simpleobsws
|
||||||
|
|
||||||
from ovtk_audiencekit.core import PluginBase
|
from ovtk_audiencekit.plugins import PluginBase
|
||||||
|
|
||||||
|
|
||||||
class OBSWSPlugin(PluginBase):
|
class OBSWSPlugin(PluginBase):
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
from pythonosc.udp_client import SimpleUDPClient
|
from pythonosc.udp_client import SimpleUDPClient
|
||||||
|
|
||||||
from ovtk_audiencekit.core import PluginBase
|
from ovtk_audiencekit.plugins import PluginBase
|
||||||
|
|
||||||
|
|
||||||
class OSCPlugin(PluginBase):
|
class OSCPlugin(PluginBase):
|
||||||
|
|
|
@ -4,7 +4,7 @@ import json
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from ovtk_audiencekit.core.Data import CACHE_DIR
|
from ovtk_audiencekit.core.Data import CACHE_DIR
|
||||||
from ovtk_audiencekit.core import PluginBase
|
from ovtk_audiencekit.plugins import PluginBase
|
||||||
from ovtk_audiencekit.events import Message
|
from ovtk_audiencekit.events import Message
|
||||||
|
|
||||||
from .Formatter import PhraseCountFormatter
|
from .Formatter import PhraseCountFormatter
|
||||||
|
|
|
@ -2,7 +2,7 @@ from argparse import ArgumentError
|
||||||
|
|
||||||
from requests.exceptions import HTTPError
|
from requests.exceptions import HTTPError
|
||||||
|
|
||||||
from ovtk_audiencekit.core import PluginBase
|
from ovtk_audiencekit.plugins import PluginBase
|
||||||
from ovtk_audiencekit.plugins.builtins.Command import Command, CommandTypes
|
from ovtk_audiencekit.plugins.builtins.Command import Command, CommandTypes
|
||||||
from ovtk_audiencekit.events.Message import Message, SysMessage, USER_TYPE
|
from ovtk_audiencekit.events.Message import Message, SysMessage, USER_TYPE
|
||||||
from ovtk_audiencekit.chats.Twitch import Process as Twitch
|
from ovtk_audiencekit.chats.Twitch import Process as Twitch
|
||||||
|
|
|
@ -6,7 +6,7 @@ from TTS.utils.synthesizer import Synthesizer
|
||||||
from TTS.utils.manage import ModelManager
|
from TTS.utils.manage import ModelManager
|
||||||
from TTS.config import load_config
|
from TTS.config import load_config
|
||||||
|
|
||||||
from ovtk_audiencekit.core import PluginBase
|
from ovtk_audiencekit.plugins import PluginBase
|
||||||
from ovtk_audiencekit.events import Message, SysMessage
|
from ovtk_audiencekit.events import Message, SysMessage
|
||||||
from ovtk_audiencekit.core import Clip, Stream
|
from ovtk_audiencekit.core import Clip, Stream
|
||||||
from ovtk_audiencekit.core.Data import CACHE_DIR
|
from ovtk_audiencekit.core.Data import CACHE_DIR
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
|
from ovtk_audiencekit.core.PluginBase import PluginBase, PluginError
|
||||||
|
|
||||||
|
__all__ = ['PluginBase', 'PluginError']
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import random
|
import random
|
||||||
|
|
||||||
from ovtk_audiencekit.core import PluginBase
|
from ovtk_audiencekit.plugins import PluginBase
|
||||||
|
|
||||||
|
|
||||||
class ChancePlugin(PluginBase):
|
class ChancePlugin(PluginBase):
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import subprocess
|
import subprocess
|
||||||
import random
|
import random
|
||||||
|
|
||||||
from ovtk_audiencekit.core import PluginBase
|
from ovtk_audiencekit.plugins import PluginBase
|
||||||
from ovtk_audiencekit.events import SysMessage
|
from ovtk_audiencekit.events import SysMessage
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import sys
|
||||||
|
|
||||||
from multipledispatch import dispatch
|
from multipledispatch import dispatch
|
||||||
|
|
||||||
from ovtk_audiencekit.core import PluginBase
|
from ovtk_audiencekit.plugins import PluginBase
|
||||||
from ovtk_audiencekit.events import Message, SysMessage
|
from ovtk_audiencekit.events import Message, SysMessage
|
||||||
from ovtk_audiencekit.events.Message import USER_TYPE
|
from ovtk_audiencekit.events.Message import USER_TYPE
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ import uuid
|
||||||
import maya
|
import maya
|
||||||
import aioscheduler
|
import aioscheduler
|
||||||
|
|
||||||
from ovtk_audiencekit.core import PluginBase
|
from ovtk_audiencekit.plugins import PluginBase
|
||||||
from ovtk_audiencekit.utils import format_exception
|
from ovtk_audiencekit.utils import format_exception
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
from ovtk_audiencekit.core import PluginBase
|
from ovtk_audiencekit.plugins import PluginBase
|
||||||
from ovtk_audiencekit.events import SysMessage
|
from ovtk_audiencekit.events import SysMessage
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from ovtk_audiencekit.core import PluginBase
|
from ovtk_audiencekit.plugins import PluginBase
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from ovtk_audiencekit.core import PluginBase
|
from ovtk_audiencekit.plugins import PluginBase
|
||||||
from ovtk_audiencekit.events import SysMessage, Message
|
from ovtk_audiencekit.events import SysMessage, Message
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ import json
|
||||||
|
|
||||||
import kdl
|
import kdl
|
||||||
|
|
||||||
from ovtk_audiencekit.core import PluginBase
|
from ovtk_audiencekit.plugins import PluginBase
|
||||||
from ovtk_audiencekit.utils import format_exception
|
from ovtk_audiencekit.utils import format_exception
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from ovtk_audiencekit.core import PluginBase
|
from ovtk_audiencekit.plugins import PluginBase
|
||||||
from ovtk_audiencekit.core.Config import compute_dynamic
|
from ovtk_audiencekit.core.Config import compute_dynamic
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ import re
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
import typing
|
import typing
|
||||||
|
|
||||||
from ovtk_audiencekit.core import PluginBase
|
from ovtk_audiencekit.plugins import PluginBase
|
||||||
from ovtk_audiencekit.events import Message
|
from ovtk_audiencekit.events import Message
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from ovtk_audiencekit.core import PluginBase
|
from ovtk_audiencekit.plugins import PluginBase
|
||||||
from ovtk_audiencekit.events import SysMessage, Message
|
from ovtk_audiencekit.events import SysMessage, Message
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue