以下の内容はhttps://baba-s.hatenablog.com/entry/2018/01/24/085500より取得しました。


【Unity】オーディオのビートとスペクトラムを検知できる「Unity-Beat-Detection」紹介

はじめに

「Unity-Beat-Detection」を Unity プロジェクトに導入することで
オーディオのビートとスペクトラムを検知できるようになります

使い方

f:id:baba_s:20180103144916p:plain

using UnityEngine;

public class Example : MonoBehaviour
{
    public AudioProcessor processor;

    private void Start()
    {
        processor.onBeat.AddListener( OnBeat );
        processor.onSpectrum.AddListener( OnSpectrum );
    }

    private void OnBeat()
    {
        Debug.Log( "Beat!!!" );
    }

    private void OnSpectrum( float[] spectrum )
    {
        for ( int i = 0; i < spectrum.Length; ++i )
        {
            Debug.Log( spectrum[ i ] );
        }
    }
}

上記のようなコードを記述します

関連記事




以上の内容はhttps://baba-s.hatenablog.com/entry/2018/01/24/085500より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14