Navigation
API > API/Runtime > API/Runtime/Engine
FSoundWavePCMWriter This class can be used to save a TSampleBuffer to either a wav file or a USoundWave using BeginGeneratingSoundWaveFromBuffer, BeginWriteToSoundWave, or BeginWriteToWavFile on the game thread. This class uses an async task to generate and write the file to disk.
| Name | FSoundWavePCMWriter |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Classes/Sound/SampleBufferIO.h |
| Include Path | #include "Sound/SampleBufferIO.h" |
Syntax
class FSoundWavePCMWriter
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FSoundWavePCMWriter
(
int32 InChunkSize |
Sound/SampleBufferIO.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FSoundWavePCMWriter() |
Sound/SampleBufferIO.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AbsoluteFilePath | FString | Current Absolute File Path we are writing to. | Sound/SampleBufferIO.h | |
| bWasPreviouslyAddedToRoot | bool | Sound/SampleBufferIO.h | ||
| ChunkSize | int32 | Sound/SampleBufferIO.h | ||
| CurrentBuffer | TSampleBuffer | Current pending buffer. | Sound/SampleBufferIO.h | |
| CurrentOperation | TUniquePtr< FAsyncSoundWavePCMWriterTask > | Sound/SampleBufferIO.h | ||
| CurrentPackage | UPackage * | Sound/SampleBufferIO.h | ||
| CurrentSoundWave | USoundWave * | Sound wave currently being written to. | Sound/SampleBufferIO.h | |
| CurrentState | ESoundWavePCMWriterState | Current state of the buffer. | Sound/SampleBufferIO.h | |
| Progress | FThreadSafeCounter | Internal progress. | Sound/SampleBufferIO.h | |
| SerializedWavData | TArray< uint8 > | Internal buffer for holding the serialized wav file in memory. | Sound/SampleBufferIO.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool BeginGeneratingSoundWaveFromBuffer
(
const TSampleBuffer<>& InSampleBuffer, |
This kicks off an operation to write InSampleBuffer to SoundWaveToSaveTo. | Sound/SampleBufferIO.h | |
bool BeginWriteToSoundWave
(
const FString& FileName, |
This kicks off an operation to write InSampleBuffer to a USoundWave asset at the specified file path relative to the project directory. | Sound/SampleBufferIO.h | |
bool BeginWriteToWavFile
(
const TSampleBuffer<>& InSampleBuffer, |
This writes out the InSampleBuffer as a wav file at the path specified by FilePath and FileName. | Sound/SampleBufferIO.h | |
void CancelWrite() |
Aborts the current write operation. | Sound/SampleBufferIO.h | |
float CheckStatus
(
ESoundWavePCMWriterState* OutCurrentState |
Call this on the game thread to continue the write operation. | Sound/SampleBufferIO.h | |
USoundWave * GetFinishedSoundWave() |
Used to grab the a handle to the soundwave. | Sound/SampleBufferIO.h | |
bool IsDone() |
Whether we have finished the write operation, by either succeeding, failing, or being cancelled. | Sound/SampleBufferIO.h | |
void Reset() |
Clean up all resources used. | Sound/SampleBufferIO.h | |
void SaveFinishedSoundWaveToPath
(
const FString& FileName, |
This function can be used after generating a USoundWave by calling BeginGeneratingSoundWaveFromBuffer to save the generated soundwave to an asset. | Sound/SampleBufferIO.h | |
USoundWave * SynchronouslyWriteSoundWave
(
const TSampleBuffer<>& InSampleBuffer, |
This is a blocking call that will return the SoundWave generated from InSampleBuffer. | Sound/SampleBufferIO.h | |
bool SynchronouslyWriteToWavFile
(
const TSampleBuffer<>& InSampleBuffer, |
This blocking call writes out the InSampleBuffer as a wav file at the path specified by FilePath and FileName. | Sound/SampleBufferIO.h |