You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for waveform and send it along with message creates
Usage example:
awaitbot.rest.create_message(
attachment=hikari.File("voice.mp3"),
waveform=calculated_waveform, # or just ""flags=hikari.MessageFlag.IS_VOICE_MESSAGE
)
Checklist
I have searched the issue tracker and have made sure it's not a duplicate. If it is a follow up of another issue, I have specified it.
The text was updated successfully, but these errors were encountered:
I vouch for creating a new base type, something like VoiceMessage. Adding waveform= to all hikari resource bases sounds...iffy. I can't describe why, but intuition says it's iffy.
For implementation, I found librosa that does the downsampling in Python rather than having to offload to ffmpeg. The only pain is that librosa only does sample rate, not bit depth, though I assume with some nparray shenanigan the bit depth should be easy enough. It's just a graphical representation, not some audio nerd stuffs.
Although, considering librosa's dependencies, if we were to go with it as a "battery included", I'd rather we put it as another extra like hikari[voicemsg]. How many times do you see a Discord bot library ship with number-crunching dependencies?
Summary
Add support for setting and sending
waveform
in the payload when creating a message.Should also be documented how to calculate the waveform (discord/discord-api-docs#6082 (comment))
Ideal implementation
Add support for waveform and send it along with message creates
Usage example:
Checklist
The text was updated successfully, but these errors were encountered: