Class: MsgSendSpeechData
- Inherits:
-
Object
- Object
- MsgSendSpeechData
- Defined in:
- lib/haruzira_sdk/MsgSendSpeechData.rb
Overview
<summary> 読み上げデータ送信メッセージ(0x03) </summary>
Instance Attribute Summary collapse
-
#age ⇒ Object
アクセサ定義.
-
#completion_notice_necessity ⇒ Object
アクセサ定義.
-
#data ⇒ Object
アクセサ定義.
-
#data_type ⇒ Object
アクセサ定義.
-
#DATA_TYPE_SSML ⇒ Object
readonly
アクセサ定義(送信メンバデータ値).
-
#DATA_TYPE_SSML_COMP ⇒ Object
readonly
アクセサ定義(送信メンバデータ値).
-
#DATA_TYPE_TEXT ⇒ Object
readonly
アクセサ定義(送信メンバデータ値).
-
#DATA_TYPE_TEXT_COMP ⇒ Object
readonly
アクセサ定義(送信メンバデータ値).
-
#enc_flg ⇒ Object
アクセサ定義.
-
#ENC_FLG_OFF ⇒ Object
readonly
アクセサ定義(送信メンバデータ値).
-
#ENC_FLG_ON ⇒ Object
readonly
アクセサ定義(送信メンバデータ値).
-
#gender ⇒ Object
アクセサ定義.
-
#GENDER_FEMALE ⇒ Object
readonly
アクセサ定義(送信メンバデータ値).
-
#GENDER_MALE ⇒ Object
readonly
アクセサ定義(送信メンバデータ値).
-
#GENDER_UNKNOWN ⇒ Object
readonly
アクセサ定義(送信メンバデータ値).
-
#head_len ⇒ Object
readonly
Returns the value of attribute head_len.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#INDEX_AGE ⇒ Object
readonly
アクセサ定義(メンバーIndex offset).
-
#INDEX_COMPLETION_NOTICE_NECESSITY ⇒ Object
readonly
アクセサ定義(メンバーIndex offset).
-
#INDEX_DATA_TYPE ⇒ Object
readonly
アクセサ定義(メンバーIndex offset).
-
#INDEX_ENC_FLG ⇒ Object
readonly
アクセサ定義(メンバーIndex offset).
-
#INDEX_GENDER ⇒ Object
readonly
アクセサ定義(メンバーIndex offset).
-
#INDEX_ID ⇒ Object
readonly
アクセサ定義(メンバーIndex offset).
-
#INDEX_LANG_CODE ⇒ Object
readonly
アクセサ定義(メンバーIndex offset).
-
#INDEX_NAME ⇒ Object
readonly
アクセサ定義(メンバーIndex offset).
-
#INDEX_NAME_LEN ⇒ Object
readonly
アクセサ定義(メンバーIndex offset).
-
#INDEX_PRIORITY ⇒ Object
readonly
アクセサ定義(メンバーIndex offset).
-
#INDEX_REPEAT ⇒ Object
readonly
アクセサ定義(メンバーIndex offset).
-
#INDEX_SIZE ⇒ Object
readonly
アクセサ定義(メンバーIndex offset).
-
#INDEX_TIME_STAMP ⇒ Object
readonly
アクセサ定義(メンバーIndex offset).
-
#lang_code ⇒ Object
アクセサ定義.
-
#LANG_LOW ⇒ Object
readonly
アクセサ定義(送信メンバデータ値).
-
#name ⇒ Object
アクセサ定義.
-
#name_len ⇒ Object
アクセサ定義.
-
#priority ⇒ Object
アクセサ定義.
-
#PRIORITY_HIGH ⇒ Object
readonly
アクセサ定義(送信メンバデータ値).
-
#PRIORITY_LOW ⇒ Object
readonly
アクセサ定義(送信メンバデータ値).
-
#PRIORITY_NORMAL ⇒ Object
readonly
アクセサ定義(送信メンバデータ値).
-
#repeat ⇒ Object
アクセサ定義.
-
#REPEAT_INFINITY ⇒ Object
readonly
アクセサ定義(送信メンバデータ値).
-
#REPEAT_NONE ⇒ Object
readonly
アクセサ定義(送信メンバデータ値).
-
#size ⇒ Object
アクセサ定義.
-
#time_stamp ⇒ Object
アクセサ定義.
-
#total_len ⇒ Object
readonly
Returns the value of attribute total_len.
Instance Method Summary collapse
-
#initialize ⇒ MsgSendSpeechData
constructor
A new instance of MsgSendSpeechData.
-
#makeSendData ⇒ Object
<summary> 送信データ生成 </summary> <returns>生成データサイズ, 生成データ</returns>.
Constructor Details
#initialize ⇒ MsgSendSpeechData
Returns a new instance of MsgSendSpeechData.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 10 def initialize() #region 変数・定数定義 #メンバーIndex offset定義 @INDEX_ID = 0 #メッセージID @INDEX_ENC_FLG = 1 #暗号化フラグ @INDEX_DATA_TYPE = 2 #データ区分(Text or SSML) @INDEX_PRIORITY = 3 #プライオリティ @INDEX_LANG_CODE = 4 #ロケールID(言語コード) @INDEX_GENDER = 6 #性別 @INDEX_AGE = 7 #年齢 @INDEX_REPEAT = 8 #リピート回数 @INDEX_TIME_STAMP = 9 #タイムスタンプ(00:00:00) @INDEX_COMPLETION_NOTICE_NECESSITY = 17 #読み上げ完了通知の送信要否 @INDEX_NAME_LEN = 18 #接続元名称サイズ @INDEX_SIZE = 20 #読み上げデータサイズ @INDEX_NAME = 24 #接続元名称(可変) # <summary> # 送信メンバデータ値定義 # </summary> #暗号化フラグ @ENC_FLG_OFF = 0x00 #暗号化無 @ENC_FLG_ON = 0x01 #暗号化有 #データ区分 @DATA_TYPE_TEXT = 0x00 #Text @DATA_TYPE_SSML = 0x01 #SSML @DATA_TYPE_TEXT_COMP = 0x10 #Text(圧縮データ) @DATA_TYPE_SSML_COMP = 0x11 #SSML(圧縮データ) #プライオリティ @PRIORITY_LOW = 0x00 #低い(読み上げない) @PRIORITY_NORMAL = 0x01 #通常(順次読み上げ) @PRIORITY_HIGH = 0x02 #高い(割り込み読み上げ) #@PRIORITY_EMARGENCY = 0x03 #緊急(最優先で割り込み読み上げ) #言語コード @LANG_LOW = 0x00 # #性別 @GENDER_FEMALE = 0x00 #女性 @GENDER_MALE = 0x01 #男性 @GENDER_UNKNOWN = 0x02 #中性 #性別 #AGE_6 = 0x06 #6歳 #繰り返し回数 @REPEAT_NONE = 0x00 #繰り返し無 @REPEAT_INFINITY = 0xff #繰り返し無限 @id = MSG_SEND_SPEECH_DATA #メッセージID @enc_flg = 0x00 #暗号化フラグ @data_type = 0x00 #データ区分(Text or SSML) @priority = 0x01 #プライオリティ @lang_code = 0x00 #ロケールID(言語コード) @gender = 0x00 #性別 @age = 0x00 #年齢 @repeat = 0x00 #リピート回数 @time_stamp = Array.new(8, 0x00) #タイムスタンプ(00:00:00) @completion_notice_necessity = 0x00 #読み上げ完了通知の送信要否(0x00:必要, 0x01:不要) @name_len = 0x00 #接続元名称サイズ @size = 0x00 #読み上げデータサイズ @name = nil #接続元名称(可変) @data = nil #データ(可変) @head_len = (1 * 4) + (2 + 1 * 12) + (2 + 4) #ヘッダーサイズ(読み上げデータを除いたサイズ) @total_len = 0 #送信フィールド合計サイズ #endregion end |
Instance Attribute Details
#age ⇒ Object
アクセサ定義
85 86 87 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 85 def age @age end |
#completion_notice_necessity ⇒ Object
アクセサ定義
85 86 87 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 85 def completion_notice_necessity @completion_notice_necessity end |
#data ⇒ Object
アクセサ定義
85 86 87 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 85 def data @data end |
#data_type ⇒ Object
アクセサ定義
85 86 87 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 85 def data_type @data_type end |
#DATA_TYPE_SSML ⇒ Object (readonly)
アクセサ定義(送信メンバデータ値)
80 81 82 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 80 def DATA_TYPE_SSML @DATA_TYPE_SSML end |
#DATA_TYPE_SSML_COMP ⇒ Object (readonly)
アクセサ定義(送信メンバデータ値)
80 81 82 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 80 def DATA_TYPE_SSML_COMP @DATA_TYPE_SSML_COMP end |
#DATA_TYPE_TEXT ⇒ Object (readonly)
アクセサ定義(送信メンバデータ値)
80 81 82 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 80 def DATA_TYPE_TEXT @DATA_TYPE_TEXT end |
#DATA_TYPE_TEXT_COMP ⇒ Object (readonly)
アクセサ定義(送信メンバデータ値)
80 81 82 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 80 def DATA_TYPE_TEXT_COMP @DATA_TYPE_TEXT_COMP end |
#enc_flg ⇒ Object
アクセサ定義
85 86 87 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 85 def enc_flg @enc_flg end |
#ENC_FLG_OFF ⇒ Object (readonly)
アクセサ定義(送信メンバデータ値)
80 81 82 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 80 def ENC_FLG_OFF @ENC_FLG_OFF end |
#ENC_FLG_ON ⇒ Object (readonly)
アクセサ定義(送信メンバデータ値)
80 81 82 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 80 def ENC_FLG_ON @ENC_FLG_ON end |
#gender ⇒ Object
アクセサ定義
85 86 87 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 85 def gender @gender end |
#GENDER_FEMALE ⇒ Object (readonly)
アクセサ定義(送信メンバデータ値)
80 81 82 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 80 def GENDER_FEMALE @GENDER_FEMALE end |
#GENDER_MALE ⇒ Object (readonly)
アクセサ定義(送信メンバデータ値)
80 81 82 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 80 def GENDER_MALE @GENDER_MALE end |
#GENDER_UNKNOWN ⇒ Object (readonly)
アクセサ定義(送信メンバデータ値)
80 81 82 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 80 def GENDER_UNKNOWN @GENDER_UNKNOWN end |
#head_len ⇒ Object (readonly)
Returns the value of attribute head_len.
87 88 89 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 87 def head_len @head_len end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
87 88 89 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 87 def id @id end |
#INDEX_AGE ⇒ Object (readonly)
アクセサ定義(メンバーIndex offset)
75 76 77 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 75 def INDEX_AGE @INDEX_AGE end |
#INDEX_COMPLETION_NOTICE_NECESSITY ⇒ Object (readonly)
アクセサ定義(メンバーIndex offset)
75 76 77 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 75 def INDEX_COMPLETION_NOTICE_NECESSITY @INDEX_COMPLETION_NOTICE_NECESSITY end |
#INDEX_DATA_TYPE ⇒ Object (readonly)
アクセサ定義(メンバーIndex offset)
75 76 77 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 75 def INDEX_DATA_TYPE @INDEX_DATA_TYPE end |
#INDEX_ENC_FLG ⇒ Object (readonly)
アクセサ定義(メンバーIndex offset)
75 76 77 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 75 def INDEX_ENC_FLG @INDEX_ENC_FLG end |
#INDEX_GENDER ⇒ Object (readonly)
アクセサ定義(メンバーIndex offset)
75 76 77 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 75 def INDEX_GENDER @INDEX_GENDER end |
#INDEX_ID ⇒ Object (readonly)
アクセサ定義(メンバーIndex offset)
75 76 77 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 75 def INDEX_ID @INDEX_ID end |
#INDEX_LANG_CODE ⇒ Object (readonly)
アクセサ定義(メンバーIndex offset)
75 76 77 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 75 def INDEX_LANG_CODE @INDEX_LANG_CODE end |
#INDEX_NAME ⇒ Object (readonly)
アクセサ定義(メンバーIndex offset)
75 76 77 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 75 def INDEX_NAME @INDEX_NAME end |
#INDEX_NAME_LEN ⇒ Object (readonly)
アクセサ定義(メンバーIndex offset)
75 76 77 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 75 def INDEX_NAME_LEN @INDEX_NAME_LEN end |
#INDEX_PRIORITY ⇒ Object (readonly)
アクセサ定義(メンバーIndex offset)
75 76 77 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 75 def INDEX_PRIORITY @INDEX_PRIORITY end |
#INDEX_REPEAT ⇒ Object (readonly)
アクセサ定義(メンバーIndex offset)
75 76 77 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 75 def INDEX_REPEAT @INDEX_REPEAT end |
#INDEX_SIZE ⇒ Object (readonly)
アクセサ定義(メンバーIndex offset)
75 76 77 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 75 def INDEX_SIZE @INDEX_SIZE end |
#INDEX_TIME_STAMP ⇒ Object (readonly)
アクセサ定義(メンバーIndex offset)
75 76 77 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 75 def INDEX_TIME_STAMP @INDEX_TIME_STAMP end |
#lang_code ⇒ Object
アクセサ定義
85 86 87 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 85 def lang_code @lang_code end |
#LANG_LOW ⇒ Object (readonly)
アクセサ定義(送信メンバデータ値)
80 81 82 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 80 def LANG_LOW @LANG_LOW end |
#name ⇒ Object
アクセサ定義
85 86 87 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 85 def name @name end |
#name_len ⇒ Object
アクセサ定義
85 86 87 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 85 def name_len @name_len end |
#priority ⇒ Object
アクセサ定義
85 86 87 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 85 def priority @priority end |
#PRIORITY_HIGH ⇒ Object (readonly)
アクセサ定義(送信メンバデータ値)
80 81 82 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 80 def PRIORITY_HIGH @PRIORITY_HIGH end |
#PRIORITY_LOW ⇒ Object (readonly)
アクセサ定義(送信メンバデータ値)
80 81 82 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 80 def PRIORITY_LOW @PRIORITY_LOW end |
#PRIORITY_NORMAL ⇒ Object (readonly)
アクセサ定義(送信メンバデータ値)
80 81 82 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 80 def PRIORITY_NORMAL @PRIORITY_NORMAL end |
#repeat ⇒ Object
アクセサ定義
85 86 87 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 85 def repeat @repeat end |
#REPEAT_INFINITY ⇒ Object (readonly)
アクセサ定義(送信メンバデータ値)
80 81 82 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 80 def REPEAT_INFINITY @REPEAT_INFINITY end |
#REPEAT_NONE ⇒ Object (readonly)
アクセサ定義(送信メンバデータ値)
80 81 82 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 80 def REPEAT_NONE @REPEAT_NONE end |
#size ⇒ Object
アクセサ定義
85 86 87 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 85 def size @size end |
#time_stamp ⇒ Object
アクセサ定義
85 86 87 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 85 def time_stamp @time_stamp end |
#total_len ⇒ Object (readonly)
Returns the value of attribute total_len.
87 88 89 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 87 def total_len @total_len end |
Instance Method Details
#makeSendData ⇒ Object
<summary> 送信データ生成</summary> <returns>生成データサイズ, 生成データ</returns>
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/haruzira_sdk/MsgSendSpeechData.rb', line 94 def makeSendData() @total_len = @head_len + @name_len + @size mdata = nil begin #ネットワークバイトオーダー後に、Byte配列に変換 bLangCode = [@lang_code].pack("n*").unpack("C*") bNameLen = [@name_len].pack("n*").unpack("C*") bSize = [@size].pack("N*").unpack("C*") if(@name != nil ) mdata = [@id] + [@enc_flg] + [@data_type] + [@priority] + bLangCode + [@gender] + [@age] + [@repeat] + \ @time_stamp + [@completion_notice_necessity] + bNameLen + bSize + @name + @data else mdata = [@id] + [@enc_flg] + [@data_type] + [@priority] + bLangCode + [@gender] + [@age] + [@repeat] + \ @time_stamp + [@completion_notice_necessity] + bNameLen + bSize + @data end rescue Exception => ex p ex @total_len = 0 ensure return @total_len, mdata end end |