Skip to content

Unity gamepad haptics from audio frequencies using the new input system.

License

Notifications You must be signed in to change notification settings

robertrumney/audio-haptics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Unity Audio Haptics Feedback

This is a simple script used to translate audio response from a single AudioListener into Gamepad vibration feedback, without the need to configure each vibration and audiosource manually.

Features

  • Real-time Audio Analysis: Analyze the audio output in real-time to extract frequency data.
  • Dynamic Haptic Feedback: Convert audio frequencies into nuanced haptic feedback.
  • Customizable Frequency Ranges: Easily adjust the frequency range for haptic feedback to suit different game types or preferences.
  • Plug-and-Play: Designed to be easily integrated into any Unity project with minimal setup.

Getting Started

Prerequisites

  • Unity 2019.4 LTS or later
  • Gamepad compatible with Unity's new Input System

Usage

Simply play your scene. The script automatically analyzes audio output and translates it into haptic feedback on the connected gamepad. Adjust the script parameters to fine-tune the haptic feedback.

Configuration

  • Spectrum Data Size: Adjust the spectrumData array size based on the complexity of the audio.
  • Frequency Cutoff: Modify the cutoff index to separate low and high frequencies according to your needs.

Contributing

I welcome contributions and suggestions! Please fork the repository and submit pull requests for any improvements you wish to make.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

About

Unity gamepad haptics from audio frequencies using the new input system.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages