프로젝트
GitHub에서 보기
allanpichardo/Unity-Beat-Detection
소개
Unity 게임 엔진에서 사용할 수 있는 음악 비트 감지 및 오디오 스펙트럼 분석 기능입니다.
게임 및 에뮬레이션측정된 스타 증가
- in 24h
- -1
- in 7 days
- -1
- in 15 days
- -1
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalUnity-Beat-Detection
Musical beat detection and audio spectrum analysis for use with the Unity game engine.
The AudioProcessor class contains an interface that can be implemented on your GameObject.
Usage
Add the AudioProcessor script to your Main Camera object and adjust the threshold parameter to change the sensitivity. Then set a callback delegate on the audio processor's onBeat or onSpectrum events.public class Example : MonoBehaviour
{
void Start ()
{
//Select the instance of AudioProcessor and pass a reference
//to this object
AudioProcessor processor = FindObjectOfType<AudioProcessor> ();
processor.onBeat.AddListener (onOnbeatDetected);
processor.onSpectrum.AddListener (onSpectrum);
}
//this event will be called every time a beat is detected.
//Change the threshold parameter in the inspector
//to adjust the sensitivity
void onOnbeatDetected ()
{
Debug.Log ("Beat!!!");
}
//This event will be called every frame while music is playing
void onSpectrum (float[] spectrum)
{
//The spectrum is logarithmically averaged
//to 12 bands
for (int i = 0; i < spectrum.Length; ++i) {
Vector3 start = new Vector3 (i, 0, 0);
Vector3 end = new Vector3 (i, spectrum [i], 0);
Debug.DrawLine (start, end);
}
}
}
관련 프로젝트 살펴보기
불러오는 중…