|
| 1 | +# 🎧 EarPerkOSC |
| 2 | + |
| 3 | +**EarPerkOSC** is a C++ application with a Dear ImGui interface that listens to stereo audio from your system and sends OSC messages to |
| 4 | +make your VRChat avatar's ears perk. If a loud sound occurs mostly on your left side, the message to perk the left ear |
| 5 | +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 |
| 6 | +can also fold back protectively! |
| 7 | + |
| 8 | +After a delay (configurable), the message to unperk your ears may be sent (if the sound has stopped). Boolean VRCExpressionParameters are used to |
| 9 | +control the ear perking, and to only require 2 to 4 bits of space in your parameters. |
| 10 | + |
| 11 | +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 |
| 12 | +notification pings). |
| 13 | + |
| 14 | +## 🖥️ Interface |
| 15 | + |
| 16 | +EarPerkOSC features a real-time graphical interface showing: |
| 17 | +- Live volume meters for left and right audio channels |
| 18 | +- Volume threshold indicators for normal and excessive volume levels |
| 19 | +- Status indicators for left ear, right ear, and overwhelm states |
| 20 | +- Current OSC message status |
| 21 | +- Configurable settings with real-time adjustment |
| 22 | + |
| 23 | +## 🛰️ OSC Configuration |
| 24 | + |
| 25 | +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. |
| 26 | + |
| 27 | +**EarPerkOSC** works alongside other OSC applications like [VRCFT](https://github.com/benaclejames/VRCFaceTracking) and doesn't require any special OSC routing. |
| 28 | + |
| 29 | +## 🦊 Avatar Configuration |
| 30 | + |
| 31 | +You'll need to modify your avatar to respond to updates to the avatar parameters. EarPerkLeft and EarPerkRight booleans |
| 32 | +at a minimum. You can use my template with [VRCFury](https://vrcfury.com/) to do this quite easily. |
| 33 | + |
| 34 | +My template is available on my Gumroad: https://foxipso.gumroad.com |
| 35 | + |
| 36 | +If you're creating this yourself, make the following animation files: |
| 37 | + |
| 38 | +* Ear Left Perk |
| 39 | +* Ear Left Neutral |
| 40 | +* Ear Right Perk |
| 41 | +* Ear Right Neutral |
| 42 | +* Both Ears Fold |
| 43 | + |
| 44 | +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). |
| 45 | +You can animate them using direct and 1D blend trees. The animation clips don't need more than one keyframe. |
| 46 | + |
| 47 | +## ⚙️ config.ini |
| 48 | + |
| 49 | +Your `config.ini` file will automatically be created when you run the application for the first time. |
| 50 | +Here's a complete config.ini file with an explanation of the configurable parameters: |
| 51 | + |
| 52 | +```ini |
| 53 | +[connection] |
| 54 | +address=127.0.0.1 |
| 55 | +port=9000 |
| 56 | +osc_address_left=/avatar/parameters/EarPerkLeft |
| 57 | +osc_address_right=/avatar/parameters/EarPerkRight |
| 58 | +osc_address_overwhelmingly_loud=/avatar/parameters/EarOverwhelm |
| 59 | + |
| 60 | +[audio] |
| 61 | +differential_threshold=0.027 |
| 62 | +volume_threshold=0.165 |
| 63 | +excessive_volume_threshold=0.234 |
| 64 | +reset_timeout_ms=1000 |
| 65 | +timeout_ms=100 |
| 66 | +``` |
| 67 | + |
| 68 | +* `address` and `port` are the address and port of the OSC server you're sending to (VRChat) |
| 69 | +* `osc_address_left` and `osc_address_right` are the OSC addresses for the left and right ear parameters |
| 70 | +* `osc_address_overwhelmingly_loud` is the OSC address for the "overwhelmingly loud" parameter |
| 71 | +* `differential_threshold` is the minimum difference between channels to trigger a single-ear perk |
| 72 | +* `volume_threshold` is the minimum volume needed to trigger an ear perk |
| 73 | +* `excessive_volume_threshold` is the volume level that triggers protective ear folding |
| 74 | +* `reset_timeout_ms` is the delay before unperking ears after sound stops |
| 75 | +* `timeout_ms` is the minimum delay between ear perk attempts |
| 76 | + |
| 77 | +All these parameters can be adjusted in real-time through the UI, and saved to the config file. |
| 78 | + |
| 79 | +## 🛠️ Building |
| 80 | + |
| 81 | +### Prerequisites |
| 82 | +- Visual Studio 2022 with C++ desktop development workload |
| 83 | +- CMake 3.15 or higher |
| 84 | + |
| 85 | +### Dependencies (included) |
| 86 | +- Dear ImGui |
| 87 | +- GLFW |
| 88 | +- GLAD |
| 89 | +- oscpp |
| 90 | +- inih |
| 91 | + |
| 92 | +### Build Steps |
| 93 | +1. Clone the repository |
| 94 | +2. Open the project in Visual Studio |
| 95 | +3. Build the solution |
| 96 | +4. Run EarPerkOSC.exe from the output directory |
| 97 | + |
| 98 | +## 💾 Installation |
| 99 | + |
| 100 | +1. Download the latest release |
| 101 | +2. Extract all files to a directory |
| 102 | +3. Run EarPerkOSC.exe |
| 103 | +4. The config.ini file will be created on first run |
| 104 | +5. Adjust settings through the UI or by editing config.ini |
| 105 | + |
| 106 | +## 🤝 Support |
| 107 | + |
| 108 | +For support, please visit [foxipso.com](http://foxipso.com) |
| 109 | + |
| 110 | +For Avatar prefabs, visit [foxipso.com](http://foxipso.com) or [foxipso.gumroad.com](https://foxipso.gumroad.com) |
| 111 | + |
| 112 | +## 📅 Version History |
| 113 | + |
| 114 | +1.0.0 - C++ rewrite with DearImGui interface (based) |
| 115 | +0.9.0 - Initial Rust release (cringe) |
| 116 | + |
| 117 | +## Acknowledgements |
| 118 | + |
| 119 | +Thanks to [BenacleJames](https://github.com/benaclejames/) for help with Rust and testing |
| 120 | + |
| 121 | +## ⚖️ License |
| 122 | + |
| 123 | +This project is licensed under the ??? |
0 commit comments