Win32 API 日本語リファレンス
ホームMedia.Audio.XAudio2 › XAUDIO2FX_REVERB_I3DL2_PARAMETERS

XAUDIO2FX_REVERB_I3DL2_PARAMETERS

構造体
サイズx64: 52 バイト / x86: 52 バイトパッキング1

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
WetDryMixFLOAT4+0+0原音と残響音の混合比をパーセントで示す。
RoomINT4+4+4全周波数の残響音レベルをミリベルで示す。
RoomHFINT4+8+8高域の残響音レベルをミリベルで示す。
RoomRolloffFactorFLOAT4+12+12距離による残響音の減衰係数を示す。
DecayTimeFLOAT4+16+16残響の減衰時間を秒で示す。
DecayHFRatioFLOAT4+20+20高域減衰時間と全域減衰時間の比を示す。
ReflectionsINT4+24+24初期反射音のレベルをミリベルで示す。
ReflectionsDelayFLOAT4+28+28初期反射音の遅延時間を秒で示す。
ReverbINT4+32+32後期残響音のレベルをミリベルで示す。
ReverbDelayFLOAT4+36+36後期残響音の遅延時間を秒で示す。
DiffusionFLOAT4+40+40残響の拡散度をパーセントで示す。
DensityFLOAT4+44+44残響の密度をパーセントで示す。
HFReferenceFLOAT4+48+48高域処理の基準周波数をHzで示す。

各言語での定義

#include <windows.h>

