Skip to content

Conversation

Copy link

Copilot AI commented Nov 15, 2025

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.

Original prompt

Add a new Aliucord plugin called "RealTimeVoiceChanger" that provides experimental real-time voice modification for Discord voice chats inside the Aliucord client. The PR should add all necessary plugin files, hooks, and a simple UI for users to enable/disable the plugin and choose an effect. Keep the implementation modular so we can extend it later.

Goals (what to add):

  1. Plugin metadata and entry point

    • Add a plugin.json with name, author, version, description and required permissions (RECORD_AUDIO).
    • Add src/main/kotlin/com/aliucord/plugins/realtimevoicechanger/RealTimeVoiceChanger.kt implementing the plugin.
  2. UI

    • Create a settings UI accessible from the Aliucord Plugins menu exposing:
      • A toggle to enable/disable processing.
      • A dropdown or segmented control to select effect: "None", "Pitch Shift Up", "Pitch Shift Down", "Robot", "Echo".
      • A slider for effect intensity where applicable.
    • Persist settings using Aliucord's Settings API (settings.store).
  3. Audio processing implementation (experimental)

    • Add an audio processing pipeline that intercepts outgoing microphone PCM frames before they are encoded and sent to voice servers.
    • Use a pure-Java/Kotlin DSP library (TarsosDSP) for pitch shifting and a simple effect implementations for 'robot' (ring modulation) and 'echo' (simple delay buffer).
    • Add gradle/maven dependency declaration where the repo's plugin build system expects (if repo uses single-file plugins, vendor the minimal DSP code inside the plugin under an internal package). If the repo build system doesn't support adding external deps, implement lightweight DSP inline: a basic pitch shifter using naive resampling (time-scale modification via linear interpolation) and simple ring-modulation and delay.
  4. Hook points

    • Locate and patch Discord/Aliucord method(s) responsible for capturing or queueing microphone audio frames for sending. If exact class/method names vary across Discord versions, implement the hook in a resilient way:
      • Attempt to patch common audio capture or encoder entrypoints (for example names like "AudioDataProvider", "AudioInput", "AudioCapturer", "VoiceWebSocket", or other audio send functions) using Aliucord's patcher.
      • When a matching method is found, intercept raw PCM byte[] or short[] frames, convert to float samples [-1..1], apply the selected effect, convert back to required format, and return to the original flow.
    • If a reliable hook into Discord's internal audio pipeline cannot be safely found, provide an experimental fallback mode that captures audio using Android's AudioRecord (MIC) and demonstrates effects locally (does not send to VC). Mark this mode clearly in the UI as "Local demo only".
  5. Performance and threading

    • Perform DSP on a dedicated background thread to avoid blocking the UI thread.
    • Keep CPU and memory use modest: process in chunks typical for voice (e.g., 20ms frames at 48kHz -> 960 samples), and avoid large allocations per frame.
  6. Permissions

    • Ensure plugin requests RECORD_AUDIO and check for runtime permission before enabling processing; show a prompt if missing.
  7. Logging and safety

    • Add Aliucord logger entries for enable/disable and when hooking fails so users can troubleshoot.
    • Make processing opt-in (disabled by default).
  8. Tests and README

    • Add a short README.md under the plugin folder describing the plugin, limitations (experimental, may not work across releases), and how to use/enable it.

Developer notes for implementer (important):

  • This is an experimental feature that manipulates microphone audio. The implementation must be conservative to avoid crashes. Keep error handling around any patches so that if the patch fails the plugin falls back to no-op and logs the failure.
  • If the repository's plugin architecture uses a single-file Kotlin plugin style (many Aliucord plugin repos do), favor a single Kotlin file with internal helper classes to keep the PR minimal.
  • Aim for a minimal but functional MVP that demonstrates real-time processing when a hook is available or a local demo when not. We can iterate after review to improve audio quality and integrate native low-latency libraries.

Files to add (exact list expected in the PR):

  • plugins/RealTimeVoiceChanger/plugin.json
  • plugins/RealTimeVoiceChanger/src/main/kotlin/com/aliucord/plugins/realtimevoicechanger/RealTimeVoiceChanger.kt
  • plugins/RealTimeVoiceChanger/README.md

Please create a PR that adds those files and implements the described features. If any assumptions about the repository layout or build system are required, make reasonable defaults and document them in the PR description. Keep all code licensed compatibly with the repository (MIT-compatible header if the repo uses MIT).

This pull request was created as a result of the following prompt from Copilot chat.

