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

DSFXI3DL2Reverb

構造体
サイズx64: 48 バイト / x86: 48 バイト

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

フィールド

フィールドサイズx64x86説明
lRoomINT4+0+0室内反射音全体の減衰量(-10000〜0、100分の1dB)。
lRoomHFINT4+4+4高周波数帯の室内反射音減衰量(-10000〜0、100分の1dB)。
flRoomRolloffFactorFLOAT4+8+8距離に応じた室内効果の減衰係数(0〜10)。
flDecayTimeFLOAT4+12+12残響減衰時間(0.1〜20秒)。
flDecayHFRatioFLOAT4+16+16高周波数帯の減衰時間比率(0.1〜2.0)。
lReflectionsINT4+20+20初期反射音のレベル(-10000〜1000、100分の1dB)。
flReflectionsDelayFLOAT4+24+24初期反射音の遅延時間(0〜0.3秒)。
lReverbINT4+28+28後期残響音のレベル(-10000〜2000、100分の1dB)。
flReverbDelayFLOAT4+32+32後期残響音の遅延時間(0〜0.1秒)。
flDiffusionFLOAT4+36+36残響の拡散度(0〜100パーセント)。
flDensityFLOAT4+40+40残響の密度(0〜100パーセント)。
flHFReferenceFLOAT4+44+44高周波数特性の基準周波数(20〜20000Hz)。

各言語での定義

#include <windows.h>

// DSFXI3DL2Reverb  (x64 48 / x86 48 バイト)
typedef struct DSFXI3DL2Reverb {
    INT lRoom;
    INT lRoomHF;
    FLOAT flRoomRolloffFactor;
    FLOAT flDecayTime;
    FLOAT flDecayHFRatio;
    INT lReflections;
    FLOAT flReflectionsDelay;
    INT lReverb;
    FLOAT flReverbDelay;
    FLOAT flDiffusion;
    FLOAT flDensity;
    FLOAT flHFReference;
} DSFXI3DL2Reverb;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DSFXI3DL2Reverb
{
    public int lRoom;
    public int lRoomHF;
    public float flRoomRolloffFactor;
    public float flDecayTime;
    public float flDecayHFRatio;
    public int lReflections;
    public float flReflectionsDelay;
    public int lReverb;
    public float flReverbDelay;
    public float flDiffusion;
    public float flDensity;
    public float flHFReference;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DSFXI3DL2Reverb
    Public lRoom As Integer
    Public lRoomHF As Integer
    Public flRoomRolloffFactor As Single
    Public flDecayTime As Single
    Public flDecayHFRatio As Single
    Public lReflections As Integer
    Public flReflectionsDelay As Single
    Public lReverb As Integer
    Public flReverbDelay As Single
    Public flDiffusion As Single
    Public flDensity As Single
    Public flHFReference As Single
End Structure
import ctypes
from ctypes import wintypes

class DSFXI3DL2Reverb(ctypes.Structure):
    _fields_ = [
        ("lRoom", ctypes.c_int),
        ("lRoomHF", ctypes.c_int),
        ("flRoomRolloffFactor", ctypes.c_float),
        ("flDecayTime", ctypes.c_float),
        ("flDecayHFRatio", ctypes.c_float),
        ("lReflections", ctypes.c_int),
        ("flReflectionsDelay", ctypes.c_float),
        ("lReverb", ctypes.c_int),
        ("flReverbDelay", ctypes.c_float),
        ("flDiffusion", ctypes.c_float),
        ("flDensity", ctypes.c_float),
        ("flHFReference", ctypes.c_float),
    ]
#[repr(C)]
pub struct DSFXI3DL2Reverb {
    pub lRoom: i32,
    pub lRoomHF: i32,
    pub flRoomRolloffFactor: f32,
    pub flDecayTime: f32,
    pub flDecayHFRatio: f32,
    pub lReflections: i32,
    pub flReflectionsDelay: f32,
    pub lReverb: i32,
    pub flReverbDelay: f32,
    pub flDiffusion: f32,
    pub flDensity: f32,
    pub flHFReference: f32,
}
import "golang.org/x/sys/windows"

type DSFXI3DL2Reverb struct {
	lRoom int32
	lRoomHF int32
	flRoomRolloffFactor float32
	flDecayTime float32
	flDecayHFRatio float32
	lReflections int32
	flReflectionsDelay float32
	lReverb int32
	flReverbDelay float32
	flDiffusion float32
	flDensity float32
	flHFReference float32
}
type
  DSFXI3DL2Reverb = record
    lRoom: Integer;
    lRoomHF: Integer;
    flRoomRolloffFactor: Single;
    flDecayTime: Single;
    flDecayHFRatio: Single;
    lReflections: Integer;
    flReflectionsDelay: Single;
    lReverb: Integer;
    flReverbDelay: Single;
    flDiffusion: Single;
    flDensity: Single;
    flHFReference: Single;
  end;
const DSFXI3DL2Reverb = extern struct {
    lRoom: i32,
    lRoomHF: i32,
    flRoomRolloffFactor: f32,
    flDecayTime: f32,
    flDecayHFRatio: f32,
    lReflections: i32,
    flReflectionsDelay: f32,
    lReverb: i32,
    flReverbDelay: f32,
    flDiffusion: f32,
    flDensity: f32,
    flHFReference: f32,
};
type
  DSFXI3DL2Reverb {.bycopy.} = object
    lRoom: int32
    lRoomHF: int32
    flRoomRolloffFactor: float32
    flDecayTime: float32
    flDecayHFRatio: float32
    lReflections: int32
    flReflectionsDelay: float32
    lReverb: int32
    flReverbDelay: float32
    flDiffusion: float32
    flDensity: float32
    flHFReference: float32
struct DSFXI3DL2Reverb
{
    int lRoom;
    int lRoomHF;
    float flRoomRolloffFactor;
    float flDecayTime;
    float flDecayHFRatio;
    int lReflections;
    float flReflectionsDelay;
    int lReverb;
    float flReverbDelay;
    float flDiffusion;
    float flDensity;
    float flHFReference;
}

HSP用 定義

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

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

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