Skip to content

refractor: Native audio handling. The big big audio rework - #132

Merged
kitsumed merged 14 commits into
mainfrom
the-big-big-audio-rework
Oct 20, 2026
Merged

kitsumed merged 14 commits into
mainfrom
the-big-big-audio-rework

Conversation

@kitsumed

Copy link
Copy Markdown
Owner

Big refractor related to audio handling, scrcpy is gone, couple of unrelated edits since I kind of worked on this over 2 month as a "test" to see if I could figure it out and didn't do any commit at the start. There is also one related change for a bug fix.

Tested by myself on a couple of Android version via emulator. Others used tested debug builds and confirmed it worked.

Closes #1, #13, #73, #130, #49, #114

Major changes, some mixed since I didn't commit along. I still need to fix the FakeContext, scrcpy does a bit more for some phone so I need to do that, more extensive testing and then release v2
Tested the code on lower android version, it now has been tested on AOSP emulator Android 11,13,15,16. Some changes where made due to some mistakes, improvements and comments update too.
Tried to configure verification-metadata.xml again but even without the scrcpy binary it is complex. There are a lot of possible failure cases which make me consider if it's worth the big hassle. At least caching should be improved. I think.
Forgot to clean strings during the refractor... Also added voice recognition and remote submix as debug.
Declare audiorecord as non private since normal calling app does not have priviledges to bypass that check, so they probably get silenced by the OS.

Also a couple of new audio sources. May need to refractor the reflection AudioRecord because it bugged me a bit when I got to edit it.
Fun fact, I just learned that c# out parameter is possible between C+ and Java.

C+ equivalent to c# is to declare int *sessionId in its signatures .

For C+ -- Java communication, they make uses of arrays since the object stays the same, but the content inside can change across processes.
Quickly checked the changelogs while trying to make the PR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment