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,53 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace SpeechLib {
[ComImport]
[CoClass(typeof(SpAudioFormatClass))]
[Guid("E6E9C590-3E18-40E3-8299-061F98BDE7C7")]
public interface SpAudioFormat : ISpeechAudioFormat { }
[ComImport]
[Guid("9EF96870-E160-4792-820D-48CF0649E4EC")]
[ClassInterface((ClassInterfaceType)0)]
[TypeLibType(2)]
public class SpAudioFormatClass : ISpeechAudioFormat, SpAudioFormat {
[DispId(1)]
public virtual extern SpeechAudioFormatType Type {
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[DispId(1)]
get;
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[DispId(1)]
[param: In]
set;
}
[DispId(2)]
public virtual extern string Guid {
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[DispId(2)]
[TypeLibFunc(64)]
[return: MarshalAs(UnmanagedType.BStr)]
get;
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[TypeLibFunc(64)]
[DispId(2)]
[param: In]
[param: MarshalAs(UnmanagedType.BStr)]
set;
}
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[DispId(3)]
[TypeLibFunc(64)]
[return: MarshalAs(UnmanagedType.Interface)]
public virtual extern SpWaveFormatEx GetWaveFormatEx();
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[DispId(4)]
[TypeLibFunc(64)]
public virtual extern void SetWaveFormatEx([In][MarshalAs(UnmanagedType.Interface)] SpWaveFormatEx SpeechWaveFormatEx);
}
}