オーディオのエクスポート
サウンド波形をインポートした後、メモリやファイルにエクスポートしたい場合があります。プラグインはさまざまな形式でオーディオをエクスポートする機能を提供しており、サンプルレート(リサンプリング)やチャンネル数(ミキシング)を上書きするオプションもあります。
対応オーディオ形式
プラグインは以下のオーディオ形式へのエクスポートに対応しています:
- WAV - Waveform Audio File Format
- 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)
使用例
- Blueprint
- 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
}));