EarPerkOSC is a C++ application with a Dear ImGui interface that listens to stereo audio from your system and sends OSC messages to make your VRChat avatar's ears perk. If a loud sound occurs mostly on your left side, the message to perk the left ear will be sent, same for the right, and same for audio that's close to the center. If the audio is especially loud, your ears can also fold back protectively!
After a delay (configurable), the message to unperk your ears may be sent (if the sound has stopped). Boolean VRCExpressionParameters are used to control the ear perking, and to only require 2 to 4 bits of space in your parameters.
Audio is captured from your system's audio output as a loopback device--so anything you hear, your avatar will react to (including Discord/Telegram notification pings).
EarPerkOSC features a real-time graphical interface showing:
- Live volume meters for left and right audio channels
- Volume threshold indicators for normal and excessive volume levels
- Status indicators for left ear, right ear, and overwhelm states
- Current OSC message status
- Configurable settings with real-time adjustment
An OSC connection is made to 127.0.0.1:9000 by default. The endpoint can be configured both through the UI and in the config.ini file.
EarPerkOSC works alongside other OSC applications like VRCFT and doesn't require any special OSC routing.
You'll need to modify your avatar to respond to updates to the avatar parameters. EarPerkLeft and EarPerkRight booleans at a minimum. You can use my template with VRCFury to do this quite easily.
My template is available on my Gumroad: https://foxipso.gumroad.com
If you're creating this yourself, make the following animation files:
- Ear Left Perk
- Ear Left Neutral
- Ear Right Perk
- Ear Right Neutral
- Both Ears Fold
Then create an animation controller using the avatar parameters as floats (they're bools in the VRCExpressionParameters, but you use them as if they were floats). You can animate them using direct and 1D blend trees. The animation clips don't need more than one keyframe.
Your config.ini
file will automatically be created when you run the application for the first time.
Config File Location:
- Windows:
%APPDATA%\EarPerkOSC\config.ini
(typicallyC:\Users\[Username]\AppData\Roaming\EarPerkOSC\config.ini
) - Linux/Mac:
~/.config/EarPerkOSC/config.ini
Here's a complete config.ini file with an explanation of the configurable parameters:
[connection]
address=127.0.0.1
port=9000
osc_address_left=/avatar/parameters/EarPerkLeft
osc_address_right=/avatar/parameters/EarPerkRight
osc_address_overwhelmingly_loud=/avatar/parameters/EarOverwhelm
[audio]
differential_threshold=0.027
volume_threshold=0.165
excessive_volume_threshold=0.234
reset_timeout_ms=1000
timeout_ms=100
auto_volume_threshold=false
auto_excessive_threshold=false
volume_threshold_multiplier=2.0
excessive_threshold_multiplier=3.0
log_level=WARN
selected_device_id=
address
andport
are the address and port of the OSC server you're sending to (VRChat)osc_address_left
andosc_address_right
are the OSC addresses for the left and right ear parametersosc_address_overwhelmingly_loud
is the OSC address for the "overwhelmingly loud" parameterdifferential_threshold
is the minimum difference between channels to trigger a single-ear perkvolume_threshold
is the minimum volume needed to trigger an ear perkexcessive_volume_threshold
is the volume level that triggers protective ear foldingreset_timeout_ms
is the delay before unperking ears after sound stopstimeout_ms
is the minimum delay between ear perk attemptsauto_volume_threshold
enables automatic volume threshold adjustment based on ambient audioauto_excessive_threshold
enables automatic excessive volume threshold adjustmentvolume_threshold_multiplier
sets how many standard deviations above mean for auto volume thresholdexcessive_threshold_multiplier
sets how many standard deviations above mean for auto excessive thresholdlog_level
sets the logging verbosity (DEBUG, INFO, WARN, or ERROR)selected_device_id
is the ID of the audio device to capture from. If not set, the default device will be used.
All these parameters can be adjusted in real-time through the UI, and saved to the config file.
- Visual Studio 2022 with C++ desktop development workload
- CMake 3.15 or higher
- Dear ImGui
- GLFW
- GLAD
- oscpp
- inih
- Clone the repository
- Open the project in Visual Studio
- Build the solution
- Run EarPerkOSC.exe from the output directory
- Download the latest release
- Extract all files to a directory
- Run EarPerkOSC.exe
- The config.ini file will be created automatically in
%APPDATA%\EarPerkOSC\
on first run - Adjust settings through the UI or by editing the config file directly
For support, please visit foxipso.com
For Avatar prefabs, visit foxipso.com or foxipso.gumroad.com
- Added logging (%appdata%/EarPerkOSC/EarPerkOSC.log)
- Bugfix where systems that don't support 96 kHz would crash
- Capture device selection and refresh
- VoiceMeeter support (allows selecting VoiceMeeter output devices, e.g., A1, B1)
- Fixed issue where config settings weren't saved if the installation dir was system-owned
- Automatic config creation with better error handling
- Volume bar scaling - threshold indicators now stay within proper range
- Automatic audio device auto-reconnection
- Manual audio reconnect button to the UI
- More robust audio device handling and error recovery
- Rewrite in C++ w/ DearImGui because Rust cringe
- Live volume meters and threshold visualization
- Auto-threshold adjustment based on ambient audio
- Differential audio detection for L/R
- OSC integration with VRChat
- Initial Rust implementation
Thanks to BenacleJames for help with Rust and testing
This project is licensed under the Apache License - see the LICENSE file for details.