fix: Fix TTS COM exception in IL2CPP

This commit is contained in:
2025-05-07 22:56:32 +08:00
parent 5daee1a01a
commit a3efe939e8
107 changed files with 3862 additions and 79 deletions

View File

@@ -0,0 +1,36 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace SpeechLib {
[ComImport]
[TypeLibType(4160)]
[Guid("6450336F-7D49-4CED-8097-49D6DEE37294")]
public interface ISpeechBaseStream {
[DispId(1)]
SpAudioFormat Format {
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[DispId(1)]
[return: MarshalAs(UnmanagedType.Interface)]
get;
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[DispId(1)]
[param: In]
[param: MarshalAs(UnmanagedType.Interface)]
set;
}
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[DispId(2)]
int Read([MarshalAs(UnmanagedType.Struct)] out object Buffer, [In] int NumberOfBytes);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[DispId(3)]
int Write([In][MarshalAs(UnmanagedType.Struct)] object Buffer);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[DispId(4)]
[return: MarshalAs(UnmanagedType.Struct)]
object Seek([In][MarshalAs(UnmanagedType.Struct)] object Position, [In] SpeechStreamSeekPositionType Origin = SpeechStreamSeekPositionType.SSSPTRelativeToStart);
}
}