[Audio] [Informational] Create a public api #3157
Labels
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Mrcoolgamer11/Red-DiscordBot#3157
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This issue is so users and devs can voice their ideas on f what they would like the audio api to be able to do, not guaranteeing everything here will be done but getting some ideas of what users would like to be able to do would be awesome ahead of creating the api.
The current goal is to make things like auto lyrics, audio trivia, sfx, audio porn, audio clever bot all possible.
I think that #1811 would work well as part of the API in some way.
Blocked by #3459
Okay... so I will be starting the Audio rewrite over the next few days.
The rewrite will be making use of the Audio API as such I will need to write it and implement it, I would like every CC/user who hopes to make use of this audio api (It would be similar to the Bank API and Modlog API, i.e it would work without the Audio cog loaded) to ask questions and give suggestions and ideas of what they would like this to see.
If you dont mention it now it will be much harder to implement later on so please make your voice heard, no question/suggestion is a stupid one.
Just a big FYI note, this rewrite will depricate https://github.com/Cog-Creators/Red-Lavalink as we will be moving to use https://github.com/PythonistaGuild/Wavelink/.
Cogs will no longer need (definitively shouldnt) to import
lavalinkand should only ever use the avaliable public methods.With this in mind please make sure to let me know if you import lavalink now .. what do you use it for, so that i can be made avaliable in the API.
Currently using wavelink already for a minimal interface for a much less feature rich (intentionally on my part) alternative to core audio. If i intend to continue not using core audio, will these changes break me?
Most likely no.
The main reason existing cogs that depend on RLL will break is that RLL will stop being initialized by audio. as the Lavalink servers will be managed by WL. so if you already let WL manage the node you should be good.
Another potential reason for breaking cogs is functions and methods being renamed/moved around/removed. so if you use anything inside the audio cog I can't guarantee their avaliability at this stage.
Initially I was going to say no it shouldnt break you, but then it came to me. the LL server will need to be initialized at boot, if i hope to be able to provide the api in any clean form, which means it could potentially cause it to conflict with an already running jar (although there was a brief mention of potentially changing the default lavalink port (along side with allowing the bot owner to customize the application.yml).
I would assume that's gonna be disableable though, right?
If core audio isnt loaded, why would the bot start a lavalink connection (even via wavelink) without being told to?
just for wider visibility as discussed this on discord.
However an alternative discussed on discord is requiring cog creators to
call
API.start()(or a similarly named function) to start the API and wait forAPI.is_ready()(or a similarly named function before they attempt to use the API.With a lazy load approach like that, resources wouldn't be used until needed. It may be worth considering an inactive timeout on the lavalink server at a later time (for example, single server bots hosted on a pi during off-hours) but a long as the initial api doesn't forcibly start it with or without being told to do sk, im fine with it.
Here's what I'd like to see in the new API:
These are the baseline features that are needed for the sfx cog to function, and this is what it uses from LL at the moment.
For my purposes, it would nice to be able to say "play <file> in <voice channel> right now, and then go back to whatever you were doing (if anything)" via a single API call. The use case is small sound bites that a cog might want to play. (For those familiar with my cogs, CustomJoinleave is what I'm thinking of here.)
It would, of course, be possible for such a cog to accomplish the same thing by itself, by figuring out what is playing where, pausing/suspending it, playing the sound it wants where it wants, and then resuming the previously playing track. But since this may become something of a common pattern (CJL, sfx, etc.) I could see an API for this specific sequence being very useful.
I use audio for the audio-trivia cog, that plays short clips from a list and has users guess the song or sound. As such, most of the API commands wouldn't be useful for me, since there is little customization.
In general though, the useful thing for my cog is that custom user settings for sound (like EQ, volume, or such) would be pervasive without needing to call and set them.
For my purposes I would like to retrieve a song title string from a specified url without interrupting any concurrent lavalink players.
This would be used for a lyrics cog with the user inputting a spotify or youtube url.
since im already spamming the issue tracker ... :aaaaaaaaaaa::aaaaaaaaaaa:
:aaaaaaaaaaa::aaaaaaaaaaa:
:aaaaaaaaaaa::aaaaaaaaaaa:
:aaaaaaaaaaa::aaaaaaaaaaa:
:aaaaaaaaaaa::aaaaaaaaaaa:
:aaaaaaaaaaa::aaaaaaaaaaa:
this issue sucks