ホーム › Devices.Tapi › LINEMEDIACONTROLTONE
LINEMEDIACONTROLTONE
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwAppSpecific | DWORD | 4 | +0 | +0 | アプリケーションがトーンにタグを付けるために使用します。このトーンが検出されると、dwAppSpecific メンバーの値がアプリケーションに返されます。 |
| dwDuration | DWORD | 4 | +4 | +4 | 検出が行われるまでにトーンが存在している必要がある時間 (ミリ秒単位)。 |
| dwFrequency1 | DWORD | 4 | +8 | +8 | トーンの 1 番目の周波数 (ヘルツ単位)。 |
| dwFrequency2 | DWORD | 4 | +12 | +12 | トーンの 2 番目の周波数 (ヘルツ単位)。 |
| dwFrequency3 | DWORD | 4 | +16 | +16 | トーンの 3 番目の周波数 (ヘルツ単位)。トーンに必要な周波数が 3 つ未満の場合は、使用しない周波数に 0 を指定します。3 つの周波数すべてが 0 に設定されたトーンは無音として解釈され、無音の検出に使用できます。 |
| dwMediaControl | DWORD | 4 | +20 | +20 | メディア制御アクション。このメンバーは LINEMEDIACONTROL_ 定数のいずれかを使用します。 |
公式ドキュメント
LINEMEDIACONTROLTONE 構造体は、トーンが検出されたときに実行するメディア制御アクションを記述します。配列の要素として使用されます。 lineSetMediaControl 関数および TSPI_lineSetMediaControl 関数がこの構造体を使用します。
解説(Remarks)
この構造体は拡張できません。
LINEMEDIACONTROLTONE 構造体は、<トーン、メディア制御アクション> というタプルを定義します。これらのタプルの配列を lineSetMediaControl 関数に渡すことで、指定した通話においてメディアの種類の変化によってトリガーされるメディア制御アクションを設定します。一覧に挙げられたメディアの種類への変化が検出されると、メディア ストリームに対して対応するアクションが呼び出されます。
すべての周波数が 0 に設定されたトーンは無音に相当します。したがって、アプリケーションは通話の情報ストリームを監視して無音を検出できます。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// LINEMEDIACONTROLTONE (x64 24 / x86 24 バイト)
#pragma pack(push, 1)
typedef struct LINEMEDIACONTROLTONE {
DWORD dwAppSpecific;
DWORD dwDuration;
DWORD dwFrequency1;
DWORD dwFrequency2;
DWORD dwFrequency3;
DWORD dwMediaControl;
} LINEMEDIACONTROLTONE;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct LINEMEDIACONTROLTONE
{
public uint dwAppSpecific;
public uint dwDuration;
public uint dwFrequency1;
public uint dwFrequency2;
public uint dwFrequency3;
public uint dwMediaControl;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure LINEMEDIACONTROLTONE
Public dwAppSpecific As UInteger
Public dwDuration As UInteger
Public dwFrequency1 As UInteger
Public dwFrequency2 As UInteger
Public dwFrequency3 As UInteger
Public dwMediaControl As UInteger
End Structureimport ctypes
from ctypes import wintypes
class LINEMEDIACONTROLTONE(ctypes.Structure):
_pack_ = 1
_fields_ = [
("dwAppSpecific", wintypes.DWORD),
("dwDuration", wintypes.DWORD),
("dwFrequency1", wintypes.DWORD),
("dwFrequency2", wintypes.DWORD),
("dwFrequency3", wintypes.DWORD),
("dwMediaControl", wintypes.DWORD),
]#[repr(C, packed(1))]
pub struct LINEMEDIACONTROLTONE {
pub dwAppSpecific: u32,
pub dwDuration: u32,
pub dwFrequency1: u32,
pub dwFrequency2: u32,
pub dwFrequency3: u32,
pub dwMediaControl: u32,
}import "golang.org/x/sys/windows"
type LINEMEDIACONTROLTONE struct {
dwAppSpecific uint32
dwDuration uint32
dwFrequency1 uint32
dwFrequency2 uint32
dwFrequency3 uint32
dwMediaControl uint32
}type
LINEMEDIACONTROLTONE = packed record
dwAppSpecific: DWORD;
dwDuration: DWORD;
dwFrequency1: DWORD;
dwFrequency2: DWORD;
dwFrequency3: DWORD;
dwMediaControl: DWORD;
end;const LINEMEDIACONTROLTONE = extern struct {
dwAppSpecific: u32,
dwDuration: u32,
dwFrequency1: u32,
dwFrequency2: u32,
dwFrequency3: u32,
dwMediaControl: u32,
};type
LINEMEDIACONTROLTONE {.packed.} = object
dwAppSpecific: uint32
dwDuration: uint32
dwFrequency1: uint32
dwFrequency2: uint32
dwFrequency3: uint32
dwMediaControl: uint32align(1)
struct LINEMEDIACONTROLTONE
{
uint dwAppSpecific;
uint dwDuration;
uint dwFrequency1;
uint dwFrequency2;
uint dwFrequency3;
uint dwMediaControl;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; LINEMEDIACONTROLTONE サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; dwAppSpecific : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwDuration : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwFrequency1 : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dwFrequency2 : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dwFrequency3 : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; dwMediaControl : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global LINEMEDIACONTROLTONE, pack=1
#field int dwAppSpecific
#field int dwDuration
#field int dwFrequency1
#field int dwFrequency2
#field int dwFrequency3
#field int dwMediaControl
#endstruct
stdim st, LINEMEDIACONTROLTONE ; NSTRUCT 変数を確保
st->dwAppSpecific = 100
mes "dwAppSpecific=" + st->dwAppSpecific