Sinks¶
Core¶
- class discord.sinks.Filters(**kwargs)[ソース]¶
Filters for
SinkAdded in version 2.0.
- パラメータ:
container -- Container of all Filters.
- class discord.sinks.Sink(*, filters=None)[ソース]¶
A sink "stores" recorded audio data.
Can be subclassed for extra customizablilty.
警告
It is recommended you use the officially provided sink classes, such as
WaveSink.just replace the following like so:
vc.start_recording( MySubClassedSink(), finished_callback, ctx.channel, )
Added in version 2.0.
- 例外:
ClientException -- An invalid encoding type was specified.
ClientException -- Audio may only be formatted after recording is finished.
- class discord.sinks.AudioData(file)[ソース]¶
Handles data that's been completely decrypted and decoded and is ready to be saved to file.
Added in version 2.0.
- write(data)[ソース]¶
Writes audio data.
- 例外:
ClientException -- The AudioData is already finished writing.
- cleanup()[ソース]¶
Finishes and cleans up the audio data.
- 例外:
ClientException -- The AudioData is already finished writing.
- on_format(encoding)[ソース]¶
Called when audio data is formatted.
- 例外:
ClientException -- The AudioData is still writing.
Sink Classes¶
- class discord.sinks.WaveSink(*, filters=None)[ソース]¶
A special sink for .wav(wave) files.
Added in version 2.0.
- format_audio(audio)[ソース]¶
Formats the recorded audio.
- 例外:
WaveSinkError -- Audio may only be formatted after recording is finished.
WaveSinkError -- Formatting the audio failed.
- class discord.sinks.MP3Sink(*, filters=None)[ソース]¶
A special sink for .mp3 files.
Added in version 2.0.
- format_audio(audio)[ソース]¶
Formats the recorded audio.
- 例外:
MP3SinkError -- Audio may only be formatted after recording is finished.
MP3SinkError -- Formatting the audio failed.
- class discord.sinks.MP4Sink(*, filters=None)[ソース]¶
A special sink for .mp4 files.
Added in version 2.0.
- format_audio(audio)[ソース]¶
Formats the recorded audio.
- 例外:
MP4SinkError -- Audio may only be formatted after recording is finished.
MP4SinkError -- Formatting the audio failed.
- class discord.sinks.M4ASink(*, filters=None)[ソース]¶
A special sink for .m4a files.
Added in version 2.0.
- format_audio(audio)[ソース]¶
Formats the recorded audio.
- 例外:
M4ASinkError -- Audio may only be formatted after recording is finished.
M4ASinkError -- Formatting the audio failed.
- class discord.sinks.MKVSink(*, filters=None)[ソース]¶
A special sink for .mkv files.
Added in version 2.0.
- format_audio(audio)[ソース]¶
Formats the recorded audio.
- 例外:
MKVSinkError -- Audio may only be formatted after recording is finished.
MKVSinkError -- Formatting the audio failed.
- class discord.sinks.MKASink(*, filters=None)[ソース]¶
A special sink for .mka files.
Added in version 2.0.
- format_audio(audio)[ソース]¶
Formats the recorded audio.
- 例外:
MKASinkError -- Audio may only be formatted after recording is finished.
MKASinkError -- Formatting the audio failed.
- class discord.sinks.OGGSink(*, filters=None)[ソース]¶
A special sink for .ogg files.
Added in version 2.0.
- format_audio(audio)[ソース]¶
Formats the recorded audio.
- 例外:
OGGSinkError -- Audio may only be formatted after recording is finished.
OGGSinkError -- Formatting the audio failed.