XRoom_Unity/Assets/Photon/PhotonVoice/Code/UtilityScripts/TestTone.cs
2025-05-31 10:20:20 +03:30

32 lines
1015 B
C#

// --------------------------------------------------------------------------------
// <copyright file="TestTone.cs" company="Exit Games GmbH">
// Part of: Photon Voice Utilities for Unity - Copyright (C) 2018 Exit Games GmbH
// </copyright>
// <summary>
// This MonoBehaviour is a sample demo of how to use AudioSource.Factory
// by implementing IAudioReader.
// </summary>
// <author>developer@exitgames.com</author>
// --------------------------------------------------------------------------------
using System;
using UnityEngine;
namespace Photon.Voice.Unity.UtilityScripts
{
[RequireComponent(typeof(Recorder))]
public class TestTone : MonoBehaviour
{
private void Start()
{
Recorder rec = this.gameObject.GetComponent<Recorder>();
rec.SourceType = Recorder.InputSourceType.Factory;
rec.InputFactory = () =>
{
return new AudioUtil.ToneAudioPusher<float>(440, 100, 24000, 1);
};
}
}
}