C# 클래스 kOS.Sound.Voice

Represents one of the hardware voices in the "sound chip", and its settings.
상속: UnityEngine.MonoBehaviour, IVoice
파일 보기 프로젝트 열기: KSP-KOS/KOS

공개 메소드들

메소드 설명
Awake ( ) : void
BeginProceduralSound ( IProceduralSoundWave waveGen, float frequency, float duration, float volume = 1f ) : bool

Begin a single note from a ProceduralSoundWave reference sample. You can pass in a frequency and it will "stretch" the reference sample to make it fit the given frequency.

BeginProceduralSound ( float frequency, float duration, float volume = 1f ) : bool

Begin a single note. You can pass in a frequency and it will "stretch" the reference sample to make it fit the given frequency.

ChangeFrequency ( float newFrequency ) : void

Change the frequency of the note in mid-note (for slide effects).

SetWave ( IProceduralSoundWave waveGen ) : void
Stop ( ) : void
Update ( ) : void

Maintains the volume level in accordance to the ADSR envelope rules, and the note's holding duration.

비공개 메소드들

메소드 설명
InitNote ( ) : void

Called whenever a new note starts, to get the AudioSource and ProceduralSoundWave to use the note's values, and then start the note.

메소드 상세

Awake() 공개 메소드

public Awake ( ) : void
리턴 void

BeginProceduralSound() 공개 메소드

Begin a single note from a ProceduralSoundWave reference sample. You can pass in a frequency and it will "stretch" the reference sample to make it fit the given frequency.
public BeginProceduralSound ( IProceduralSoundWave waveGen, float frequency, float duration, float volume = 1f ) : bool
waveGen IProceduralSoundWave a procedural sound wave loaded and prepped ahead of time
frequency float the note, expressed in Hertz (not musical scales)
duration float the note's duration, in seconds.
volume float the note's volume, from 0.0 up to 1.0
리턴 bool

BeginProceduralSound() 공개 메소드

Begin a single note. You can pass in a frequency and it will "stretch" the reference sample to make it fit the given frequency.
public BeginProceduralSound ( float frequency, float duration, float volume = 1f ) : bool
frequency float the note, expressed in Hertz (not musical scales)
duration float the note's duration, in seconds.
volume float the note's volume, from 0.0 up to 1.0
리턴 bool

ChangeFrequency() 공개 메소드

Change the frequency of the note in mid-note (for slide effects).
public ChangeFrequency ( float newFrequency ) : void
newFrequency float
리턴 void

SetWave() 공개 메소드

public SetWave ( IProceduralSoundWave waveGen ) : void
waveGen IProceduralSoundWave
리턴 void

Stop() 공개 메소드

public Stop ( ) : void
리턴 void

Update() 공개 메소드

Maintains the volume level in accordance to the ADSR envelope rules, and the note's holding duration.
public Update ( ) : void
리턴 void