// SendPort flags 32bit int
#define SEND_DUMMY     0
#define SEND_PORT_A    (1 << 0) /* 波形データ転送 */
#define SEND_PORT_B    (1 << 1) /* 波形データのスペクトル */
#define SEND_PORT_C    (1 << 2) /* 音源情報 */
#define SEND_PORT_D    (1 << 3) /* 分離音スペクトル */
#define SEND_PORT_E    (1 << 4) /* 特徴量 */
#define SEND_PORT_F    (1 << 5) /* 分離音波形 */
//#define SEND_PORT_G    (1 << 6)
//#define SEND_PORT_H    (1 << 7)
//#define SEND_PORT_I    (1 << 8)
//#define SEND_PORT_J    (1 << 9)
//#define SEND_PORT_K    (1 << 10)
//#define SEND_PORT_L    (1 << 11)
//#define SEND_PORT_M    (1 << 12)
//#define SEND_PORT_N    (1 << 13)
//#define SEND_PORT_O    (1 << 14)
//#define SEND_PORT_P    (1 << 15)
#define SEND_JULIUS    (1 << 16)

#define SEND_PORT_A_FLAC    (1 << 17) /* 波形データFLAC転送 */
#define SEND_PORT_F_FLAC    (1 << 18) /* 分離音データFLAC転送 */

#define TIMESTAMP_DUMMY           0
#define TIMESTAMP_USE_PORT_A      (1 << 0) // Effect to PortA
#define TIMESTAMP_USE_PORT_B      (1 << 1) // Effect to PortB
#define TIMESTAMP_USE_PORT_C      (1 << 2) // Effect to PortC
#define TIMESTAMP_USE_PORT_D      (1 << 3) // Effect to PortD
#define TIMESTAMP_USE_PORT_E      (1 << 4) // Effect to PortE
#define TIMESTAMP_USE_PORT_F      (1 << 5) // Effect to PortF
//#define TIMESTAMP_USE_PORT_G      (1 << 6) // Effect to PortG
//#define TIMESTAMP_USE_PORT_H      (1 << 7) // Effect to PortH
//#define TIMESTAMP_USE_PORT_I      (1 << 8) // Effect to PortI
//#define TIMESTAMP_USE_PORT_J      (1 << 9) // Effect to PortJ
//#define TIMESTAMP_USE_PORT_K      (1 << 10) // Effect to PortK
//#define TIMESTAMP_USE_PORT_L      (1 << 11) // Effect to PortL
//#define TIMESTAMP_USE_PORT_M      (1 << 12) // Effect to PortM
//#define TIMESTAMP_USE_PORT_N      (1 << 13) // Effect to PortN
//#define TIMESTAMP_USE_PORT_O      (1 << 14) // Effect to PortO
//#define TIMESTAMP_USE_PORT_P      (1 << 15) // Effect to PortP
#define TIMESTAMP_USE_JULIUS      (1 << 16) // Effect to Port JULIUS
#define TIMESTAMP_USE             (1 << 30)

// DynamicReConf
#define DYNAMIC_RECONF_DISABLE 0
#define DYNAMIC_RECONF_ENABLE  1

// LocalizeAlgorithm mode 32bit int
#define LOC_NONE          0x00 // None
#define LOC_CONSTANT      0x01 // ConstantLocalization
#define LOC_MUSIC         0x02 // LocalizeMUSIC
#define LOC_MUSIC_FILTER  0x03 // It is similar to the behavior of LocalizeMUSIC + SourceByDirection => GHDSS, etc...
#define LOC_NMUSIC        0x04 // LocalizeMUSIC + NormalizeMUSIC
#define LOC_NMUSIC_FILTER 0x05 // It is similar to the behavior of LocalizeMUSIC + NormalizeMUSIC + SourceByDirection => GHDSS, etc...

// SourceTrackingAlgorithm mode 32bit int
#define SRCTRACK_NONE     0x00 // None (for dummy)
#define SRCTRACK_TRACKER  0x01 // SourceTracker
#define SRCTRACK_EXTENDED 0x02 // ExtendedSourceTracker
/*
// UseSeparation mode 32bit int
#define SEP_NONE          0x00 // None
#define SEP_GHDSS         0x01 // GHDSS
#define SEP_LCMV          0x02 // LCMV
#define SEP_GJ            0x03 // GJ (Not implement)
#define SEP_MSNR          0x04 // MSNR (Not implement)
#define SEP_GSS           0x05 // GSS (Not implement)
#define SEP_GICA          0x06 // GICA (Not implement)
#define SEP_DS            0x07 // DS (Not implement)
#define SEP_WDS           0x08 // WDS (Not implement)
#define SEP_NULL          0x09 // NULL (Not implement)
#define SEP_ILSE          0x0A // ILSE (Not implement)
#define SEP_ML            0x0B // ML (Not implement)
*/
// UseFilter mode 32bit int
#define FILTER_NONE       0x00 // None
#define FILTER_HRLE       0x01 // HRLE
#define FILTER_POST       0x02 // POST (Not implement)

