ホーム › Media.Speech › SPRECORESULTTIMES
SPRECORESULTTIMES
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| ftStreamTime | FILETIME | 8 | +0 | +0 | 認識結果の絶対時刻(FILETIME)。 |
| ullLength | ULONGLONG | 8 | +8 | +8 | 認識結果の音声長を時間(100ナノ秒単位)で示す。 |
| dwTickCount | DWORD | 4 | +16 | +16 | 認識完了時のシステムティックカウント(ミリ秒)。 |
| ullStart | ULONGLONG | 8 | +24 | +24 | 認識結果の開始位置を時間オフセット(100ナノ秒単位)で示す。 |
各言語での定義
#include <windows.h>
// FILETIME (x64 8 / x86 8 バイト)
typedef struct FILETIME {
DWORD dwLowDateTime;
DWORD dwHighDateTime;
} FILETIME;
// SPRECORESULTTIMES (x64 32 / x86 32 バイト)
typedef struct SPRECORESULTTIMES {
FILETIME ftStreamTime;
ULONGLONG ullLength;
DWORD dwTickCount;
ULONGLONG ullStart;
} SPRECORESULTTIMES;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FILETIME
{
public uint dwLowDateTime;
public uint dwHighDateTime;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SPRECORESULTTIMES
{
public FILETIME ftStreamTime;
public ulong ullLength;
public uint dwTickCount;
public ulong ullStart;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FILETIME
Public dwLowDateTime As UInteger
Public dwHighDateTime As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SPRECORESULTTIMES
Public ftStreamTime As FILETIME
Public ullLength As ULong
Public dwTickCount As UInteger
Public ullStart As ULong
End Structureimport ctypes
from ctypes import wintypes
class FILETIME(ctypes.Structure):
_fields_ = [
("dwLowDateTime", wintypes.DWORD),
("dwHighDateTime", wintypes.DWORD),
]
class SPRECORESULTTIMES(ctypes.Structure):
_fields_ = [
("ftStreamTime", FILETIME),
("ullLength", ctypes.c_ulonglong),
("dwTickCount", wintypes.DWORD),
("ullStart", ctypes.c_ulonglong),
]#[repr(C)]
pub struct FILETIME {
pub dwLowDateTime: u32,
pub dwHighDateTime: u32,
}
#[repr(C)]
pub struct SPRECORESULTTIMES {
pub ftStreamTime: FILETIME,
pub ullLength: u64,
pub dwTickCount: u32,
pub ullStart: u64,
}import "golang.org/x/sys/windows"
type FILETIME struct {
dwLowDateTime uint32
dwHighDateTime uint32
}
type SPRECORESULTTIMES struct {
ftStreamTime FILETIME
ullLength uint64
dwTickCount uint32
ullStart uint64
}type
FILETIME = record
dwLowDateTime: DWORD;
dwHighDateTime: DWORD;
end;
SPRECORESULTTIMES = record
ftStreamTime: FILETIME;
ullLength: UInt64;
dwTickCount: DWORD;
ullStart: UInt64;
end;const FILETIME = extern struct {
dwLowDateTime: u32,
dwHighDateTime: u32,
};
const SPRECORESULTTIMES = extern struct {
ftStreamTime: FILETIME,
ullLength: u64,
dwTickCount: u32,
ullStart: u64,
};type
FILETIME {.bycopy.} = object
dwLowDateTime: uint32
dwHighDateTime: uint32
SPRECORESULTTIMES {.bycopy.} = object
ftStreamTime: FILETIME
ullLength: uint64
dwTickCount: uint32
ullStart: uint64struct FILETIME
{
uint dwLowDateTime;
uint dwHighDateTime;
}
struct SPRECORESULTTIMES
{
FILETIME ftStreamTime;
ulong ullLength;
uint dwTickCount;
ulong ullStart;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SPRECORESULTTIMES サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; ftStreamTime : FILETIME (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; ullLength : ULONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; dwTickCount : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ullStart : ULONGLONG (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global FILETIME
#field int dwLowDateTime
#field int dwHighDateTime
#endstruct
#defstruct global SPRECORESULTTIMES
#field FILETIME ftStreamTime
#field int64 ullLength
#field int dwTickCount
#field int64 ullStart
#endstruct
stdim st, SPRECORESULTTIMES ; NSTRUCT 変数を確保
st->ullLength = 100
mes "ullLength=" + st->ullLength