تصدير الصوت
بعد استيراد موجة صوتية، قد ترغب في تصديرها إلى الذاكرة أو إلى ملف. يوفر البرنامج المساعد وظائف لتصدير الصوت بتنسيقات مختلفة، مع خيارات لتجاوز معدل العينة (إعادة العينة) وعدد القنوات (المزج).
تنسيقات الصوت المدعومة
يدعم البرنامج المساعد التصدير إلى تنسيقات الصوت التالية:
- WAV - تنسيق ملف الصوت Waveform
- OGG VORBIS - حاوية Ogg مع صوت Vorbis
- OGG OPUS - حاوية Ogg مع صوت Opus
- BINK - Bink Audio (Windows x64 و Mac و Linux في UE >= 5.0 فقط)
- RAW (PCM) - بيانات صوت غير مضغوطة بتعديل رمز النبض (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
}));