오디오 내보내기
소리 파형을 가져온 후, 이를 메모리 또는 파일로 내보내고 싶을 수 있습니다. 이 플러그인은 다양한 형식으로 오디오를 내보내는 기능을 제공하며, 샘플 속도(리샘플링) 및 채널 수(믹싱)를 변경할 수 있는 옵션도 지원합니다.
지원되는 오디오 형식
이 플러그인은 다음 오디오 형식으로 내보내기를 지원합니다:
- WAV - Waveform 오디오 파일 형식
- OGG VORBIS - Ogg 컨테이너 내 Vorbis 오디오
- OGG OPUS - Ogg 컨테이너 내 Opus 오디오
- BINK - Bink Audio (Windows x64, Mac, Linux에서 UE 5.0 이상에서만 사용 가능)
- RAW (PCM) - 비압축 Pulse-Code Modulation 오디오 데이터 (Int8, UInt8, Int16, UInt16, Int32, UInt32, Float32)
예제
- 블루프린트
- C++
// Assuming ImportedSoundWave is a UE reference to a UImportedSoundWave object (or its derived type, such as UStreamingSoundWave, UCapturableSoundWave, etc.)
// Export the sound wave to a file
URuntimeAudioExporter::ExportSoundWaveToFile(ImportedSoundWave, TEXT("C:/ExportedAudio.ogg"), ERuntimeAudioFormat::OggVorbis, 100,
FRuntimeAudioExportOverrideOptions(),
FOnAudioExportToFileResultNative::CreateWeakLambda(this, [this](bool bSucceeded)
{
// Handle the result
}));
// Export the sound wave to a RAW file
URuntimeAudioExporter::ExportSoundWaveToRAWFile(ImportedSoundWave, TEXT("C:/ExportedAudio.raw"), ERuntimeRAWAudioFormat::UInt16,
FRuntimeAudioExportOverrideOptions(),
FOnAudioExportToFileResultNative::CreateWeakLambda(this, [this](bool bSucceeded)
{
// Handle the result
}));
// Export the sound wave to a buffer
URuntimeAudioExporter::ExportSoundWaveToBuffer(ImportedSoundWave, ERuntimeAudioFormat::Wav, 100,
FRuntimeAudioExportOverrideOptions(),
FOnAudioExportToBufferResultNative::CreateWeakLambda(this, [this](bool bSucceeded, const TArray64<uint8>& AudioData)
{
// Handle the result
}));
// Export the sound wave to a RAW buffer
URuntimeAudioExporter::ExportSoundWaveToRAWBuffer(ImportedSoundWave, ERuntimeRAWAudioFormat::Float32,
FRuntimeAudioExportOverrideOptions(),
FOnAudioExportToBufferResultNative::CreateWeakLambda(this, [this](bool bSucceeded, const TArray64<uint8>& AudioData)
{
// Handle the result
}));