voicevox

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2022 License: MIT Imports: 7 Imported by: 1

README

aethiopicuschan/voicevox

Golang client for voicevox_engine API.

Getting Started

go get github.com/aethiopicuschan/voicevox

Usage

package main

import "github.com/aethiopicuschan/voicevox"

func main() {
  client := voicevox.NewClient("http", "127.0.0.1:50021")
  ...
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccentPhrases

type AccentPhrases struct {
	Moras           []Mora `json:"moras"`
	Accent          int    `json:"accent"`
	PauseMora       *Mora  `json:"pause_mora"`
	IsInterrogative *bool  `json:"is_interrogative"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(scheme string, host string) *Client

func (*Client) AddUserDictWord

func (c *Client) AddUserDictWord(surface string, pronunciation string, accentType int, wordType *string, priority *int) (uuid string, err error)

その他 > Add User Dict Word https://voicevox.github.io/voicevox_engine/api/#tag/%E3%83%A6%E3%83%BC%E3%82%B6%E3%83%BC%E8%BE%9E%E6%9B%B8/operation/add_user_dict_word_user_dict_word_post

func (*Client) CreateQuery

func (c *Client) CreateQuery(speaker int, text string) (*Query, error)

クエリ作成 > 音声合成用のクエリを作成する https://voicevox.github.io/voicevox_engine/api/#tag/%E3%82%AF%E3%82%A8%E3%83%AA%E4%BD%9C%E6%88%90/operation/audio_query_audio_query_post

func (*Client) CreateQueryWithPreset

func (c *Client) CreateQueryWithPreset(preset int, text string) (*Query, error)

クエリ作成 > 音声合成用のクエリをプリセットを用いて作成する https://voicevox.github.io/voicevox_engine/api/#tag/%E3%82%AF%E3%82%A8%E3%83%AA%E4%BD%9C%E6%88%90/operation/audio_query_from_preset_audio_query_from_preset_post

func (*Client) CreateVoice

func (c *Client) CreateVoice(speaker int, enableInterrogativeUpspeak bool, query *Query) (wav []byte, err error)

音声合成 > 音声合成する https://voicevox.github.io/voicevox_engine/api/#tag/%E9%9F%B3%E5%A3%B0%E5%90%88%E6%88%90/operation/synthesis_synthesis_post

func (*Client) CreateVoiceMorphing

func (c *Client) CreateVoiceMorphing(base int, target int, rate float64, query *Query) (wav []byte, err error)

音声合成 > 2人の話者でモーフィングした音声を合成する https://voicevox.github.io/voicevox_engine/api/#tag/%E9%9F%B3%E5%A3%B0%E5%90%88%E6%88%90/operation/_synthesis_morphing_synthesis_morphing_post

func (*Client) CreateVoiceMulti

func (c *Client) CreateVoiceMulti(speaker int, query *Query) (zip []byte, err error)

音声合成 > 複数まとめて音声合成する https://voicevox.github.io/voicevox_engine/api/#tag/%E9%9F%B3%E5%A3%B0%E5%90%88%E6%88%90/operation/multi_synthesis_multi_synthesis_post

func (*Client) GetAccentPhrases

func (c *Client) GetAccentPhrases(speaker int, text string, isKana bool) (*[]AccentPhrases, error)

クエリ編集 > テキストからアクセント句を得る https://voicevox.github.io/voicevox_engine/api/#tag/%E3%82%AF%E3%82%A8%E3%83%AA%E7%B7%A8%E9%9B%86/operation/accent_phrases_accent_phrases_post

func (*Client) GetPhonemeLength

func (c *Client) GetPhonemeLength(speaker int, accentPhrases *[]AccentPhrases) (*[]AccentPhrases, error)

クエリ編集 > アクセント句から音素長を得る https://voicevox.github.io/voicevox_engine/api/#tag/%E3%82%AF%E3%82%A8%E3%83%AA%E7%B7%A8%E9%9B%86/operation/mora_length_mora_length_post

func (*Client) GetPitch

func (c *Client) GetPitch(speaker int, accentPhrases *[]AccentPhrases) (*[]AccentPhrases, error)

クエリ編集 > アクセント句から音高を得る https://voicevox.github.io/voicevox_engine/api/#tag/%E3%82%AF%E3%82%A8%E3%83%AA%E7%B7%A8%E9%9B%86/operation/mora_pitch_mora_pitch_post

func (*Client) GetPitchAndPhonemeLength

func (c *Client) GetPitchAndPhonemeLength(speaker int, accentPhrases *[]AccentPhrases) (*[]AccentPhrases, error)

クエリ編集 > アクセント句から音高・音素長を得る https://voicevox.github.io/voicevox_engine/api/#tag/%E3%82%AF%E3%82%A8%E3%83%AA%E7%B7%A8%E9%9B%86/operation/mora_data_mora_data_post

func (*Client) MargeWav

func (c *Client) MargeWav(wavs []string) (wav []byte, err error)

その他 > base64エンコードされた複数のwavデータを一つに結合する https://voicevox.github.io/voicevox_engine/api/#tag/%E3%81%9D%E3%81%AE%E4%BB%96/operation/connect_waves_connect_waves_post

func (*Client) RewriteUserDictWord

func (c *Client) RewriteUserDictWord(uuid string, surface string, pronunciation string, accentType int, wordType *string, priority *int) (err error)

その他 > Rewrite User Dict Word https://voicevox.github.io/voicevox_engine/api/#tag/%E3%83%A6%E3%83%BC%E3%82%B6%E3%83%BC%E8%BE%9E%E6%9B%B8/operation/rewrite_user_dict_word_user_dict_word__word_uuid__put

type Dict

type Dict map[string]DictWord

type DictWord

type DictWord struct {
	Surface               string `json:"surface"`
	Priority              int    `json:"priority"`
	ContextId             *int   `json:"context_id"`
	PartOfSpeech          string `json:"part_of_speech"`
	PartOfSpeechDetail1   string `json:"part_of_speech_detail_1"`
	PartOfSpeechDetail2   string `json:"part_of_speech_detail_2"`
	PartOfSpeechDetail3   string `json:"part_of_speech_detail_3"`
	InflectionalType      string `json:"inflectional_type"`
	InflectionalForm      string `json:"inflectional_form"`
	Stem                  string `json:"stem"`
	Yomi                  string `json:"yomi"`
	Pronunciation         string `json:"pronunciation"`
	AccentType            int    `json:"accent_type"`
	MoraCount             *int   `json:"mora_count"`
	AccentAssociativeRule string `json:"accent_associative_rule"`
}

type Mora

type Mora struct {
	Text            string   `json:"text"`
	Consonant       *string  `json:"consonant"`
	ConsonantLength *float64 `json:"consonant_length"`
	Vowel           string   `json:"vowel"`
	VowelLength     float64  `json:"vowel_length"`
	Pitch           float64  `json:"pitch"`
}

type Preset

type Preset struct {
	Id                int     `json:"id"`
	Name              string  `json:"name"`
	SpeakerUuid       string  `json:"speaker_uuid"`
	StyleId           int     `json:"style_id"`
	SpeedScale        float64 `json:"speedScale"`
	PitchScale        float64 `json:"pitchScale"`
	IntonationScale   float64 `json:"intonationScale"`
	VolumeScale       float64 `json:"volumeScale"`
	PrePhonemeLength  float64 `json:"prePhonemeLength"`
	PostPhonemeLength float64 `json:"postPhonemeLength"`
}

type Query

type Query struct {
	AccentPhrases      []AccentPhrases `json:"accent_phrases"`
	SpeedScale         float64         `json:"speedScale"`
	PitchScale         float64         `json:"pitchScale"`
	IntonationScale    float64         `json:"intonationScale"`
	VolumeScale        float64         `json:"volumeScale"`
	PrePhonemeLength   float64         `json:"prePhonemeLength"`
	PostPhonemeLength  float64         `json:"postPhonemeLength"`
	OutputSamplingRate int             `json:"outputSamplingRate"`
	OutputStereo       bool            `json:"outputStereo"`
	Kana               *string         `json:"kana"`
}

type Speaker

type Speaker struct {
	Name        string  `json:"name"`
	SpeakerUuid string  `json:"speaker_uuid"`
	Version     *string `json:"version"`
	Styles      []Style `json:"styles"`
}

type SpeakerInfo

type SpeakerInfo struct {
	Policy     string      `json:"policy"`
	Portrait   string      `json:"portrait"`
	StyleInfos []StyleInfo `json:"style_infos"`
}

type Style

type Style struct {
	Name string `json:"name"`
	Id   int    `json:"id"`
}

type StyleInfo

type StyleInfo struct {
	Id          int      `json:"id"`
	Icon        string   `json:"icon"`
	VoiceSample []string `json:"voice_samples"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL