ホーム › Media.Audio.XAudio2 › CreateAudioReverb
CreateAudioReverb
関数リバーブ効果を付与するXAPOオーディオ処理オブジェクトを生成する。
シグネチャ
// XAudio2_8.dll
#include <windows.h>
HRESULT CreateAudioReverb(
IUnknown** ppApo
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| ppApo | IUnknown** | out | 生成されたリバーブAPOのIUnknownインターフェイスを受け取るポインター。 |
戻り値の型: HRESULT
各言語での呼び出し定義
// XAudio2_8.dll
#include <windows.h>
HRESULT CreateAudioReverb(
IUnknown** ppApo
);[DllImport("XAudio2_8.dll", ExactSpelling = true)]
static extern int CreateAudioReverb(
IntPtr ppApo // IUnknown** out
);<DllImport("XAudio2_8.dll", ExactSpelling:=True)>
Public Shared Function CreateAudioReverb(
ppApo As IntPtr ' IUnknown** out
) As Integer
End Function' ppApo : IUnknown** out
Declare PtrSafe Function CreateAudioReverb Lib "xaudio2_8" ( _
ByVal ppApo As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
CreateAudioReverb = ctypes.windll.xaudio2_8.CreateAudioReverb
CreateAudioReverb.restype = ctypes.c_int
CreateAudioReverb.argtypes = [
ctypes.c_void_p, # ppApo : IUnknown** out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('XAudio2_8.dll')
CreateAudioReverb = Fiddle::Function.new(
lib['CreateAudioReverb'],
[
Fiddle::TYPE_VOIDP, # ppApo : IUnknown** out
],
Fiddle::TYPE_INT)#[link(name = "xaudio2_8")]
extern "system" {
fn CreateAudioReverb(
ppApo: *mut *mut core::ffi::c_void // IUnknown** out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("XAudio2_8.dll")]
public static extern int CreateAudioReverb(IntPtr ppApo);
"@
$api = Add-Type -MemberDefinition $sig -Name 'XAudio2_8_CreateAudioReverb' -Namespace Win32 -PassThru
# $api::CreateAudioReverb(ppApo)#uselib "XAudio2_8.dll"
#func global CreateAudioReverb "CreateAudioReverb" sptr
; CreateAudioReverb ppApo ; 戻り値は stat
; ppApo : IUnknown** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "XAudio2_8.dll"
#cfunc global CreateAudioReverb "CreateAudioReverb" sptr
; res = CreateAudioReverb(ppApo)
; ppApo : IUnknown** out -> "sptr"; HRESULT CreateAudioReverb(IUnknown** ppApo)
#uselib "XAudio2_8.dll"
#cfunc global CreateAudioReverb "CreateAudioReverb" intptr
; res = CreateAudioReverb(ppApo)
; ppApo : IUnknown** out -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
xaudio2_8 = windows.NewLazySystemDLL("XAudio2_8.dll")
procCreateAudioReverb = xaudio2_8.NewProc("CreateAudioReverb")
)
// ppApo (IUnknown** out)
r1, _, err := procCreateAudioReverb.Call(
uintptr(ppApo),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction CreateAudioReverb(
ppApo: Pointer // IUnknown** out
): Integer; stdcall;
external 'XAudio2_8.dll' name 'CreateAudioReverb';result := DllCall("XAudio2_8\CreateAudioReverb"
, "Ptr", ppApo ; IUnknown** out
, "Int") ; return: HRESULT●CreateAudioReverb(ppApo) = DLL("XAudio2_8.dll", "int CreateAudioReverb(void*)")
# 呼び出し: CreateAudioReverb(ppApo)
# ppApo : IUnknown** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "xaudio2_8" fn CreateAudioReverb(
ppApo: ?*anyopaque // IUnknown** out
) callconv(std.os.windows.WINAPI) i32;proc CreateAudioReverb(
ppApo: pointer # IUnknown** out
): int32 {.importc: "CreateAudioReverb", stdcall, dynlib: "XAudio2_8.dll".}pragma(lib, "xaudio2_8");
extern(Windows)
int CreateAudioReverb(
void* ppApo // IUnknown** out
);ccall((:CreateAudioReverb, "XAudio2_8.dll"), stdcall, Int32,
(Ptr{Cvoid},),
ppApo)
# ppApo : IUnknown** out -> Ptr{Cvoid}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t CreateAudioReverb(
void* ppApo);
]]
local xaudio2_8 = ffi.load("xaudio2_8")
-- xaudio2_8.CreateAudioReverb(ppApo)
-- ppApo : IUnknown** out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('XAudio2_8.dll');
const CreateAudioReverb = lib.func('__stdcall', 'CreateAudioReverb', 'int32_t', ['void *']);
// CreateAudioReverb(ppApo)
// ppApo : IUnknown** out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("XAudio2_8.dll", {
CreateAudioReverb: { parameters: ["pointer"], result: "i32" },
});
// lib.symbols.CreateAudioReverb(ppApo)
// ppApo : IUnknown** out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t CreateAudioReverb(
void* ppApo);
C, "XAudio2_8.dll");
// $ffi->CreateAudioReverb(ppApo);
// ppApo : IUnknown** out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface Xaudio2_8 extends StdCallLibrary {
Xaudio2_8 INSTANCE = Native.load("xaudio2_8", Xaudio2_8.class);
int CreateAudioReverb(
Pointer ppApo // IUnknown** out
);
}@[Link("xaudio2_8")]
lib LibXAudio2_8
fun CreateAudioReverb = CreateAudioReverb(
ppApo : Void* # IUnknown** out
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef CreateAudioReverbNative = Int32 Function(Pointer<Void>);
typedef CreateAudioReverbDart = int Function(Pointer<Void>);
final CreateAudioReverb = DynamicLibrary.open('XAudio2_8.dll')
.lookupFunction<CreateAudioReverbNative, CreateAudioReverbDart>('CreateAudioReverb');
// ppApo : IUnknown** out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function CreateAudioReverb(
ppApo: Pointer // IUnknown** out
): Integer; stdcall;
external 'XAudio2_8.dll' name 'CreateAudioReverb';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "CreateAudioReverb"
c_CreateAudioReverb :: Ptr () -> IO Int32
-- ppApo : IUnknown** out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let createaudioreverb =
foreign "CreateAudioReverb"
((ptr void) @-> returning int32_t)
(* ppApo : IUnknown** out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library xaudio2_8 (t "XAudio2_8.dll"))
(cffi:use-foreign-library xaudio2_8)
(cffi:defcfun ("CreateAudioReverb" create-audio-reverb :convention :stdcall) :int32
(pp-apo :pointer)) ; IUnknown** out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $CreateAudioReverb = Win32::API::More->new('XAudio2_8',
'int CreateAudioReverb(LPVOID ppApo)');
# my $ret = $CreateAudioReverb->Call($ppApo);
# ppApo : IUnknown** out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
使用する型