Sinks

Core

class discord.sinks.Filters(**kwargs)[源代码]

Filters for Sink

在 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,
)

在 2.0 版本加入.

抛出:
get_all_audio()[源代码]

Gets all audio files.

get_user_audio(user)[源代码]

Gets the audio file(s) of one specific user.

参数:

user (str | int)

class discord.sinks.AudioData(file)[源代码]

Handles data that's been completely decrypted and decoded and is ready to be saved to file.

在 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.

class discord.sinks.RawData(data, client)[源代码]

Handles raw data from Discord so that it can be decrypted and decoded to be used.

在 2.0 版本加入.

Sink Classes

class discord.sinks.WaveSink(*, filters=None)[源代码]

A special sink for .wav(wave) files.

在 2.0 版本加入.

format_audio(audio)[源代码]

Formats the recorded audio.

抛出:
class discord.sinks.MP3Sink(*, filters=None)[源代码]

A special sink for .mp3 files.

在 2.0 版本加入.

format_audio(audio)[源代码]

Formats the recorded audio.

抛出:
class discord.sinks.MP4Sink(*, filters=None)[源代码]

A special sink for .mp4 files.

在 2.0 版本加入.

format_audio(audio)[源代码]

Formats the recorded audio.

抛出:
class discord.sinks.M4ASink(*, filters=None)[源代码]

A special sink for .m4a files.

在 2.0 版本加入.

format_audio(audio)[源代码]

Formats the recorded audio.

抛出:
class discord.sinks.MKVSink(*, filters=None)[源代码]

A special sink for .mkv files.

在 2.0 版本加入.

format_audio(audio)[源代码]

Formats the recorded audio.

抛出:
class discord.sinks.MKASink(*, filters=None)[源代码]

A special sink for .mka files.

在 2.0 版本加入.

format_audio(audio)[源代码]

Formats the recorded audio.

抛出:
class discord.sinks.OGGSink(*, filters=None)[源代码]

A special sink for .ogg files.

在 2.0 版本加入.

format_audio(audio)[源代码]

Formats the recorded audio.

抛出: