• Home
  • Install
  • Cosmos Website
  • Articles
  • Cosmos
  • X#
  • IL2CPU
Show / Hide Table of Contents
  • Cosmos.Core
    • ACPI
    • ACPI.RSDPtr
    • Bootstrap
    • CPU
    • GCImplementation
    • GCTable
    • Global
    • INTs
    • INTs.EFlagsEnum
    • INTs.ExceptionInterruptDelegate
    • INTs.IRQContext
    • INTs.IRQDelegate
    • INTs.MMXContext
    • INTs.TSS
    • IOPort
    • KernelPanics
    • ManagedMemoryBlock
    • MemoryBlock
    • MemoryBlock08
    • MemoryBlock16
    • MemoryBlock32
    • MemoryMapBlock
    • MemoryOperations
    • PIC
    • PIC.Cmd
    • RawMemoryMapBlock
    • VTable
    • VTablesImpl
  • Cosmos.Core.IOGroup
    • ATA
    • PIC
    • PS2Controller
  • Cosmos.Core.Memory
    • Heap
    • HeapLarge
    • HeapMedium
    • HeapSmall
    • ObjectGCStatus
    • RAT
    • RAT.PageType
    • RootSMTBlock
    • SMTBlock
    • SMTPage
  • Cosmos.Core.MemoryGroup
    • AHCI
  • Cosmos.Core.Multiboot
    • Multiboot2
  • Cosmos.Core.Multiboot.Tags
    • AcpiNew
    • AcpiOld
    • BasicMemoryInformation
    • EFI64
    • Framebuffer
    • MB2Tag
    • MemoryMap
  • Cosmos.Core_Asm
    • ArrayClearAsm
    • ArrayGetLengthAsm
    • ArrayImpl
    • ArrayInternalCopyAsm
    • BufferBlockCopyAsm
    • BufferImpl
    • CPUCanReadCPUIDAsm
    • CPUDisableINTsAsm
    • CPUEnableINTsAsm
    • CPUGetEBPValue
    • CPUGetEndOfKernelAsm
    • CPUGetESPValue
    • CPUGetStackStart
    • CPUHaltAsm
    • CPUImpl
    • CPUInitFloatAsm
    • CPUInitSSEAsm
    • CPUReadCPUIDAsm
    • CPUReadModelSpecificRegisterAsm
    • CPUReadTimestampCounterAsm
    • CPUSetESPValue
    • CPUUpdateIDTAsm
    • CPUZeroFillAsm
    • DelegateCtorAsm
    • DelegateGetMulticastInvokeAsm
    • DelegateImpl
    • DelegateInvokeAsm
    • GCImplementationImpl
    • IOPortImpl
    • Multiboot2Impl
    • Multiboot2ImplAsm
    • RuntimeHelpersImpl
  • Cosmos.Core_Asm.MemoryOperations
    • MemoryOperationsCopy128BlocksAsm
    • MemoryOperationsCopy128BytesAsm
    • MemoryOperationsCopy16BytesAsm
    • MemoryOperationsCopy32BytesAsm
    • MemoryOperationsCopy64BytesAsm
    • MemoryOperationsFill16BlocksAsm
  • Cosmos.Debug.Kernel
    • Debugger
    • DebuggerFactory
  • Cosmos.HAL
    • BaudRate
    • Bootstrap
    • CardType
    • ClassID
    • COMPort
    • DataReceivedHandler
    • Device
    • DeviceID
    • Global
    • KeyboardBase
    • KeyboardBase.KeyPressedEventHandler
    • MouseBase
    • MouseBase.MouseChangedEventHandler
    • NetworkDevice
    • PCI
    • PCIBaseAddressBar
    • PCIDevice
    • PCIDevice.Config
    • PCIDevice.DeviceClass
    • PCIDevice.PCIBist
    • PCIDevice.PCICommand
    • PCIDevice.PCIHeaderType
    • PCIDevice.PCIInterruptPIN
    • PCIDeviceBridge
    • PCIDeviceCardbus
    • PCIDeviceNormal
    • PCSpeaker
    • PIT
    • PIT.PITTimer
    • PIT.PITTimer.OnTrigger
    • Power
    • ProgramIF
    • PS2Controller
    • PS2Keyboard
    • PS2Mouse
    • RTC
    • SerialPort
    • SpeakerExtensions
    • SubclassID
    • TextScreen
    • TextScreenBase
    • TextScreenHelpers
    • VendorID
  • Cosmos.HAL.Audio
    • AudioBitDepth
    • AudioBuffer
    • IAudioBufferProvider
    • SampleFormat
  • Cosmos.HAL.BlockDevice
    • AHCI
    • Ata
    • Ata.BusPositionEnum
    • Ata.ControllerIdEnum
    • ATA_PIO
    • ATA_PIO.Cmd
    • ATA_PIO.DvcSelVal
    • ATA_PIO.Ident
    • ATA_PIO.SpecLevel
    • ATA_PIO.Status
    • ATAPI
    • ATAPI.PacketCommands
    • BlockDevice
    • BlockDeviceType
    • EBR
    • EBR.PartInfo
    • GPT
    • GPT.GPartInfo
    • IDE
    • MBR
    • MBR.PartInfo
    • Partition
  • Cosmos.HAL.BlockDevice.Ports
    • SATA
    • SATAPI
    • StoragePort
  • Cosmos.HAL.BlockDevice.Registers
    • AHCISignature
    • ATACommands
    • ATADeviceStatus
    • Base
    • Bases
    • CommandAndStatus
    • CurrentInterfaceSpeedStatus
    • DeviceDetectionStatus
    • FISRegisterD2H
    • FISRegisterH2D
    • FISSize
    • FISType
    • GenericRegisters
    • HBACommandHeader
    • HBACommandTable
    • HBAPRDTEntry
    • InterfacePowerManagementStatus
    • InterruptEnable
    • InterruptStatus
    • PortRegisters
    • PortType
  • Cosmos.HAL.Drivers.Audio
    • AC97
    • AudioDriver
  • Cosmos.HAL.Drivers.Network
    • AMDPCNetII
    • E1000
    • E1000.RXDesc
    • E1000.TXDesc
    • E1000DeviceID
    • RTL8139
  • Cosmos.HAL.Drivers.USB
    • USBHost
  • Cosmos.HAL.Drivers.Video
    • VBEDriver
    • VGADriver
    • VGADriver.ColorDepth
    • VGADriver.ScreenSize
    • VGADriver.TextSize
  • Cosmos.HAL.Drivers.Video.SVGAII
    • Capability
    • FIFO
    • FIFOCommand
    • ID
    • IOPortOffset
    • Register
    • VMWareSVGAII
  • Cosmos.HAL.Network
    • MACAddress
    • NetworkInit
  • Cosmos.System
    • Console
    • ConsoleKeyEx
    • ConsoleKeyExExtensions
    • Durations
    • Global
    • Kernel
    • KeyboardManager
    • KeyEvent
    • KeyEvent.KeyEventType
    • KeyMapping
    • MouseManager
    • MouseState
    • Notes
    • PCSExtensions
    • PCSpeaker
    • Power
    • ScanMapBase
    • VMTools
  • Cosmos.System.Audio
    • AudioManager
    • AudioMixer
    • AudioStream
  • Cosmos.System.Audio.DSP.Processing
    • AudioPostProcessor
    • GainPostProcessor
  • Cosmos.System.Audio.IO
    • AudioBufferReader
    • AudioBufferReadWriteBase
    • AudioBufferWriter
    • MemoryAudioStream
    • SeekableAudioStream
  • Cosmos.System.ExtendedASCII
    • CosmosEncodingProvider
  • Cosmos.System.FileSystem
    • CosmosVFS
    • Disk
    • FileSystem
    • FileSystemFactory
    • ManagedPartition
  • Cosmos.System.FileSystem.FAT
    • FatFileSystemFactory
  • Cosmos.System.FileSystem.FAT.Listing
    • FatDirectoryEntryAttributeConsts
    • FatDirectoryEntryMetadata
    • FatDirectoryEntryMetadata.LongFilenameEntryMetadata
  • Cosmos.System.FileSystem.ISO9660
    • ISO9660FileSystem
    • ISO9660FileSystemFactory
  • Cosmos.System.FileSystem.Listing
    • DirectoryEntry
    • DirectoryEntryTypeEnum
  • Cosmos.System.FileSystem.VFS
    • FileSystemManager
    • VFSBase
    • VFSManager
  • Cosmos.System.Graphics
    • Bitmap
    • Canvas
    • ColorDepth
    • ColorOrder
    • FullScreenCanvas
    • Image
    • ImageFormat
    • Mode
    • SVGAIICanvas
    • VBECanvas
    • VGACanvas
    • VGAScreen
  • Cosmos.System.Graphics.Fonts
    • Font
    • PCScreenFont
    • UnicodeMapping
  • Cosmos.System.Helpers
    • ArrayHelper
  • Cosmos.System.IO
    • ConsoleStream
    • SyncTextReader
  • Cosmos.System.Keyboard
    • KeyEventHelper
  • Cosmos.System.Network
    • EthernetPacket
    • NetworkDebugger
    • NetworkStack
  • Cosmos.System.Network.ARP
    • ARPPacket
  • Cosmos.System.Network.Config
    • DNSConfig
    • IPConfig
    • NetworkConfig
    • NetworkConfiguration
  • Cosmos.System.Network.IPv4
    • Address
    • EndPoint
    • ICMPClient
    • ICMPPacket
    • IPPacket
    • OutgoingBuffer
  • Cosmos.System.Network.IPv4.TCP
    • Flags
    • Status
    • Tcp
    • TCPOption
    • TCPPacket
    • TransmissionControlBlock
  • Cosmos.System.Network.IPv4.UDP
    • UdpClient
    • UDPPacket
  • Cosmos.System.Network.IPv4.UDP.DHCP
    • DHCPClient
    • DHCPOption
    • DHCPPacket
  • Cosmos.System.Network.IPv4.UDP.DNS
    • DNSAnswer
    • DnsClient
    • DNSPacket
    • DNSPacketAnswer
    • DNSPacketAsk
    • DNSQuery
    • ReplyCode
  • Cosmos.System.ScanMaps
    • DEStandardLayout
    • ESStandardLayout
    • FRStandardLayout
    • GBStandardLayout
    • TRStandardLayout
    • US_Dvorak
    • USStandardLayout

Class AudioBufferReadWriteBase

Represents the base class for AudioBufferReader and AudioBufferWriter instances.

Inheritance
System.Object
AudioBufferReadWriteBase
AudioBufferReader
AudioBufferWriter
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Cosmos.System.Audio.IO
Assembly: Cosmos.System2.dll
Syntax
public abstract class AudioBufferReadWriteBase

Fields

| Improve this Doc View Source

target

The audio buffer this reader/writer is working on.

Declaration
protected AudioBuffer target
Field Value
Type Description
AudioBuffer

Methods

| Improve this Doc View Source

ChangeBitDepth(Byte*, AudioBitDepth, Byte, Byte*)

Converts 8-bit samples to the the specified format, using the specified buffer. If target is equal to Bits8, no action is performed.

Declaration
protected static void ChangeBitDepth(byte *outputPtr, AudioBitDepth target, byte channels, byte *inputPtr)
Parameters
Type Name Description
System.Byte* outputPtr
AudioBitDepth target
System.Byte channels
System.Byte* inputPtr
| Improve this Doc View Source

ChangeBitDepth(Byte*, AudioBitDepth, Byte, Int16*)

Converts 16-bit samples to the specified format, using the specified buffer. If target is equal to Bits16, no action is performed.

Declaration
protected static void ChangeBitDepth(byte *outputPtr, AudioBitDepth target, byte channels, short *inputPtr)
Parameters
Type Name Description
System.Byte* outputPtr
AudioBitDepth target
System.Byte channels
System.Int16* inputPtr
| Improve this Doc View Source

ChangeBitDepth(Byte*, AudioBitDepth, Byte, Int32*)

Converts 32-bit samples to the specified format, using the specified buffer. If target is equal to Bits32, no action is performed.

Declaration
protected static void ChangeBitDepth(byte *outputPtr, AudioBitDepth target, byte channels, int *inputPtr)
Parameters
Type Name Description
System.Byte* outputPtr
AudioBitDepth target
System.Byte channels
System.Int32* inputPtr
| Improve this Doc View Source

ChangeBitDepth(Byte*, Byte, AudioBitDepth, AudioBitDepth)

Converts the specified samples to the specified target format. The specified buffer pointer must be large enough to hold both the input samples, and the converted output samples.

Declaration
protected static void ChangeBitDepth(byte *bufferPtr, byte channels, AudioBitDepth inputBitDepth, AudioBitDepth outputBitDepth)
Parameters
Type Name Description
System.Byte* bufferPtr
System.Byte channels
AudioBitDepth inputBitDepth
AudioBitDepth outputBitDepth
| Improve this Doc View Source

ChangeBitDepth24(Byte*, AudioBitDepth, Byte, Int32*)

Converts 24-bit samples to the specified format, using the specified buffer. Each langword_csharp_int in the specified buffer will be interpreted as 24-bit values, and any extra bits will be ignored. If target is equal to Bits24, no action is performed.

