12 lines
345 B
Python
12 lines
345 B
Python
from source import packets
|
|
from source.behaviors.events import base
|
|
|
|
|
|
class AudioEvent(base.BaseEvent):
|
|
"""
|
|
Event reacting to receiving audio data.
|
|
"""
|
|
|
|
def handle(self, packet: packets.AudioPacket, address: tuple):
|
|
# add the audio chunk to the buffer of audio packet to play
|
|
self.manager.audio.add_audio(packet)
|