Commit Graph

61 Commits

Author SHA1 Message Date
Kyle Simpson
03ae0e7628 Input: Allow Restartable sources to be lazy
This change is made with queue users in mind. Since sources
of this kind *know* how to (re)create themselves, they can
avoid being created at all until needed.

This also adds machinery to preload tracks *before* they are
needed, for gapless playback on queues and so on. Queues
make use of the event system to do this.
2020-12-28 17:17:57 +00:00
Kyle Simpson
504b8dfaef Driver, Input: Performance & Benchmarks (#27)
* Driver Benchmarks

Benchmarks driver use cases for single packet send,
multiple packet send, float vs opus, and the cost of
head-of-queue track removal.

Mix costs for large packet counts are also included.

This is a prelude to the optimisations discussed in
#21.

* Typo in benchmark

* Place Opus packet directly into packet buffer

Cleans up some other logic surrounding this, too. Gets a 16.9% perf improvement on opus packet passthrough (sub 5us here).

* Better track removal

In theory this should be faster, but it aint. Keeping in case
reducing struct sizes down the line magically makes this
faster.

* Reduce size of Input, TrackHandle

Metadata is now boxed away. Similarly, TrackHandles are neatly Arc'd to reduce their size to pointer length (and mitigate the impact of copies if we add in more fields).
2020-12-26 23:08:35 +00:00
Kyle Simpson
2fc88a6ef1 Deps: Patch flume.
Addresses security advisory in downstream nanorand.
2020-12-19 13:18:46 +00:00
Maspenguin
1ada46d24b Fix: Remove serenity default features (#18)
Allows use of songbird without serenity's framework.
2020-11-23 10:43:24 +00:00
Kyle Simpson
de652250d8 TrackQueues: Convenience methods and extension (#7)
* Adds a uuid field to tracks and handles to make it easier to identify and match event sources after the fact.
* Adds optional feature "builtin-queue" to expose a queue on every driver, as a convenience for users who can guarantee they'll need a queue for every driver/call.
* Adds methods to queues to allow access to the currently running track handle, remove a specified queue entry, as well as to mutate the underlying queue from a closure.
2020-11-16 08:57:54 +00:00
( ͡° ͜ʖ ͡°)
6702520b7c Offer youtube-dlc as an alternative to youtube-dl (#1)
* Adds youtube-dlc feature.
2020-11-13 22:27:28 +00:00
Kyle Simpson
a9f8d6c93a Fix: Use correct tokio features for driver-only mode 2020-11-13 19:32:03 +00:00
Alex M. M
4a897a7b76 Remove mentions of versions to Serenity git dependencies 2020-11-13 15:07:29 +01:00
Alex M. M
6724655351 Update Cargo.toml to reflect the separation of songbird from Serenity's repository 2020-11-13 14:55:38 +01:00
Kyle Simpson
868785ba71 Update versions for twilight and serenity-voice-model in songbird (#1075) 2020-11-12 13:34:23 +01:00
Kyle Simpson
7e4392ae68 Voice Rework -- Events, Track Queues (#806)
This implements a proof-of-concept for an improved audio frontend. The largest change is the introduction of events and event handling: both by time elapsed and by track events, such as ending or looping. Following on from this, the library now includes a basic, event-driven track queue system (which people seem to ask for unusually often). A new sample, `examples/13_voice_events`, demonstrates both the `TrackQueue` system and some basic events via the `~queue` and `~play_fade` commands.

Locks are removed from around the control of `Audio` objects, which should allow the backend to be moved to a more granular futures-based backend solution in a cleaner way.
2020-10-31 12:19:07 +01:00