|
52 | 52 | from . import opus, utils |
53 | 53 | from .backoff import ExponentialBackoff |
54 | 54 | from .gateway import * |
55 | | -from .errors import ClientException, ConnectionClosed, RecordingException |
| 55 | +from .errors import ClientException, ConnectionClosed |
56 | 56 | from .player import AudioPlayer, AudioSource |
57 | | -from .sinks import Sink, RawData |
| 57 | +from .sinks import Sink, RawData, RecordingException |
58 | 58 |
|
59 | 59 | from .utils import MISSING |
60 | 60 |
|
@@ -704,13 +704,13 @@ def unpack_audio(self, data): |
704 | 704 |
|
705 | 705 | self.decoder.decode(data) |
706 | 706 |
|
707 | | - def listen(self, sink, callback, *args): |
| 707 | + def start_recording(self, sink, callback, *args): |
708 | 708 | """The bot will begin recording audio from the current voice channel it is in. |
709 | 709 | This function uses a thread so the current code line will not be stopped. |
710 | 710 | Must be in a voice channel to use. |
711 | 711 | Must not be already recording. |
712 | 712 |
|
713 | | - .. versionadded:: 2.0 |
| 713 | + .. versionadded:: 2.1 |
714 | 714 |
|
715 | 715 | Parameters |
716 | 716 | ---------- |
@@ -754,12 +754,12 @@ def listen(self, sink, callback, *args): |
754 | 754 | ) |
755 | 755 | t.start() |
756 | 756 |
|
757 | | - def stop_listening(self): |
| 757 | + def stop_recording(self): |
758 | 758 | """Stops the recording. |
759 | 759 | Must be already recording. |
760 | 760 | Raises |
761 | 761 |
|
762 | | - .. versionadded:: 2.0 |
| 762 | + .. versionadded:: 2.1 |
763 | 763 |
|
764 | 764 | ------ |
765 | 765 | RecordingException |
@@ -811,7 +811,7 @@ def recv_audio(self, sink, callback, *args): |
811 | 811 | try: |
812 | 812 | data = self.socket.recv(4096) |
813 | 813 | except OSError: |
814 | | - self.stop_listening() |
| 814 | + self.stop_recording() |
815 | 815 | continue |
816 | 816 |
|
817 | 817 | self.unpack_audio(data) |
|
0 commit comments