Skip to content

feat: build RakVoice into the core library#28

Merged
Segfaultd merged 1 commit into
MafiaHub:masterfrom
Kheartz:feature/rakvoice-in-core
Jun 15, 2026
Merged

feat: build RakVoice into the core library#28
Segfaultd merged 1 commit into
MafiaHub:masterfrom
Kheartz:feature/rakvoice-in-core

Conversation

@Kheartz

@Kheartz Kheartz commented Jun 13, 2026

Copy link
Copy Markdown

Move RakVoice from DependentExtensions into the core MafiaNet library so voice support is always built, instead of being gated behind MAFIANET_BUILD_SAMPLES.

  • Move RakVoice.{h,cpp} to Source/include/mafianet and Source/src, and add them to the core source/header lists.
  • Add cmake/FetchVoiceDependencies.cmake to fetch Opus and RNNoise unconditionally, included before the Source subdirectory. The core targets link them via $<BUILD_INTERFACE:...> so the install/export set is unaffected.
  • Drop Opus/RNNoise from FetchDependencies.cmake (now sample-only: bzip2, miniupnpc, jansson) and remove the standalone RakVoice target.
  • Repoint the RakVoice samples at the MafiaNet target and the mafianet/RakVoice.h header.

Fix the RNNoise target source list while here: it omitted parse_lpcnet_weights.c and the model rnnoise_data.c, leaving rnn_parse_weights/init_rnnoise/rnnoise_arrays unresolved when linking a shared library or executable.

Summary by CodeRabbit

  • Refactor
    • Voice support (Opus/RNNoise) is now integrated into the core library rather than a separate extension.
    • Build process fetches and prepares voice dependencies earlier for more consistent builds.
    • Sample projects simplified by removing redundant voice library linkages.
    • Public header paths updated to a unified library namespace.
    • Packaging/install metadata adjusted so voice runtime symbols are resolved for consumers.

@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Kheartz, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 7 minutes and 8 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 59c01cb3-5691-4cf1-a28c-a645d57e83ac

📥 Commits

Reviewing files that changed from the base of the PR and between 0b2e165 and 40e21a0.

📒 Files selected for processing (15)
  • CMakeLists.txt
  • DependentExtensions/CMakeLists.txt
  • Samples/RakVoice/CMakeLists.txt
  • Samples/RakVoice/main.cpp
  • Samples/RakVoiceDSound/CMakeLists.txt
  • Samples/RakVoiceDSound/DSoundVoiceAdapter.h
  • Samples/RakVoiceDSound/main.cpp
  • Samples/RakVoiceFMOD/CMakeLists.txt
  • Samples/RakVoiceFMOD/FMODVoiceAdapter.h
  • Samples/RakVoiceFMOD/main.cpp
  • Source/CMakeLists.txt
  • Source/include/mafianet/RakVoice.h
  • Source/src/RakVoice.cpp
  • cmake/FetchDependencies.cmake
  • cmake/FetchVoiceDependencies.cmake

Walkthrough

This PR centralizes voice dependency fetching into a new CMake module, integrates RakVoice sources and header into the core MafiaNet library (linking opus/rnnoise privately), removes separate RakVoice targets from extensions/samples, and updates sample includes to mafianet/RakVoice.h.

Changes

RakVoice Core Integration