// UseSID mode 32bit int
#define SID_NONE          0x00 // None
#define SID_ZC            0x01 // LowpassFilter + ZeroCross_s
#define SID_LR            0x02 // LogisticRegression

// UseSourceFilter flags 32bit int
#define SRC_FILTER_DUMMY           0
//#define SRC_FILTER_USE_PORT_A      (1 << 0) // Effect to PortA :: ignore option
//#define SRC_FILTER_USE_PORT_B      (1 << 1) // Effect to PortB :: ignore option
#define SRC_FILTER_USE_PORT_C      (1 << 2) // Effect to PortC
#define SRC_FILTER_USE_PORT_D      (1 << 3) // Effect to PortD
#define SRC_FILTER_USE_PORT_E      (1 << 4) // Effect to PortE
#define SRC_FILTER_USE_PORT_F      (1 << 5) // Effect to PortF
//#define SRC_FILTER_USE_PORT_G      (1 << 6) // Effect to PortG
//#define SRC_FILTER_USE_PORT_H      (1 << 7) // Effect to PortH
//#define SRC_FILTER_USE_PORT_I      (1 << 8) // Effect to PortI
//#define SRC_FILTER_USE_PORT_J      (1 << 9) // Effect to PortJ
//#define SRC_FILTER_USE_PORT_K      (1 << 10) // Effect to PortK
//#define SRC_FILTER_USE_PORT_L      (1 << 11) // Effect to PortL
//#define SRC_FILTER_USE_PORT_M      (1 << 12) // Effect to PortM
//#define SRC_FILTER_USE_PORT_N      (1 << 13) // Effect to PortN
//#define SRC_FILTER_USE_PORT_O      (1 << 14) // Effect to PortO
//#define SRC_FILTER_USE_PORT_P      (1 << 15) // Effect to PortP
#define SRC_FILTER_USE_JULIUS      (1 << 16) // Effect to Port JULIUS
#define SRC_FILTER_USE             (1 << 30) // Enable SourceFilter, It is similar to the behavior of SourceByDirection => SaveRawPCM, SaveFeature, etc...




// SaveMicRaw / SaveSepRaw flags 32bit int
#define PCM_NONE         0x00 // No output
#define PCM_RAW_SINT8    0x01 // Output signed int 8bit raw (Not implement)
#define PCM_RAW_SINT16   0x02 // Output signed int 16bit raw
#define PCM_RAW_SINT24   0x03 // Output signed int 24bit raw
#define PCM_RAW_SINT32   0x04 // Output signed int 32bit raw (Not implement)
#define PCM_RAW_UINT8    0x05 // Output unsigned int 8bit raw (Not implement)
#define PCM_RAW_UINT16   0x06 // Output unsigned int 16bit raw (Audacity isn't support) (Not implement)
#define PCM_RAW_UINT24   0x07 // Output unsigned int 24bit raw (Audacity isn't support) (Not implement)
#define PCM_RAW_UINT32   0x08 // Output unsigned int 32bit raw (Audacity isn't support) (Not implement)
#define PCM_RAW_FLOAT32  0x09 // Output float 32bit raw (IEEE float raw : -1.0f ~ +1.0f)
#define PCM_RAW_FLOAT64  0x0A // Output float 64bit raw (Not implement)
#define PCM_RAW_RAWFLOAT 0x0F // Output float 32bit (incompatible raw : -32767.0f ~ +32768.0f)
#define PCM_WAV_SINT8    0x11 // Output signed int 8bit wav (Not implement)
#define PCM_WAV_SINT16   0x12 // Output signed int 16bit wav
#define PCM_WAV_SINT24   0x13 // Output signed int 24bit wav
#define PCM_WAV_SINT32   0x14 // Output signed int 32bit wav (Not implement)
#define PCM_WAV_UINT8    0x15 // Output unsigned int 8bit wav (Not implement)
#define PCM_WAV_UINT16   0x16 // Output unsigned int 16bit wav (Not implement)
#define PCM_WAV_UINT24   0x17 // Output unsigned int 24bit wav (Not implement)
#define PCM_WAV_UINT32   0x18 // Output unsigned int 32bit wav (Not implement)
#define PCM_WAV_FLOAT32  0x19 // Output float 32bit wav (IEEE float raw : -1.0f ~ +1.0f)
#define PCM_WAV_FLOAT64  0x1A // Output float 64bit wav (Not implement)

