mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-22 05:09:05 +00:00
23 lines
553 B
Python
23 lines
553 B
Python
from reflector.processors.base import Processor
|
|
from reflector.processors.types import AudioFile, Transcript
|
|
|
|
|
|
class AudioTranscriptProcessor(Processor):
|
|
"""
|
|
Transcript audio file
|
|
"""
|
|
|
|
INPUT_TYPE = AudioFile
|
|
OUTPUT_TYPE = Transcript
|
|
|
|
async def _push(self, data: AudioFile):
|
|
try:
|
|
result = await self._transcript(data)
|
|
if result:
|
|
await self.emit(result)
|
|
finally:
|
|
data.release()
|
|
|
|
async def _transcript(self, data: AudioFile):
|
|
raise NotImplementedError
|