Layer / File(s) Summary
Voice dependency architecture
cmake/FetchVoiceDependencies.cmake, CMakeLists.txt, cmake/FetchDependencies.cmake
Introduce FetchVoiceDependencies.cmake to fetch/build Opus (v1.6.1) and conditionally build RNNoise (with pinned model); top-level CMakeLists.txt includes this module before Source, and FetchDependencies.cmake now fetches only bzip2, miniupnpc, and jansson.
RakVoice core library integration
Source/CMakeLists.txt, Source/src/RakVoice.cpp
Add src/RakVoice.cpp and include/mafianet/RakVoice.h to core sources/headers; link core PRIVATE against opus and rnnoise; include opus/rnnoise in MafiaNetTargets export; update RakVoice.cpp include path.
Sample projects alignment
Samples/RakVoice/*, Samples/RakVoiceDSound/*, Samples/RakVoiceFMOD/*
Remove RakVoice from sample target_link_libraries and update all sample/adapters to include mafianet/RakVoice.h, leaving samples linked to MafiaNet and platform audio libs.
DependentExtensions cleanup
DependentExtensions/CMakeLists.txt
Remove local RakVoice static target and its opus/rnnoise wiring; update comments to reflect RakVoice is built into the core library and adjust documented FetchContent list.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • MafiaHub/MafiaNet#1: Updates Opus version in dependency configuration; related to the Opus fetch setup introduced here.

Poem

🐰 I hopped through CMake fields today,
Fetching Opus, RNNoise on the way,
RakVoice tucked into the core,
Samples lean and headers soar,
Now the build hums, hooray hooray! 🎶

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: build RakVoice into the core library' clearly and concisely describes the main change: moving RakVoice from an optional dependent extension to being built into the core MafiaNet library by default.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Kheartz Kheartz force-pushed the feature/rakvoice-in-core branch 2 times, most recently from db1e36e to be25fbe Compare June 13, 2026 03:57
@Kheartz Kheartz marked this pull request as ready for review June 13, 2026 03:58

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Source/CMakeLists.txt (1)

317-326: ⚠️ Potential issue | 🟠 Major

MafiaNetStatic install/export should propagate opus/rnnoise link requirements

  • In Source/CMakeLists.txt, opus/rnnoise are added as PRIVATE links using $<BUILD_INTERFACE:opus> and $<BUILD_INTERFACE:rnnoise>, so they won’t be part of the exported install-time usage requirements.
  • cmake/MafiaNetConfig.cmake.in only declares find_dependency(OpenSSL) and find_dependency(Threads) (no find_dependency entries for opus/rnnoise), so installed static consumers won’t get the dependencies needed to resolve opus_* / rnnoise_* when using the RakVoice codepath.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Source/CMakeLists.txt` around lines 317 - 326, The install/export omits opus
and rnnoise usage requirements because in target_link_libraries(${target_name})
they are added as PRIVATE via $<BUILD_INTERFACE:opus> and
$<BUILD_INTERFACE:rnnoise>, so change those entries to propagate to consumers
(use PUBLIC or $<BUILD_INTERFACE:...,$<INSTALL_INTERFACE:...> style or add an
INTERFACE link target) so installed MafiaNetStatic consumers see opus/rnnoise;
then update cmake/MafiaNetConfig.cmake.in to add find_dependency(opus) and
find_dependency(rnnoise) (or otherwise export/import targets for those libs) so
the generated config pulls in the runtime build dependencies when an installed
package consumes the RakVoice codepath.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@Source/CMakeLists.txt`:
- Around line 317-326: The install/export omits opus and rnnoise usage
requirements because in target_link_libraries(${target_name}) they are added as
PRIVATE via $<BUILD_INTERFACE:opus> and $<BUILD_INTERFACE:rnnoise>, so change
those entries to propagate to consumers (use PUBLIC or
$<BUILD_INTERFACE:...,$<INSTALL_INTERFACE:...> style or add an INTERFACE link
target) so installed MafiaNetStatic consumers see opus/rnnoise; then update
cmake/MafiaNetConfig.cmake.in to add find_dependency(opus) and
find_dependency(rnnoise) (or otherwise export/import targets for those libs) so
the generated config pulls in the runtime build dependencies when an installed
package consumes the RakVoice codepath.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5d4952f9-31d1-4c3a-ac0e-7f21d1aa3459

📥 Commits

Reviewing files that changed from the base of the PR and between 7298644 and be25fbe.

📒 Files selected for processing (15)
  • CMakeLists.txt
  • DependentExtensions/CMakeLists.txt
  • Samples/RakVoice/CMakeLists.txt
  • Samples/RakVoice/main.cpp
  • Samples/RakVoiceDSound/CMakeLists.txt
  • Samples/RakVoiceDSound/DSoundVoiceAdapter.h
  • Samples/RakVoiceDSound/main.cpp
  • Samples/RakVoiceFMOD/CMakeLists.txt
  • Samples/RakVoiceFMOD/FMODVoiceAdapter.h
  • Samples/RakVoiceFMOD/main.cpp
  • Source/CMakeLists.txt
  • Source/include/mafianet/RakVoice.h
  • Source/src/RakVoice.cpp
  • cmake/FetchDependencies.cmake
  • cmake/FetchVoiceDependencies.cmake
💤 Files with no reviewable changes (3)
  • Samples/RakVoiceDSound/CMakeLists.txt
  • Samples/RakVoiceFMOD/CMakeLists.txt
  • Samples/RakVoice/CMakeLists.txt

@Kheartz Kheartz force-pushed the feature/rakvoice-in-core branch 3 times, most recently from 0b2e165 to 9e963c0 Compare June 15, 2026 05:57
Move RakVoice from DependentExtensions into the core MafiaNet library so
voice support is always built, instead of being gated behind
MAFIANET_BUILD_SAMPLES.

- Move RakVoice.{h,cpp} to Source/include/mafianet and Source/src, and add
  them to the core source/header lists.
- Add cmake/FetchVoiceDependencies.cmake to fetch Opus and RNNoise
  unconditionally, included before the Source subdirectory. The core
  targets link them via $<BUILD_INTERFACE:...> so the install/export set
  is unaffected.
- Drop Opus/RNNoise from FetchDependencies.cmake (now sample-only:
  bzip2, miniupnpc, jansson) and remove the standalone RakVoice target.
- Repoint the RakVoice samples at the MafiaNet target and the
  mafianet/RakVoice.h header.

Fix the RNNoise target source list while here: it omitted
parse_lpcnet_weights.c and the model rnnoise_data.c, leaving
rnn_parse_weights/init_rnnoise/rnnoise_arrays unresolved when linking a
shared library or executable.
@Kheartz Kheartz force-pushed the feature/rakvoice-in-core branch from 9e963c0 to 40e21a0 Compare June 15, 2026 11:26
@Segfaultd Segfaultd merged commit 53553ad into MafiaHub:master Jun 15, 2026
3 of 4 checks passed
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.

2 participants