// SaveMicRaw / SaveSepRaw parameters for WAV format header
#define WAVE_HEADER_RIFF          0x46464952 // "RIFF" - little endian
#define WAVE_HEADER_WAVE          0x45564157 // "WAVE" - little endian
#define WAVE_HEADER_FMT           0x20746D66 // "fmt " - little endian
#define WAVE_HEADER_DATA          0x61746164 // "data" - little endian
//"fmt " parameters
#define WAVE_HEADER_FMT_SIZE      0x00000010 // "fmt " chunk size is 16Byte
#define WAVE_PARAM_FMT_PCM        0x00000001 // format - convert int16_t to int32_t
#define WAVE_PARAM_FMT_IEEE_FLOAT 0x00000003 // format - convert int16_t to int32_t
#define WAVE_PARAM_SR_8000        0x00001F40
#define WAVE_PARAM_SR_11025       0x00002B11
#define WAVE_PARAM_SR_16000       0x00003E80
#define WAVE_PARAM_SR_22050       0x00005622
#define WAVE_PARAM_SR_32000       0x00007D00
#define WAVE_PARAM_SR_44100       0x0000AC44
#define WAVE_PARAM_SR_48000       0x0000BB80
#define WAVE_PARAM_SR_96000       0x00017700
#define WAVE_PARAM_SR_192000      0x0002EE00
#define WAVE_PARAM_BLOCK_BITS_8   0x00000001 // blockalign (0x0001 * CH) - convert int16_t to int32_t
#define WAVE_PARAM_BLOCK_BITS_16  0x00000002 // blockalign (0x0002 * CH) - convert int16_t to int32_t
#define WAVE_PARAM_BLOCK_BITS_24  0x00000003 // blockalign (0x0003 * CH) - convert int16_t to int32_t
#define WAVE_PARAM_BLOCK_BITS_32  0x00000004 // blockalign (0x0004 * CH) - convert int16_t to int32_t
#define WAVE_PARAM_BITS_8         0x00080000 // bitswidth ( 8 << 16) - convert int16_t to int32_t
#define WAVE_PARAM_BITS_16        0x00100000 // bitswidth (16 << 16) - convert int16_t to int32_t
#define WAVE_PARAM_BITS_24        0x00180000 // bitswidth (24 << 16) - convert int16_t to int32_t
#define WAVE_PARAM_BITS_32        0x00200000 // bitswidth (32 << 16) - convert int16_t to int32_t
// Example :: Case of SaveMicRaw (signed int 24bit)
// fmt[0] = WAVE_HEADER_FMT;
// fmt[1] = WAVE_HEADER_FMT_SIZE;
// fmt[2] = (_CH_VAL_ << 16) | WAVE_PARAM_FMT_PCM;
// fmt[3] = WAVE_PARAM_SR_16000;
// fmt[4] = WAVE_PARAM_SR_16000 * WAVE_PARAM_BLOCK_BITS_24 * _CH_VAL_;
// fmt[5] = WAVE_PARAM_BITS_24 | (WAVE_PARAM_BLOCK_BITS_24 * _CH_VAL_);
// Example :: Case of SaveSepRaw (signed int 16bit)
// fmt[0] = WAVE_HEADER_FMT;
// fmt[1] = WAVE_HEADER_FMT_SIZE;
// fmt[2] = 0x00010000 | WAVE_PARAM_FMT_PCM;
// fmt[3] = WAVE_PARAM_SR_16000;
// fmt[4] = WAVE_PARAM_SR_16000 * WAVE_PARAM_BLOCK_BITS_16;
// fmt[5] = WAVE_PARAM_BITS_16 | WAVE_PARAM_BLOCK_BITS_16;
// Example :: Case of SaveSepRaw (float 32bit)
// fmt[0] = WAVE_HEADER_FMT;
// fmt[1] = WAVE_HEADER_FMT_SIZE;
// fmt[2] = 0x00010000 | WAVE_PARAM_FMT_IEEE_FLOAT;
// fmt[3] = WAVE_PARAM_SR_16000;
// fmt[4] = WAVE_PARAM_SR_16000 * WAVE_PARAM_BLOCK_BITS_32;
// fmt[5] = WAVE_PARAM_BITS_32 | WAVE_PARAM_BLOCK_BITS_32;

