# clamp16
function clamp16(value)Clamps 16 for `miniquake.sound.snd_mix`.
| Parameter | Type | Default | Description |
|---|---|---|---|
value | dynamic | — | Value consumed by `clamp16`. |
src/miniquake/sound/snd_mix.mlminiquake/array_util.ml as arrays → src/miniquake/array_util.mlminiquake/byteio.ml as bio → src/miniquake/byteio.mlminiquake/native.ml as native → src/miniquake/native.mlminiquake/sound/snd_mem.ml as sndmem → src/miniquake/sound/snd_mem.mlminiquake/types.ml as t → src/miniquake/types.mlfunction clamp16(value)Clamps 16 for `miniquake.sound.snd_mix`.
| Parameter | Type | Default | Description |
|---|---|---|---|
value | dynamic | — | Value consumed by `clamp16`. |
function clearPaintBuffer(state, frameCount)Update module state for paint buffer.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.sound.snd_mix` state used by `clearPaintBuffer`. |
frameCount | dynamic | — | Number of entries or units to process. |
function createChannel()Create and initialize channel.
function createDma(speed, sampleBits, channels, samples)Create and initialize dma.
| Parameter | Type | Default | Description |
|---|---|---|---|
speed | dynamic | — | The speed input consumed by `createDma`. |
sampleBits | dynamic | — | The sample bits input consumed by `createDma`. |
channels | dynamic | — | Number of interleaved audio channels. |
samples | dynamic | — | The samples input consumed by `createDma`. |
function createState(dma)Creates state for `miniquake.sound.snd_mix`.
| Parameter | Type | Default | Description |
|---|---|---|---|
dma | dynamic | — | The dma input consumed by `createState`. |
miniquake.sound.snd_mix.DmaSoundBuffer struct
const MAX_CHANNELS = 128Defines the max channels value used by `miniquake.sound.snd_mix`.
miniquake.sound.snd_mix.MixState struct
const PAINTBUFFER_SIZE = 512Defines the paintbuffer size value used by `miniquake.sound.snd_mix`.
function resetChannel(channel)Update module state for channel.
| Parameter | Type | Default | Description |
|---|---|---|---|
channel | dynamic | — | The channel input consumed by `resetChannel`. |
function S_PaintChannels(state, endTime)Apply the Quake-compatible s paint channels behavior.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.sound.snd_mix` state used by `S_PaintChannels`. |
endTime | dynamic | — | Time value used by the operation. |
function S_TransferPaintBuffer(state, endTime)Apply the Quake-compatible s transfer paint buffer behavior.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.sound.snd_mix` state used by `S_TransferPaintBuffer`. |
endTime | dynamic | — | Time value used by the operation. |
function S_TransferStereo16(state, endTime)Apply the Quake-compatible s transfer stereo16 behavior.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.sound.snd_mix` state used by `S_TransferStereo16`. |
endTime | dynamic | — | Time value used by the operation. |
function signedByte(value)Return signed byte derived from the active module state.
| Parameter | Type | Default | Description |
|---|---|---|---|
value | dynamic | — | Value consumed by `signedByte`. |
function SND_InitScaletable(state)Mirror Quake's SND_InitScaletable routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.sound.snd_mix` state used by `SND_InitScaletable`. |
function SND_PaintChannelFrom16(state, channel, cache, count)Mirror Quake's SND_PaintChannelFrom16 routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.sound.snd_mix` state used by `SND_PaintChannelFrom16`. |
channel | dynamic | — | The channel input consumed by `SND_PaintChannelFrom16`. |
cache | dynamic | — | The cache input consumed by `SND_PaintChannelFrom16`. |
count | dynamic | — | Number of entries or units to process. |
function SND_PaintChannelFrom8(state, channel, cache, count)Mirror Quake's SND_PaintChannelFrom8 routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.sound.snd_mix` state used by `SND_PaintChannelFrom8`. |
channel | dynamic | — | The channel input consumed by `SND_PaintChannelFrom8`. |
cache | dynamic | — | The cache input consumed by `SND_PaintChannelFrom8`. |
count | dynamic | — | Number of entries or units to process. |
function Snd_WriteLinearBlastStereo16(state)Mirror Quake's Snd_WriteLinearBlastStereo16 routine and its observable state changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
state | dynamic | — | Mutable `miniquake.sound.snd_mix` state used by `Snd_WriteLinearBlastStereo16`. |
miniquake.sound.snd_mix.SoundChannel struct
function soundI32(value)Implements the `soundI32` operation for `miniquake.sound.snd_mix` (sound i32).
| Parameter | Type | Default | Description |
|---|---|---|---|
value | dynamic | — | Value consumed by `soundI32`. |