Declaration
protected static void ChangeBitDepth24(byte *outputPtr, AudioBitDepth target, byte channels, int *inputPtr)
Parameters
Type Name Description
System.Byte* outputPtr
AudioBitDepth target
System.Byte channels
System.Int32* inputPtr
| Improve this Doc View Source

MakeSigned(Byte*, AudioBitDepth, Byte)

Makes a single unsigned audio sample signed.

Declaration
protected static void MakeSigned(byte *sourcePtr, AudioBitDepth bitDepth, byte channels)
Parameters
Type Name Description
System.Byte* sourcePtr

The pointer to the target sample.

AudioBitDepth bitDepth
System.Byte channels
| Improve this Doc View Source

MakeSigned(Byte*, SampleFormat)

Declaration
protected static void MakeSigned(byte *sourcePtr, SampleFormat format)
Parameters
Type Name Description
System.Byte* sourcePtr
SampleFormat format
| Improve this Doc View Source

MakeUnsigned(Byte*, AudioBitDepth, Byte)

Makes a single signed audio sample unsigned.

Declaration
protected static void MakeUnsigned(byte *sourcePtr, AudioBitDepth bitDepth, byte channels)
Parameters
Type Name Description
System.Byte* sourcePtr

The pointer to the target sample.

AudioBitDepth bitDepth
System.Byte channels
| Improve this Doc View Source

MakeUnsigned(Byte*, SampleFormat)

Declaration
protected static void MakeUnsigned(byte *sourcePtr, SampleFormat format)
Parameters
Type Name Description
System.Byte* sourcePtr
SampleFormat format
| Improve this Doc View Source

ToInt24(Byte*, Int32)

Returns a 24-bit signed integer converted from three bytes at a specified position in a byte array pointer.

Declaration
protected static int ToInt24(byte *arrayPtr, int startIndex)
Parameters
Type Name Description
System.Byte* arrayPtr

A pointer to an array of bytes that includes the three bytes to convert.

System.Int32 startIndex

The starting position within arrayPtr.

Returns
Type Description
System.Int32

A 32-bit signed integer formed by three bytes beginning at startIndex.

| Improve this Doc View Source

UpmixChannels(Byte[], Byte, Byte, SampleFormat)

Up-mixes an audio sample by duplicating channels.

Declaration
protected static void UpmixChannels(byte[] buffer, byte srcChannels, byte destChannels, SampleFormat format)
Parameters
Type Name Description
System.Byte[] buffer

The target buffer.

System.Byte srcChannels

The amount of channels available in the buffer.

System.Byte destChannels

The destination amount of channels.

SampleFormat format

The format of the samples.

| Improve this Doc View Source

WriteInt24ToBuffer(Byte*, Int32, Int32)

Directly writes a 24-bit integer value to a buffer. Only the first 3 bytes of the provided System.Int32 are used.

Declaration
protected static void WriteInt24ToBuffer(byte *bufferPtr, int offset, int i24)
Parameters
Type Name Description
System.Byte* bufferPtr

The pointer to the target buffer.

System.Int32 offset

The location in the provided buffer the integer should be written to.

System.Int32 i24

The target 24-bit integer to write. The last byte is ignored.

  • Improve this Doc
  • View Source
☀
☾
In This Article
Back to top
☀
☾