Add a new Aliucord plugin called "RealTimeVoiceChanger" that provides experimental real-time voice modification for Discord voice chats inside the Aliucord client. The PR should add all necessary plugin files, hooks, and a simple UI for users to enable/disable the plugin and choose an effect. Keep the implementation modular so we can extend it later.

Goals (what to add):

  1. Plugin metadata and entry point

    • Add a plugin.json with name, author, version, description and required permissions (RECORD_AUDIO).
    • Add src/main/kotlin/com/aliucord/plugins/realtimevoicechanger/RealTimeVoiceChanger.kt implementing the plugin.
  2. UI

    • Create a settings UI accessible from the Aliucord Plugins menu exposing:
      • A toggle to enable/disable processing.
      • A dropdown or segmented control to select effect: "None", "Pitch Shift Up", "Pitch Shift Down", "Robot", "Echo".
      • A slider for effect intensity where applicable.
    • Persist settings using Aliucord's Settings API (settings.store).
  3. Audio processing implementation (experimental)

    • Add an audio processing pipeline that intercepts outgoing microphone PCM frames before they are encoded and sent to voice servers.
    • Use a pure-Java/Kotlin DSP library (TarsosDSP) for pitch shifting and a simple effect implementations for 'robot' (ring modulation) and 'echo' (simple delay buffer).
    • Add gradle/maven dependency declaration where the repo's plugin build system expects (if repo uses single-file plugins, vendor the minimal DSP code inside the plugin under an internal package). If the repo build system doesn't support adding external deps, implement lightweight DSP inline: a basic pitch shifter using naive resampling (time-scale modification via linear interpolation) and simple ring-modulation and delay.
  4. Hook points

    • Locate and patch Discord/Aliucord method(s) responsible for capturing or queueing microphone audio frames for sending. If exact class/method names vary across Discord versions, implement the hook in a resilient way:
      • Attempt to patch common audio capture or encoder entrypoints (for example names like "AudioDataProvider", "AudioInput", "AudioCapturer", "VoiceWebSocket", or other audio send functions) using Aliucord's patcher.
      • When a matching method is found, intercept raw PCM byte[] or short[] frames, convert to float samples [-1..1], apply the selected effect, convert back to required format, and return to the original flow.
    • If a reliable hook into Discord's internal audio pipeline cannot be safely found, provide an experimental fallback mode that captures audio using Android's AudioRecord (MIC) and demonstrates effects locally (does not send to VC). Mark this mode clearly in the UI as "Local demo only".
  5. Performance and threading

    • Perform DSP on a dedicated background thread to avoid blocking the UI thread.
    • Keep CPU and memory use modest: process in chunks typical for voice (e.g., 20ms frames at 48kHz -> 960 samples), and avoid large allocations per frame.
  6. Permissions

    • Ensure plugin requests RECORD_AUDIO and check for runtime permission before enabling processing; show a prompt if missing.
  7. Logging and safety

    • Add Aliucord logger entries for enable/disable and when hooking fails so users can troubleshoot.
    • Make processing opt-in (disabled by default).
  8. Tests and README

    • Add a short README.md under the plugin folder describing the plugin, limitations (experimental, may not work across releases), and how to use/enable it.

Developer notes for implementer (important):

  • This is an experimental feature that manipulates microphone audio. The implementation must be conservative to avoid crashes. Keep error handling around any patches so that if the patch fails the plugin falls back to no-op and logs the failure.
  • If the repository's plugin architecture uses a single-file Kotlin plugin style (many Aliucord plugin repos do), favor a single Kotlin file with internal helper classes to keep the PR minimal.
  • Aim for a minimal but functional MVP that demonstrates real-time processing when a hook is available or a local demo when not. We can iterate after review to improve audio quality and integrate native low-latency libraries.

Files to add (exact list expected in the PR):

  • plugins/RealTimeVoiceChanger/plugin.json
  • plugins/RealTimeVoiceChanger/src/main/kotlin/com/aliucord/plugins/realtimevoicechanger/RealTimeVoiceChanger.kt
  • plugins/RealTimeVoiceChanger/README.md

Please create a PR that adds those files and implements the described features. If any assumptions about the repository layout or build system are required, make reasonable defaults and document them in the PR description. Keep all code licensed compatibly with the repository (MIT-compatible header if the repo uses MIT).


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Nov 15, 2025
Copilot stopped work on behalf of Tanmayop9 due to an error November 15, 2025 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant