사운드 웨이브 속성
사운드 웨이브에서 전체 PCM 버퍼를 직접 검색할 수 있습니다.
- Blueprint
- C++
// Assuming ImportedSoundWave is a UE reference to a UImportedSoundWave object
TArray<float> PCMBuffer = ImportedSoundWave->GetPCMBufferCopy();
원활한 오디오 루프를 만들려면 루핑을 설정하여 재생이 끝난 후에 음파 재생 시간을 자동으로 0으로 되감아 재생할 수 있습니다.
- Blueprint
- C++
// Assuming ImportedSoundWave is a UE reference to a UImportedSoundWave object
ImportedSoundWave->SetLooping(false);
재생 중인 소리의 볼륨을 필요에 맞게 조절할 수 있습니다.
- Blueprint
- C++
// Assuming ImportedSoundWave is a UE reference to a UImportedSoundWave object
ImportedSoundWave->SetVolume(1.0f);
재생되는 소리의 피치를 취향에 맞게 수정할 수도 있습니다.
- Blueprint
- C++
// Assuming ImportedSoundWave is a UE reference to a UImportedSoundWave object
ImportedSoundWave->SetPitch(1.0f);
자막을 설정하여, 표시될 텍스트와 시간을 정의할 수 있습니다.
- Blueprint
- C++
// Assuming ImportedSoundWave is a UE reference to a UImportedSoundWave object
TArray<FEditableSubtitleCue> Subtitles;
FEditableSubtitleCue Subtitle;
Subtitle.Text = FText::FromString("Example");
Subtitle.Time = 2.0f;
Subtitles.Add(Subtitle);
ImportedSoundWave->SetSubtitles(Subtitles);
가상화 모드를 설정할 수 있습니다. 예를 들어, Play When Silent는 무음일 때도 사운드 웨이브 재생을 계속할 수 있게 합니다. 이는 사운드 감쇠를 사용하는 경우에 특히 유용합니다.
- Blueprint
- C++
// Assuming ImportedSoundWave is a UE reference to a UImportedSoundWave object
ImportedSoundWave->SetVirtualizationMode(EVirtualizationMode::PlayWhenSilent);
임포트된 사운드 웨이브의 샘플 레이트 또는 채널 수를 변경해 야 하는 경우, 적절한 함수들을 사용하여 오디오 데이터를 재샘플링하고 믹스할 수 있습니다. 이렇게 함으로써 전체 사운드 웨이브 데이터가 수정되며 OnGeneratePCMData
와 OnPopulateAudioData
델리게이트에서 출력에 영향을 미치게 됩니다.
- Blueprint
- C++
// Assuming ImportedSoundWave is a UE reference to a UImportedSoundWave object
ImportedSoundWave->ResampleSoundWave(44100);
ImportedSoundWave->MixSoundWaveChannels(2);
또는 지정된 샘플 속도와 채널 수로 자동으로 모든 다가오는 오디오 데이터를 리샘플링 및 믹싱하고 싶다면, 다음 함수를 사용할 수 있습니다 (이는 OnGeneratePCMData
및 OnPopulateAudioData
대리자에서의 출력에도 영향을 줍니다).
- Blueprint
- C++
// Assuming ImportedSoundWave is a UE reference to a UImportedSoundWave object
ImportedSoundWave->SetInitialDesiredSampleRate(44100);
ImportedSoundWave->SetInitialDesiredNumOfChannels(2);