// XAUDIO2FX_REVERB_I3DL2_PARAMETERS  (x64 52 / x86 52 バイト)
#pragma pack(push, 1)
typedef struct XAUDIO2FX_REVERB_I3DL2_PARAMETERS {
    FLOAT WetDryMix;
    INT Room;
    INT RoomHF;
    FLOAT RoomRolloffFactor;
    FLOAT DecayTime;
    FLOAT DecayHFRatio;
    INT Reflections;
    FLOAT ReflectionsDelay;
    INT Reverb;
    FLOAT ReverbDelay;
    FLOAT Diffusion;
    FLOAT Density;
    FLOAT HFReference;
} XAUDIO2FX_REVERB_I3DL2_PARAMETERS;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct XAUDIO2FX_REVERB_I3DL2_PARAMETERS
{
    public float WetDryMix;
    public int Room;
    public int RoomHF;
    public float RoomRolloffFactor;
    public float DecayTime;
    public float DecayHFRatio;
    public int Reflections;
    public float ReflectionsDelay;
    public int Reverb;
    public float ReverbDelay;
    public float Diffusion;
    public float Density;
    public float HFReference;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure XAUDIO2FX_REVERB_I3DL2_PARAMETERS
    Public WetDryMix As Single
    Public Room As Integer
    Public RoomHF As Integer
    Public RoomRolloffFactor As Single
    Public DecayTime As Single
    Public DecayHFRatio As Single
    Public Reflections As Integer
    Public ReflectionsDelay As Single
    Public Reverb As Integer
    Public ReverbDelay As Single
    Public Diffusion As Single
    Public Density As Single
    Public HFReference As Single
End Structure
import ctypes
from ctypes import wintypes

class XAUDIO2FX_REVERB_I3DL2_PARAMETERS(ctypes.Structure):
    _pack_ = 1
    _fields_ = [
        ("WetDryMix", ctypes.c_float),
        ("Room", ctypes.c_int),
        ("RoomHF", ctypes.c_int),
        ("RoomRolloffFactor", ctypes.c_float),
        ("DecayTime", ctypes.c_float),
        ("DecayHFRatio", ctypes.c_float),
        ("Reflections", ctypes.c_int),
        ("ReflectionsDelay", ctypes.c_float),
        ("Reverb", ctypes.c_int),
        ("ReverbDelay", ctypes.c_float),
        ("Diffusion", ctypes.c_float),
        ("Density", ctypes.c_float),
        ("HFReference", ctypes.c_float),
    ]
#[repr(C, packed(1))]
pub struct XAUDIO2FX_REVERB_I3DL2_PARAMETERS {
    pub WetDryMix: f32,
    pub Room: i32,
    pub RoomHF: i32,
    pub RoomRolloffFactor: f32,
    pub DecayTime: f32,
    pub DecayHFRatio: f32,
    pub Reflections: i32,
    pub ReflectionsDelay: f32,
    pub Reverb: i32,
    pub ReverbDelay: f32,
    pub Diffusion: f32,
    pub Density: f32,
    pub HFReference: f32,
}
import "golang.org/x/sys/windows"

type XAUDIO2FX_REVERB_I3DL2_PARAMETERS struct {
	WetDryMix float32
	Room int32
	RoomHF int32
	RoomRolloffFactor float32
	DecayTime float32
	DecayHFRatio float32
	Reflections int32
	ReflectionsDelay float32
	Reverb int32
	ReverbDelay float32
	Diffusion float32
	Density float32
	HFReference float32
}
type
  XAUDIO2FX_REVERB_I3DL2_PARAMETERS = packed record
    WetDryMix: Single;
    Room: Integer;
    RoomHF: Integer;
    RoomRolloffFactor: Single;
    DecayTime: Single;
    DecayHFRatio: Single;
    Reflections: Integer;
    ReflectionsDelay: Single;
    Reverb: Integer;
    ReverbDelay: Single;
    Diffusion: Single;
    Density: Single;
    HFReference: Single;
  end;
const XAUDIO2FX_REVERB_I3DL2_PARAMETERS = extern struct {
    WetDryMix: f32,
    Room: i32,
    RoomHF: i32,
    RoomRolloffFactor: f32,
    DecayTime: f32,
    DecayHFRatio: f32,
    Reflections: i32,
    ReflectionsDelay: f32,
    Reverb: i32,
    ReverbDelay: f32,
    Diffusion: f32,
    Density: f32,
    HFReference: f32,
};
type
  XAUDIO2FX_REVERB_I3DL2_PARAMETERS {.packed.} = object
    WetDryMix: float32
    Room: int32
    RoomHF: int32
    RoomRolloffFactor: float32
    DecayTime: float32
    DecayHFRatio: float32
    Reflections: int32
    ReflectionsDelay: float32
    Reverb: int32
    ReverbDelay: float32
    Diffusion: float32
    Density: float32
    HFReference: float32
align(1)
struct XAUDIO2FX_REVERB_I3DL2_PARAMETERS
{
    float WetDryMix;
    int Room;
    int RoomHF;
    float RoomRolloffFactor;
    float DecayTime;
    float DecayHFRatio;
    int Reflections;
    float ReflectionsDelay;
    int Reverb;
    float ReverbDelay;
    float Diffusion;
    float Density;
    float HFReference;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; XAUDIO2FX_REVERB_I3DL2_PARAMETERS サイズ: 52 バイト(x64)
dim st, 13    ; 4byte整数×13(構造体サイズ 52 / 4 切り上げ)
; WetDryMix : FLOAT (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Room : INT (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; RoomHF : INT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; RoomRolloffFactor : FLOAT (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; DecayTime : FLOAT (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; DecayHFRatio : FLOAT (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; Reflections : INT (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ReflectionsDelay : FLOAT (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; Reverb : INT (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; ReverbDelay : FLOAT (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; Diffusion : FLOAT (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; Density : FLOAT (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; HFReference : FLOAT (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global XAUDIO2FX_REVERB_I3DL2_PARAMETERS, pack=1
    #field float WetDryMix
    #field int Room
    #field int RoomHF
    #field float RoomRolloffFactor
    #field float DecayTime
    #field float DecayHFRatio
    #field int Reflections
    #field float ReflectionsDelay
    #field int Reverb
    #field float ReverbDelay
    #field float Diffusion
    #field float Density
    #field float HFReference
#endstruct

stdim st, XAUDIO2FX_REVERB_I3DL2_PARAMETERS        ; NSTRUCT 変数を確保
st->WetDryMix = 100
mes "WetDryMix=" + st->WetDryMix