Skip to content

Instantly share code, notes, and snippets.

@devoxin
devoxin / CrossfadeV3.kt
Last active December 29, 2023 21:05
Lavaplayer cross-fading, using ShortBuffers with a revised player implementation.
// DecodableAudioFrame.kt
import com.sedmelluq.discord.lavaplayer.format.StandardAudioDataFormats
import com.sedmelluq.discord.lavaplayer.format.transcoder.AudioChunkDecoder
import com.sedmelluq.discord.lavaplayer.track.playback.MutableAudioFrame
import java.nio.ByteBuffer
import java.nio.ByteOrder
import java.nio.ShortBuffer
class DecodableAudioFrame : MutableAudioFrame() {
private val decodedBuffer = ByteBuffer.allocateDirect(StandardAudioDataFormats.DISCORD_PCM_S16_BE.maximumChunkSize())
@devoxin
devoxin / discord_webpack.md
Created September 6, 2023 01:25 — forked from aiko-chan-ai/discord_webpack.md
Discord Webpack

Get + Find modules

!function(){"use strict";function e(){let e=window.webpackChunkdiscord_app.push([[Symbol()],{},e=>e]);return window.webpackChunkdiscord_app.pop(),e}function t(){let t=[];for(let n of Object.values(e().c))n.exports&&n.exports!==window&&t.push(n.exports);return t}function n(e){return t().find(e)}function r(e){return t().filter(e)}function o(e,t=!1){var o=t?[]:null;let i=(t?r:n)(function(n){let r=e(n);return r&&(t?o.push(r):o=r),r});return t?o.map((e,t)=>"string"==typeof e?i[t][e]:i[t]):"string"==typeof o?i[o]:i}function i(e,t){if(e?.displayName===t||"function"==typeof e?.getName&&e.getName()===t)return!0;for(let n of Object.getOwnPropertyNames(e)){try{e[n]}catch{console.warn("%c[elysia] %cFailed to access property","color: purple","",n,e);continue}if(e[n]?.displayName===t||"function"==typeof e[n]?.getName&&e[n]?.getName()===t)return n}}function l(e,t){var n=null;for(let r of t){if(e&&["object","function"].includes(typeof e)&&r in e)continue;let o=null;for(let i of Object.getOwnProper