Audio services: Difference between revisions

Line 597: Line 597:


== Initialize ==
== Initialize ==
Takes two u32s '''SampleRate''' and '''ChannelCount''' packed as an u64, an u32 '''WorkBufferSize''' and a TransferMemory handle for '''WorkBuffer'''. Returns an [[#IHardwareOpusDecoder]] object. The TransferMemory is created by the user-process with permissions=0.
Takes two s32s '''SampleRate''' and '''ChannelCount''' packed as an u64, an u32 '''WorkBufferSize''' and a TransferMemory handle for '''WorkBuffer'''. Returns an [[#IHardwareOpusDecoder]] object. The TransferMemory is created by the user-process with permissions=0.


== GetWorkBufferSize==
== GetWorkBufferSize==
Takes two u32s '''SampleRate''' and '''ChannelCount''' packed as an u64. Returns the u32 required size for the decoder's work buffer. Official user-processes align the output size to page-alignment.
Takes two s32s '''SampleRate''' and '''ChannelCount''' packed as an u64. Returns the u32 required size for the decoder's work buffer. Official user-processes align the output size to page-alignment.


== OpenHardwareOpusDecoderForMultiStream ==
== OpenHardwareOpusDecoderForMultiStream ==
Line 610: Line 610:
Takes a type-0x19 input buffer. Returns the u32 required size for the decoder's work buffer. Official user-processes align the output size to page-alignment.
Takes a type-0x19 input buffer. Returns the u32 required size for the decoder's work buffer. Official user-processes align the output size to page-alignment.


The input buffer is a 0x110-byte struct. The first 4 u32s are '''SampleRate''', '''ChannelCount''', '''TotalStreamCount''', and '''StereoStreamCount''' while the rest is cleared to zeros.
The input buffer is a 0x110-byte struct. The first 4 s32s are '''SampleRate''', '''ChannelCount''', '''TotalStreamCount''', and '''StereoStreamCount''' while the rest is cleared to zeros.


== IHardwareOpusDecoder ==
== IHardwareOpusDecoder ==