본문 바로가기
Unity3D/Unity & C#

Unity & C# ~ 음성 녹음 세팅

by 캬캬백곰 2022. 6. 8.
728x90
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour 
{
    void Start() 
    {
        AudioSource aud = GetComponent<AudioSource>();
        aud.clip = Microphone.Start("Built-in Microphone", true, 10, 44100);
        aud.Play();
    }
}

/*

Microphone.Start(deviceName, loop, lengthSec, frequency);
deviceName = string형, null값 사용 가능
loop = bool형, lengthSec에 도달하면 레코딩을 계속하거나 AudioClip을 처음부터 레코딩하는지 여부를 표시
lengthSec = int형, audioclip 길이
frequency = int형, samplerate

*/

 

SampleRate

출처 : 위키백과

 

- 참고자료

유니티 공식 매뉴얼 : https://docs.unity3d.com/kr/530/ScriptReference/Microphone.Start.html

 

Unity - 스크립팅 API: Microphone.Start

Success! Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable. 닫기

docs.unity3d.com

 

 samplerate 위키백과 링크 : https://ko.wikipedia.org/wiki/%EC%83%98%ED%94%8C%EB%A7%81_%EC%86%8D%EB%8F%84#%EC%98%A4%EB%94%94%EC%98%A4

 

샘플링 속도 - 위키백과, 우리 모두의 백과사전

아날로그 신호(파란색)와 고정된 간격('샘플링 레이트')을 가진 표본화된 신호(빨간색) 샘플링 레이트(영어: sampling rate) 또는 샘플링 주파수(영어: sampling frequency)는 이산적(離散的)인 신호를 만들

ko.wikipedia.org

 

728x90
반응형