음파 속성
사운드 웨이브의 전체 PCM 버퍼를 직접 가져올 수 있습니다.
- Blueprint
- C++
// Assuming ImportedSoundWave is a UE reference to a UImportedSoundWave object
TArray<float> PCMBuffer = ImportedSoundWave->GetPCMBufferCopy();
획득한 PCM 데이터를 바이트로 변환해야 하는 경우 여기를 참조하세요.
끊김 없는 오디오 루프를 생성하려면 루프 설정을 활성화하여 사운드 웨이브의 재생 시간이 자동으로 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과 같이 설정할 수 있으며, 이를 사용하면 소리 파형이 무음 상태에서도 계속 재생됩니다. 이는 사운드 감쇠(sound attenuation)를 사용하는 경우 특히 유용합니다.
- 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);