/****************************************************************************
*
* Copyright (c) CRI Middleware Co., Ltd.
*
****************************************************************************/
#if !UNITY_EDITOR && UNITY_ANDROID
#define ENABLE_CRIATOMEXASRRACK_ANDROID
#endif
using System.Runtime.InteropServices;
public partial class CriAtomExAsrRack {
/**
* Stream Type ID
*
* This value set the streaming type of the audio output destination.
*
*
*/
public enum StreamType : System.Int32 {
Music = 0,
Alarm,
Dtmf,
Notification,
Ring,
System,
VoiceCall,
}
/**
* Android-specific configuration structure used to create an ASR Rack
*
* This structure is used to configure an CriAtomExAsrRack.
* Pass this structure as an argument when creating a module (CriWare.CriAtomExAsrRack::CriAtomExAsrRack function).
* For details, refer to the manual for each platform.
* CriAtomExAsrRack CreateAsrRack() {
* var asrConfig = CriAtomExAsrRack.Config.Default();
* var androidConfig = CriAtomExAsrRack.PlatformConfigAndroid.Default();
*
* // Change StreamType
* androidConfig.streamType = CriAtomExAsrRack.StreamType.Alarm;
*
* if (androidConfig.IsSupportedPlatform()) {
* return new CriAtomExAsrRack(asrConfig, androidConfig);
* }
* return null;
* }
*
*
*/
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct PlatformConfigAndroid : CriWare.CriAtomExAsrRack.IPlatformConfig {
/**
* Output audio stream type
*
* Specify the Output Audio Stream Type for Android OS.
* Valid only if the ASR Rack output destination sound renderer type
* is (default value).
*
*
*/
public StreamType streamType;
/**
* Spatial audio enabled flag
*
* Specify the use of spatial audio.
* If the device does not support spatial audio, the downmixed result will be output.
*
*/
public bool enableSpatialAudio;
public bool IsSupportedPlatform() {
#if ENABLE_CRIATOMEXASRRACK_ANDROID
return true;
#else
return false;
#endif
}
/**
* Get the configuration structure with default values
* Configuration structure with default values
*
* Get the default configuration structure to initialize .
*
*/
public static PlatformConfigAndroid Default() {
var config = new PlatformConfigAndroid();
SetDefaultConfig_ANDROID(ref config);
return config;
}
}
/**
* Set the default parameters
* Platform-specific initialization configuration structure
*
* Assign the default parameters to the platform-specific initialization configuration structure used by .
*
*/
public static void SetDefaultConfig_ANDROID(ref PlatformConfigAndroid platformConfig) {
NativeMethods.criAtomExAsrRack_SetDefaultConfig_ANDROID_Macro(ref platformConfig);
}
protected partial class NativeMethods {
#if ENABLE_CRIATOMEXASRRACK_ANDROID && !CRIWARE_ENABLE_HEADLESS_MODE
[DllImport(CriWare.Common.pluginName, CallingConvention = CriWare.Common.pluginCallingConvention)]
internal static extern void criAtomExAsrRack_SetDefaultConfig_ANDROID_Macro(ref PlatformConfigAndroid config);
#else
internal static void criAtomExAsrRack_SetDefaultConfig_ANDROID_Macro(ref PlatformConfigAndroid config) { }
#endif
}
}