Class: Voicevox::CharacterInfo

Inherits:
Struct
  • Object
show all
Defined in:
lib/voicevox/wrapper/info.rb

Overview

キャラクターの情報を表すStruct。

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



10
11
12
# File 'lib/voicevox/wrapper/info.rb', line 10

def name
  @name
end

#speaker_uuidObject

Returns the value of attribute speaker_uuid

Returns:

  • (Object)

    the current value of speaker_uuid



10
11
12
# File 'lib/voicevox/wrapper/info.rb', line 10

def speaker_uuid
  @speaker_uuid
end

#stylesObject

Returns the value of attribute styles

Returns:

  • (Object)

    the current value of styles



10
11
12
# File 'lib/voicevox/wrapper/info.rb', line 10

def styles
  @styles
end

#versionObject

Returns the value of attribute version

Returns:

  • (Object)

    the current value of version



10
11
12
# File 'lib/voicevox/wrapper/info.rb', line 10

def version
  @version
end

Instance Method Details

#idInteger

Note:

ほとんどの場合はノーマルになります。

キャラクターの最初のスタイルのIDを返します。

Returns:

  • (Integer)

    スタイルのID。



18
19
20
# File 'lib/voicevox/wrapper/info.rb', line 18

def id
  styles[0].id
end

#loadvoid

This method returns an undefined value.

キャラクターのスタイルを全てロードします。



36
37
38
39
# File 'lib/voicevox/wrapper/info.rb', line 36

def load
  Voicevox.initialize_required
  styles.map(&:load)
end

#loaded?Boolean

キャラクターのスタイルが全てロードされているかを返します。

Returns:

  • (Boolean)

    全てロードされている場合はtrue、そうでない場合はfalse。



27
28
29
# File 'lib/voicevox/wrapper/info.rb', line 27

def loaded?
  styles.map(&:loaded?).all?
end