engine
 
载入中...
搜索中...
未找到
Public 成员函数 | Protected 成员函数 | Protected 属性 | 所有成员列表
IStreamedCompressedInfo类 参考abstract

Default implementation of a streamed compressed audio format. 更多...

#include <AudioDecompress.h>

+ 类 IStreamedCompressedInfo 继承关系图:

Public 成员函数

virtual bool CreateDecoder ()=0
 Create the compression format dependent decoder object.
 
virtual FDecodeResult Decode (const uint8 *CompressedData, const int32 CompressedDataSize, uint8 *OutPCMData, const int32 OutputPCMDataSize)=0
 Decode the input compressed frame data into output PCMData buffer.
 
virtual ENGINE_API void EnableHalfRate (bool HalfRate) override
 Sets decode to half-rate 更多...
 
virtual ENGINE_API void ExpandFile (uint8 *DstBuffer, struct FSoundQualityInfo *QualityInfo) override
 Decompress an entire data file to a TArray
 
virtual int32 GetCurrentChunkIndex () const override
 Gets the chunk index that was last read from (for Streaming Manager requests)
 
virtual int32 GetCurrentChunkOffset () const override
 Gets the offset into the chunk that was last read to (for Streaming Manager priority)
 
virtual int32 GetFrameSize ()=0
 Return the size of the current compression frame
 
virtual uint32 GetMaxFrameSizeSamples () const =0
 The size of the decode PCM buffer size.
 
virtual uint32 GetSourceBufferSize () const override
 Gets the size of the source buffer originally passed to the info class (bytes)
 
virtual int GetStreamBufferSize () const override
 Gets the preferred size for a streaming buffer for this decompression scheme
 
virtual bool ParseHeader (const uint8 *InSrcBufferData, uint32 InSrcBufferDataSize, FSoundQualityInfo *QualityInfo)=0
 Parse the header information from the input source buffer data. 更多...
 
virtual void PrepareToLoop ()
 Optional method to allow decoder to prepare to loop.
 
virtual ENGINE_API bool ReadCompressedData (uint8 *Destination, bool bLooping, uint32 BufferSize) override
 Decompresses data to raw PCM data. 更多...
 
virtual ENGINE_API bool ReadCompressedInfo (const uint8 *InSrcBufferData, uint32 InSrcBufferDataSize, FSoundQualityInfo *QualityInfo) override
 Reads the header information of a compressed format 更多...
 
virtual ENGINE_API void SeekToTime (const float SeekTime) override
 Seeks to time (Some formats might not be seekable)
 
virtual bool StreamCompressedData (uint8 *Destination, bool bLooping, uint32 BufferSize) override
 Decompresses streamed data to raw PCM data. 更多...
 
virtual bool StreamCompressedInfoInternal (USoundWave *Wave, FSoundQualityInfo *QualityInfo) override
 Internal override implemented by subclasses.
 
virtual bool SupportsStreaming () const override
 Whether this decompression class supports streaming decompression
 
virtual bool UsesVorbisChannelOrdering () const override
 Whether the decompressed audio will be arranged using Vorbis' channel ordering See http://www.xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-800004.3.9 for details
 
- Public 成员函数 继承自 ICompressedAudioInfo
virtual ENGINE_API void EnableHalfRate (bool HalfRate)=0
 Sets decode to half-rate 更多...
 
virtual ENGINE_API void ExpandFile (uint8 *DstBuffer, struct FSoundQualityInfo *QualityInfo)=0
 Decompress an entire data file to a TArray
 
virtual int32 GetCurrentChunkIndex () const
 Gets the chunk index that was last read from (for Streaming Manager requests)
 
virtual int32 GetCurrentChunkOffset () const
 Gets the offset into the chunk that was last read to (for Streaming Manager priority)
 
virtual uint32 GetSourceBufferSize () const =0
 Gets the size of the source buffer originally passed to the info class (bytes)
 
virtual int GetStreamBufferSize () const =0
 Gets the preferred size for a streaming buffer for this decompression scheme
 
virtual USoundWave * GetStreamingSoundWave ()
 Return the streaming sound wave used by this decoder. 更多...
 
virtual ENGINE_API bool ReadCompressedData (uint8 *Destination, bool bLooping, uint32 BufferSize)=0
 Decompresses data to raw PCM data. 更多...
 
virtual ENGINE_API bool ReadCompressedInfo (const uint8 *InSrcBufferData, uint32 InSrcBufferDataSize, struct FSoundQualityInfo *QualityInfo)=0
 Reads the header information of a compressed format 更多...
 
