ホーム › Media.KernelStreaming › KSDS3D_ITD_PARAMS
KSDS3D_ITD_PARAMS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Channel | INT | 4 | +0 | +0 | このパラメータが対象とするチャンネルを示す。 |
| VolSmoothScale | FLOAT | 4 | +4 | +4 | 音量変化を平滑化するスケール係数を表す。 |
| TotalDryAttenuation | FLOAT | 4 | +8 | +8 | ドライ(直接)音の総減衰量を表す。 |
| TotalWetAttenuation | FLOAT | 4 | +12 | +12 | ウェット(残響)音の総減衰量を表す。 |
| SmoothFrequency | INT | 4 | +16 | +16 | 平滑化を行う周波数を示す。 |
| Delay | INT | 4 | +20 | +20 | 両耳間時間差(ITD)に基づく遅延サンプル数を示す。 |
各言語での定義
#include <windows.h>
// KSDS3D_ITD_PARAMS (x64 24 / x86 24 バイト)
typedef struct KSDS3D_ITD_PARAMS {
INT Channel;
FLOAT VolSmoothScale;
FLOAT TotalDryAttenuation;
FLOAT TotalWetAttenuation;
INT SmoothFrequency;
INT Delay;
} KSDS3D_ITD_PARAMS;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KSDS3D_ITD_PARAMS
{
public int Channel;
public float VolSmoothScale;
public float TotalDryAttenuation;
public float TotalWetAttenuation;
public int SmoothFrequency;
public int Delay;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure KSDS3D_ITD_PARAMS
Public Channel As Integer
Public VolSmoothScale As Single
Public TotalDryAttenuation As Single
Public TotalWetAttenuation As Single
Public SmoothFrequency As Integer
Public Delay As Integer
End Structureimport ctypes
from ctypes import wintypes
class KSDS3D_ITD_PARAMS(ctypes.Structure):
_fields_ = [
("Channel", ctypes.c_int),
("VolSmoothScale", ctypes.c_float),
("TotalDryAttenuation", ctypes.c_float),
("TotalWetAttenuation", ctypes.c_float),
("SmoothFrequency", ctypes.c_int),
("Delay", ctypes.c_int),
]#[repr(C)]
pub struct KSDS3D_ITD_PARAMS {
pub Channel: i32,
pub VolSmoothScale: f32,
pub TotalDryAttenuation: f32,
pub TotalWetAttenuation: f32,
pub SmoothFrequency: i32,
pub Delay: i32,
}import "golang.org/x/sys/windows"
type KSDS3D_ITD_PARAMS struct {
Channel int32
VolSmoothScale float32
TotalDryAttenuation float32
TotalWetAttenuation float32
SmoothFrequency int32
Delay int32
}type
KSDS3D_ITD_PARAMS = record
Channel: Integer;
VolSmoothScale: Single;
TotalDryAttenuation: Single;
TotalWetAttenuation: Single;
SmoothFrequency: Integer;
Delay: Integer;
end;const KSDS3D_ITD_PARAMS = extern struct {
Channel: i32,
VolSmoothScale: f32,
TotalDryAttenuation: f32,
TotalWetAttenuation: f32,
SmoothFrequency: i32,
Delay: i32,
};type
KSDS3D_ITD_PARAMS {.bycopy.} = object
Channel: int32
VolSmoothScale: float32
TotalDryAttenuation: float32
TotalWetAttenuation: float32
SmoothFrequency: int32
Delay: int32struct KSDS3D_ITD_PARAMS
{
int Channel;
float VolSmoothScale;
float TotalDryAttenuation;
float TotalWetAttenuation;
int SmoothFrequency;
int Delay;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; KSDS3D_ITD_PARAMS サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; Channel : INT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; VolSmoothScale : FLOAT (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; TotalDryAttenuation : FLOAT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; TotalWetAttenuation : FLOAT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; SmoothFrequency : INT (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; Delay : INT (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global KSDS3D_ITD_PARAMS
#field int Channel
#field float VolSmoothScale
#field float TotalDryAttenuation
#field float TotalWetAttenuation
#field int SmoothFrequency
#field int Delay
#endstruct
stdim st, KSDS3D_ITD_PARAMS ; NSTRUCT 変数を確保
st->Channel = 100
mes "Channel=" + st->Channel