// SaveSepFeature flags, which is indicated by the contents of the HParam.h of HTK Tools
#define FEATURE_SAVE_NONE  0x0000 // no output
#define FEATURE_SAVE_NOSMN 0x0001 // output without spectrum mean normalize
#define FEATURE_SAVE_SMN   0x0002 // output with spectrum mean normalize

// SaveFeatureType flags, which is indicated by the contents of the HParam.h of HTK Tools
#define FEATURE_NOHEADER 0x0000 // No header
#define FEATURE_MFCC     0x0006 // MFCC
#define FEATURE_USER     0x0009 // USER (for MSLS)
#define FEATURE_USE_E    0x0040 // _E : log energy included
#define FEATURE_USE_N    0x0080 // _N : absolute energy suppressed
#define FEATURE_USE_D    0x0100 // _D : delta coef appended
#define FEATURE_USE_A    0x0200 // _A : acceleration coefs appended
#define FEATURE_USE_C    0x0400 // _C : is compressed
#define FEATURE_USE_Z    0x0800 // _Z : zero meaned
#define FEATURE_USE_K    0x1000 // _K : has CRC check
#define FEATURE_USE_0    0x2000 // _0 : 0'th Cepstra included
#define FEATURE_USE_V    0x4000 // _V : has VQ index attached
#define FEATURE_USE_T    0x8000 // _T : has Delta-Delta-Delta index attached
#define FEATURE_MASK     0x003F // Mask to remove qualifiers


//
#define PARAM_LM_NONE                      0x00
#define PARAM_LM_MUSIC_ALGORITHM           0x01
#define PARAM_LM_LENGTH                    0x02
#define PARAM_LM_SAMPLING_RATE             0x03
#define PARAM_LM_WINDOW                    0x04
#define PARAM_LM_PERIOD                    0x05
#define PARAM_LM_ELEVATION                 0x06
#define PARAM_LM_NUM_SOURCE                0x07
#define PARAM_LM_EXPORT_NUM_SOURCE         0x08
#define PARAM_LM_SPECTRUM_WEGHT_TYPE       0x09
#define PARAM_LM_LOW_BOUND_FREQUENCY       0x0A
#define PARAM_LM_UPPER_BOUND_FREQUENCY     0x0B
#define PARAM_LM_MIN_DEG                   0x0C
#define PARAM_LM_MAX_DEG                   0x0D
#define PARAM_LM_A_CHAR_SCALING            0x0E
#define PARAM_LM_ENABLE_EIGENVALUE_WEIGHT  0x0F
#define PARAM_LM_SPLINE_NUM                0x10
#define PARAM_LM_SQUARE_NUM                0x11
#define PARAM_LM_TF_CHANNEL_NUM            0x12
#define PARAM_LM_TF_CHANNEL_SELECTION      0x13
#define PARAM_LM_A_MATRIX                  0x14
#define PARAM_LM_RESERVED                  0xFF

#define VALUE_LM_MUSIC_ALGORITHM_UNKNOWN   0x00
#define VALUE_LM_MUSIC_ALGORITHM_SEVD      0x01
#define VALUE_LM_MUSIC_ALGORITHM_GEVD      0x02
#define VALUE_LM_MUSIC_ALGORITHM_GSVD      0x03 // default

#define VALUE_LM_SAMPLING_RATE_UNKNOWN     0
#define VALUE_LM_SAMPLING_RATE_8000        8000
#define VALUE_LM_SAMPLING_RATE_11025       11025
#define VALUE_LM_SAMPLING_RATE_16000       16000 // default
#define VALUE_LM_SAMPLING_RATE_22050       22050
#define VALUE_LM_SAMPLING_RATE_32000       32000
#define VALUE_LM_SAMPLING_RATE_44100       44100
#define VALUE_LM_SAMPLING_RATE_48000       48000
#define VALUE_LM_SAMPLING_RATE_96000       96000
#define VALUE_LM_SAMPLING_RATE_192000      192000

#define VALUE_LM_SPECTRUM_WEGHT_TYPE_UNKNOWN          0x00
#define VALUE_LM_SPECTRUM_WEGHT_TYPE_UNIFORM          0x01 // default
#define VALUE_LM_SPECTRUM_WEGHT_TYPE_A_CHARACTERISTIC 0x02
#define VALUE_LM_SPECTRUM_WEGHT_TYPE_MANUAL_SPLINE    0x03
#define VALUE_LM_SPECTRUM_WEGHT_TYPE_MANUAL_SQUARE    0x04

#define PARAM_LM_CONSTANT        0x00
#define PARAM_LM_CONSTANT_FILTER 0x00
#define dummy3
#define dummy4
#define dummy5
#define dummy6
#define dummy7
#define dummy8
#define dummy9
#define dummy0