virtual bool ReleaseStreamChunk (bool bBlockUntilReleased)
 This can be called to explicitly release this decoder's reference to a chunk of compressed audio without destroying the decoder itself. 更多...
 
virtual void SeekToTime (const float SeekTime)=0
 Seeks to time (Some formats might not be seekable)
 
virtual bool StreamCompressedData (uint8 *Destination, bool bLooping, uint32 BufferSize)
 Decompresses streamed data to raw PCM data. 更多...
 
bool StreamCompressedInfo (USoundWave *Wave, struct FSoundQualityInfo *QualityInfo)
 Streams the header information of a compressed format 更多...
 
virtual bool SupportsStreaming () const
 Whether this decompression class supports streaming decompression
 
virtual bool UsesVorbisChannelOrdering () const =0
 Whether the decompressed audio will be arranged using Vorbis' channel ordering See http://www.xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-800004.3.9 for details
 
virtual ~ICompressedAudioInfo ()
 Virtual destructor.
 

Protected 成员函数

int32 DecompressToPCMBuffer (uint16 FrameSize)
 Decompresses a frame of data to PCM buffer 更多...
 
const uint8 * GetLoadedChunk (USoundWave *InSoundWave, uint32 ChunkIndex, uint32 &OutChunkSize)
 Helper function for getting a chunk of compressed audio. 更多...
 
uint32 IncrementCurrentSampleCount (uint32 NewSamples)
 Adds to the count of samples that have currently been decoded 更多...
 
uint32 Read (void *Outbuffer, uint32 DataSize)
 Reads from the internal source audio buffer stream of the given data size.
 
uint32 WriteFromDecodedPCM (uint8 *Destination, uint32 BufferSize)
 Writes data from decoded PCM buffer, taking into account whether some PCM has been written before 更多...
 
uint32 ZeroBuffer (uint8 *Destination, uint32 BufferSize)
 Zeroes the contents of a buffer 更多...
 
virtual bool StreamCompressedInfoInternal (USoundWave *Wave, struct FSoundQualityInfo *QualityInfo)=0
 Internal override implemented by subclasses.
 

Protected 属性

uint32 AudioDataChunkIndex
 The chunk index where the actual audio data starts.
 
uint32 AudioDataOffset
 Where the actual audio data starts in the current streamed chunk. 更多...
 
bool bIsStreaming
 bool set before ParseHeader. 更多...
 
bool bPrintChunkFailMessage
 Whether or not to print the chunk fail message.
 
bool bStoringEndOfFile
 If we're currently reading the final buffer.
 
FAudioChunkHandle CurCompressedChunkHandle
 Chunk Handle to ensure that this chunk of streamed audio is not deleted while we are using it.
 
int32 CurrentChunkIndex
 The current chunk index in the streamed chunks.
 
uint32 CurrentSampleCount
 How many samples we've currently read in the source file.
 
TArray< uint8 > LastDecodedPCM
 The decoded PCM byte array from the last decoded frame.
 
uint32 LastPCMByteSize
 The amount of PCM data in bytes was decoded last.
 
uint32 LastPCMOffset
 The current offset in the last decoded PCM buffer.
 
uint32 MaxFrameSizeSamples
 The maximum number of samples per decode frame.
 
uint8 NumChannels
 Number of channels (left/right) in the source file.
 
uint16 SampleRate
 Sample rate of the source file
 
uint32 SampleStride
 The number of bytes per interleaved sample (NumChannels * sizeof(int16)).
 
const uint8 * SrcBufferData
 Ptr to the current streamed chunk.
 
uint32 SrcBufferDataSize
 Size of the current streamed chunk.
 
uint32 SrcBufferOffset
 What byte we're currently reading in the streamed chunk.
 
uint32 SrcBufferPadding
 Number of bytes of padding used, overridden in some implementations. 更多...
 
uint32 TrueSampleCount
 The total sample count of the source file.
 

详细描述

Default implementation of a streamed compressed audio format.

Can be subclassed to support streaming of a specific asset format. Handles all the platform independent aspects of file format streaming for you (dealing with UE4 streamed assets)

成员函数说明

◆ DecompressToPCMBuffer()

int32 IStreamedCompressedInfo::DecompressToPCMBuffer ( uint16  FrameSize)
protected

Decompresses a frame of data to PCM buffer

参数
FrameSizeSize of the frame in bytes
返回
The amount of samples that were decompressed (< 0 indicates error)

