[Audio] [Informational] Create a public api #3157

Closed
opened 2019-11-28 09:31:27 +01:00 by Drapersniper · 14 comments
Drapersniper commented 2019-11-28 09:31:27 +01:00 (Migrated from github.com)

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.

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.
Flame442 commented 2020-01-08 16:08:39 +01:00 (Migrated from github.com)

I think that #1811 would work well as part of the API in some way.

I think that #1811 would work well as part of the API in some way.
Drapersniper commented 2020-01-30 10:32:59 +01:00 (Migrated from github.com)

Blocked by #3459

Blocked by #3459
Drapersniper commented 2020-06-21 01:33:52 +02:00 (Migrated from github.com)

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 lavalink and 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.

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 `lavalink` and 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.
mikeshardmind commented 2020-06-21 01:47:03 +02:00 (Migrated from github.com)

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?

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?
Drapersniper commented 2020-06-21 01:55:37 +02:00 (Migrated from github.com)

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

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).
Jackenmen commented 2020-06-21 01:56:35 +02:00 (Migrated from github.com)

the LL server will need to be initialized at boot

I would assume that's gonna be disableable though, right?

> the LL server will need to be initialized at boot I would assume that's gonna be disableable though, right?
mikeshardmind commented 2020-06-21 01:58:51 +02:00 (Migrated from github.com)

If core audio isnt loaded, why would the bot start a lavalink connection (even via wavelink) without being told to?

If core audio isnt loaded, why would the bot start a lavalink connection (even via wavelink) without being told to?
Drapersniper commented 2020-06-21 02:18:44 +02:00 (Migrated from github.com)

just for wider visibility as discussed this on discord.

  1. Lavalink server can take a while to boot to initialising it when a cog tries to make an API call is not fisable.
  2. The reasoning to have it on by default which was discussed back when the API was first discussed internally was so that any cog could use it without having to have Audio loaded.

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 for API.is_ready() (or a similarly named function before they attempt to use the API.

just for wider visibility as discussed this on discord. 1. Lavalink server can take a while to boot to initialising it when a cog tries to make an API call is not fisable. 2. The reasoning to have it on by default which was discussed back when the API was first discussed internally was so that any cog could use it without having to have Audio loaded. 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 for `API.is_ready()` (or a similarly named function before they attempt to use the API.
mikeshardmind commented 2020-06-21 02:23:25 +02:00 (Migrated from github.com)

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.

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.
baiumbg commented 2020-06-24 12:48:39 +02:00 (Migrated from github.com)

Here's what I'd like to see in the new API:

  1. Player controls - skip, seek, pause, play, etc.
  2. Access to the track queue + ability to manipulate it (insert track, move tracks around)
  3. Track event subscriptions - track end, track start, track stuck/exception, etc.

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.

Here's what I'd like to see in the new API: 1. Player controls - skip, seek, pause, play, etc. 2. Access to the track queue + ability to manipulate it (insert track, move tracks around) 3. Track event subscriptions - track end, track start, track stuck/exception, etc. 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.
tmercswims commented 2020-06-24 21:52:45 +02:00 (Migrated from github.com)

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.

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.
bobloy commented 2020-06-30 15:29:31 +02:00 (Migrated from github.com)

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.

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.
TheWyn commented 2020-11-24 21:09:42 +01:00 (Migrated from github.com)

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.

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.
Drapersniper commented 2021-05-31 13:41:40 +02:00 (Migrated from github.com)

since im already spamming the issue tracker ... :aaaaaaaaaaa::aaaaaaaaaaa:
:aaaaaaaaaaa::aaaaaaaaaaa:
:aaaaaaaaaaa::aaaaaaaaaaa:
:aaaaaaaaaaa::aaaaaaaaaaa:
:aaaaaaaaaaa::aaaaaaaaaaa:
:aaaaaaaaaaa::aaaaaaaaaaa:
this issue sucks

since im already spamming the issue tracker ... :aaaaaaaaaaa::aaaaaaaaaaa: :aaaaaaaaaaa::aaaaaaaaaaa: :aaaaaaaaaaa::aaaaaaaaaaa: :aaaaaaaaaaa::aaaaaaaaaaa: :aaaaaaaaaaa::aaaaaaaaaaa: :aaaaaaaaaaa::aaaaaaaaaaa: this issue sucks
Sign in to join this conversation.
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
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot#3157
No description provided.