Audio exportieren
Nach dem Import einer Soundwelle möchten Sie diese möglicherweise in den Speicher oder eine Datei exportieren. Das Plugin bietet Funktionen zum Exportieren von Audio in verschiedenen Formaten mit Optionen zum Überschreiben der Abtastrate (Resampling) und der Anzahl der Kanäle (Mixing).
Unterstützte Audioformate
Das Plugin unterstützt den Export in die folgenden Audioformate:
- WAV - Waveform Audio File Format
- OGG VORBIS - Ogg-Container mit Vorbis-Audio
- OGG OPUS - Ogg-Container mit Opus-Audio
- BINK - Bink Audio (nur Windows x64, Mac und Linux in UE >= 5.0)
- RAW (PCM) - Unkomprimierte Pulse-Code-Modulation-Audiodaten (Int8, UInt8, Int16, UInt16, Int32, UInt32, Float32)
Beispiele
- 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
}));