human/human/audio_handler.py
2024-10-16 19:04:12 +08:00

22 lines
508 B
Python

#encoding = utf8
import logging
from abc import ABC, abstractmethod
logger = logging.getLogger(__name__)
class AudioHandler(ABC):
def __init__(self, context, handler):
self._context = context
self._handler = handler
@abstractmethod
def on_handle(self, stream, index):
pass
def on_next_handle(self, stream, type_):
if self._handler is not None:
self._handler.on_handle(stream, type_)
else:
logging.info(f'_handler is None')