Sinks

Core

class discord.sinks.Filters(**kwargs)[source]

Filters for Sink

Ajouté dans la version 2.0.

Paramètres:

container – Container of all Filters.

class discord.sinks.Sink(*, filters=None)[source]

A sink « stores » recorded audio data.

Can be subclassed for extra customizablilty.

Avertissement

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

Ajouté dans la version 2.0.

Lève:
get_all_audio()[source]

Gets all audio files.

get_user_audio(user)[source]

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

Paramètres:

user (str | int)

class discord.sinks.AudioData(file)[source]

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

Ajouté dans la version 2.0.

write(data)[source]

Writes audio data.

Lève:

ClientException – The AudioData is already finished writing.

cleanup()[source]

Finishes and cleans up the audio data.

Lève:

ClientException – The AudioData is already finished writing.

on_format(encoding)[source]

Called when audio data is formatted.

Lève:

ClientException – The AudioData is still writing.

class discord.sinks.RawData(data, client)[source]

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

Ajouté dans la version 2.0.

Sink Classes

class discord.sinks.WaveSink(*, filters=None)[source]

A special sink for .wav(wave) files.

Ajouté dans la version 2.0.

format_audio(audio)[source]

Formats the recorded audio.

Lève:
class discord.sinks.MP3Sink(*, filters=None)[source]

A special sink for .mp3 files.

Ajouté dans la version 2.0.

format_audio(audio)[source]

Formats the recorded audio.

Lève:
  • MP3SinkError – Audio may only be formatted after recording is finished.

  • MP3SinkError – Formatting the audio failed.

class discord.sinks.MP4Sink(*, filters=None)[source]

A special sink for .mp4 files.

Ajouté dans la version 2.0.

format_audio(audio)[source]

Formats the recorded audio.

Lève:
  • MP4SinkError – Audio may only be formatted after recording is finished.

  • MP4SinkError – Formatting the audio failed.

class discord.sinks.M4ASink(*, filters=None)[source]

A special sink for .m4a files.

Ajouté dans la version 2.0.

format_audio(audio)[source]

Formats the recorded audio.

Lève:
  • M4ASinkError – Audio may only be formatted after recording is finished.

  • M4ASinkError – Formatting the audio failed.

class discord.sinks.MKVSink(*, filters=None)[source]

A special sink for .mkv files.

Ajouté dans la version 2.0.

format_audio(audio)[source]

Formats the recorded audio.

Lève:
  • MKVSinkError – Audio may only be formatted after recording is finished.

  • MKVSinkError – Formatting the audio failed.

class discord.sinks.MKASink(*, filters=None)[source]

A special sink for .mka files.

Ajouté dans la version 2.0.

format_audio(audio)[source]

Formats the recorded audio.

Lève:
  • MKASinkError – Audio may only be formatted after recording is finished.

  • MKASinkError – Formatting the audio failed.

class discord.sinks.OGGSink(*, filters=None)[source]

A special sink for .ogg files.

Ajouté dans la version 2.0.

format_audio(audio)[source]

Formats the recorded audio.

Lève:
  • OGGSinkError – Audio may only be formatted after recording is finished.

  • OGGSinkError – Formatting the audio failed.