Exporter l'audio
Après avoir importé une onde sonore, vous pouvez souhaiter l'exporter en mémoire ou vers un fichier. Le plugin fournit des fonctionnalités pour exporter l'audio dans différents formats, avec des options pour remplacer la fréquence d'échantillonnage (rééchantillonnage) et le nombre de canaux (mixage).
Formats audio pris en charge
Le plugin prend en charge l'export vers les formats audio suivants :
- WAV - Waveform Audio File Format
- OGG VORBIS - Conteneur Ogg avec audio Vorbis
- OGG OPUS - Conteneur Ogg avec audio Opus
- BINK - Bink Audio (Windows x64, Mac et Linux uniquement dans UE >= 5.0)
- RAW (PCM) - Données audio non compressées en Pulse-Code Modulation (Int8, UInt8, Int16, UInt16, Int32, UInt32, Float32)
Exemples
- 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
}));