◆ EnableHalfRate()

virtual ENGINE_API void IStreamedCompressedInfo::EnableHalfRate ( bool  HalfRate)
inlineoverridevirtual

Sets decode to half-rate

参数
HalfRateWhether Half rate is enabled

实现了 ICompressedAudioInfo.

◆ GetLoadedChunk()

const uint8 * IStreamedCompressedInfo::GetLoadedChunk ( USoundWave *  InSoundWave,
uint32  ChunkIndex,
uint32 &  OutChunkSize 
)
protected

Helper function for getting a chunk of compressed audio.

参数
InSoundWavePointer to the soundwave to get compressed audio from.
ChunkIndexthe index of the chunk to get from InSoundWave.
[out]OutChunkSizethe size of the chunk.
返回
a pointer to the chunk if it's loaded, nullptr otherwise.

◆ IncrementCurrentSampleCount()

uint32 IStreamedCompressedInfo::IncrementCurrentSampleCount ( uint32  NewSamples)
protected

Adds to the count of samples that have currently been decoded

参数
NewSamplesHow many samples have been decoded
返回
How many samples were actually part of the true sample count

◆ ParseHeader()

virtual bool IStreamedCompressedInfo::ParseHeader ( const uint8 *  InSrcBufferData,
uint32  InSrcBufferDataSize,
FSoundQualityInfo *  QualityInfo 
)
pure virtual

Parse the header information from the input source buffer data.

This is dependent on compression format.

在 FOpusAudioInfo 内被实现.

◆ ReadCompressedData()

virtual ENGINE_API bool IStreamedCompressedInfo::ReadCompressedData ( uint8 *  Destination,
bool  bLooping,
uint32  BufferSize 
)
overridevirtual

Decompresses data to raw PCM data.

参数
Destinationwhere to place the decompressed sound
bLoopingwhether to loop the sound by seeking to the start, or pad the buffer with zeroes
BufferSizenumber of bytes of PCM data to create
返回
bool true if the end of the data was reached (for both single shot and looping sounds)

实现了 ICompressedAudioInfo.

◆ ReadCompressedInfo()

virtual ENGINE_API bool IStreamedCompressedInfo::ReadCompressedInfo ( const uint8 *  InSrcBufferData,
uint32  InSrcBufferDataSize,
FSoundQualityInfo *  QualityInfo 
)
overridevirtual

Reads the header information of a compressed format

参数
InSrcBufferDataSource compressed data
InSrcBufferDataSizeSize of compressed data
QualityInfoQuality Info (to be filled out). This can be null in the case of most implementations of FSoundBuffer::ReadCompressedInfo

实现了 ICompressedAudioInfo.

◆ StreamCompressedData()

virtual bool IStreamedCompressedInfo::StreamCompressedData ( uint8 *  Destination,
bool  bLooping,
uint32  BufferSize 
)
overridevirtual

Decompresses streamed data to raw PCM data.

参数
Destinationwhere to place the decompressed sound
bLoopingwhether to loop the sound by seeking to the start, or pad the buffer with zeroes
BufferSizenumber of bytes of PCM data to create
返回
bool true if the end of the data was reached (for both single shot and looping sounds)

重载 ICompressedAudioInfo .

◆ WriteFromDecodedPCM()

uint32 IStreamedCompressedInfo::WriteFromDecodedPCM ( uint8 *  Destination,
uint32  BufferSize 
)
protected

Writes data from decoded PCM buffer, taking into account whether some PCM has been written before

参数
DestinationWhere to place the decoded sound
BufferSizeSize of the destination buffer in bytes
返回
How many bytes were written

◆ ZeroBuffer()

uint32 IStreamedCompressedInfo::ZeroBuffer ( uint8 *  Destination,
uint32  BufferSize 
)
protected

Zeroes the contents of a buffer

参数
DestinationBuffer to zero
BufferSizeSize of the destination buffer in bytes
返回
How many bytes were zeroed

类成员变量说明

◆ AudioDataOffset

uint32 IStreamedCompressedInfo::AudioDataOffset
protected

Where the actual audio data starts in the current streamed chunk.

Accounts for header offset.

◆ bIsStreaming

bool IStreamedCompressedInfo::bIsStreaming
protected

bool set before ParseHeader.

Whether we are streaming a file or not.

◆ SrcBufferPadding

uint32 IStreamedCompressedInfo::SrcBufferPadding
protected

Number of bytes of padding used, overridden in some implementations.

Defaults to 0.


该类的文档由以下文件生成: