-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Initial support for TTS functionality #14716
base: develop
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #14716 +/- ##
============================================
- Coverage 41.74% 23.75% -17.99%
============================================
Files 1549 725 -824
Lines 196555 108491 -88064
Branches 2767 1059 -1708
============================================
- Hits 82055 25777 -56278
+ Misses 113939 82165 -31774
+ Partials 561 549 -12 ☔ View full report in Codecov by Sentry. |
このPRによるapi.jsonの差分 差分はこちら--- base
+++ head
@@ -157,6 +157,9 @@
"translatorAvailable": {
"type": "boolean"
},
+ "ttsAvailable": {
+ "type": "boolean"
+ },
"silencedHosts": {
"type": "array",
"items": {
@@ -449,6 +452,75 @@
"deeplIsPro": {
"type": "boolean"
},
+ "hfAuthKey": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "hfSpace": {
+ "type": "boolean"
+ },
+ "hfSpaceName": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "hfexampleAudioURL": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "hfexampleText": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "hfexampleLang": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "hfslice": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "hftopK": {
+ "type": [
+ "number",
+ "null"
+ ]
+ },
+ "hftopP": {
+ "type": [
+ "number",
+ "null"
+ ]
+ },
+ "hfTemperature": {
+ "type": [
+ "number",
+ "null"
+ ]
+ },
+ "hfSpeedRate": {
+ "type": [
+ "number",
+ "null"
+ ]
+ },
+ "hfnrm": {
+ "type": "boolean"
+ },
+ "hfdas": {
+ "type": "boolean"
+ },
"defaultDarkTheme": {
"type": [
"string",
@@ -607,6 +679,7 @@
"enableEmail",
"enableServiceWorker",
"translatorAvailable",
+ "ttsAvailable",
"mediaSilencedHosts",
"pinnedUsers",
"hiddenTags",
@@ -668,6 +741,19 @@
"backgroundImageUrl",
"deeplAuthKey",
"deeplIsPro",
+ "hfAuthKey",
+ "hfSpace",
+ "hfSpaceName",
+ "hfexampleAudioURL",
+ "hfexampleText",
+ "hfexampleLang",
+ "hfslice",
+ "hftopK",
+ "hftopP",
+ "hfTemperature",
+ "hfSpeedRate",
+ "hfnrm",
+ "hfdas",
"defaultDarkTheme",
"defaultLightTheme",
"description",
@@ -14047,6 +14133,71 @@
"deeplIsPro": {
"type": "boolean"
},
+ "hfAuthKey": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "hfSpace": {
+ "type": "boolean",
+ "default": false
+ },
+ "hfSpaceName": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "hfexampleAudioURL": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "hfexampleText": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "hfexampleLang": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "hfslice": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "default": "Slice once every 4 sentences"
+ },
+ "hftopK": {
+ "type": "integer",
+ "default": 15
+ },
+ "hftopP": {
+ "type": "integer",
+ "default": 100
+ },
+ "hfTemperature": {
+ "type": "integer",
+ "default": 100
+ },
+ "hfnrm": {
+ "type": "boolean",
+ "default": false
+ },
+ "hfSpeedRate": {
+ "type": "integer",
+ "default": 125
+ },
+ "hfdas": {
+ "type": "boolean",
+ "default": false
+ },
"enableEmail": {
"type": "boolean"
},
@@ -50281,6 +50432,9 @@
"isCat": {
"type": "boolean"
},
+ "isVI": {
+ "type": "boolean"
+ },
"injectFeaturedNote": {
"type": "boolean"
},
@@ -61222,6 +61376,201 @@
}
}
},
+ "/notes/tts": {
+ "post": {
+ "operationId": "notes___tts",
+ "summary": "notes/tts",
+ "description": "No description provided.\n\n**Credential required**: *Yes* / **Permission**: *read:account*",
+ "externalDocs": {
+ "description": "Source code",
+ "url": "https://github.com/misskey-dev/misskey/blob/develop/packages/backend/src/server/api/endpoints/notes/tts.ts"
+ },
+ "tags": [
+ "notes"
+ ],
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "noteId": {
+ "type": "string",
+ "format": "misskey:id"
+ }
+ },
+ "required": [
+ "noteId"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "OK (with results)",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "string",
+ "contentMediaType": "audio/flac"
+ }
+ }
+ }
+ },
+ "204": {
+ "description": "OK (without any results)"
+ },
+ "400": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "INCORRECT_CONFIG": {
+ "value": {
+ "error": {
+ "message": "Incorrect configuration.",
+ "code": "INCORRECT_CONFIG",
+ "id": "8d171e60-83b8-11ef-b98c-a7506d6c1de4"
+ }
+ }
+ },
+ "UNAVAILABLE": {
+ "value": {
+ "error": {
+ "message": "Convert of notes unavailable.",
+ "code": "UNAVAILABLE",
+ "id": "97a0826c-6393-11ef-a650-67972d710975"
+ }
+ }
+ },
+ "NO_SUCH_NOTE": {
+ "value": {
+ "error": {
+ "message": "No such note.",
+ "code": "NO_SUCH_NOTE",
+ "id": "bea9b03f-36e0-49c5-a4db-627a029f8971"
+ }
+ }
+ },
+ "CANNOT_CONVERT_INVISIBLE_NOTE": {
+ "value": {
+ "error": {
+ "message": "Cannot convert invisible note.",
+ "code": "CANNOT_CONVERT_INVISIBLE_NOTE",
+ "id": "f57caae0-6394-11ef-8e2a-d706932c1030"
+ }
+ }
+ },
+ "INVALID_PARAM": {
+ "value": {
+ "error": {
+ "message": "Invalid param.",
+ "code": "INVALID_PARAM",
+ "id": "3d81ceae-475f-4600-b2a8-2bc116157532"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Authentication error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "CREDENTIAL_REQUIRED": {
+ "value": {
+ "error": {
+ "message": "Credential required.",
+ "code": "CREDENTIAL_REQUIRED",
+ "id": "1384574d-a912-4b81-8601-c7b1c4085df1"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "AUTHENTICATION_FAILED": {
+ "value": {
+ "error": {
+ "message": "Authentication failed. Please ensure your token is correct.",
+ "code": "AUTHENTICATION_FAILED",
+ "id": "b0a7f5f8-dc2f-4171-b91f-de88ad238e14"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "418": {
+ "description": "I'm Ai",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "I_AM_AI": {
+ "value": {
+ "error": {
+ "message": "You sent a request to Ai-chan, Misskey's showgirl, instead of the server.",
+ "code": "I_AM_AI",
+ "id": "60c46cd1-f23a-46b1-bebe-5d2b73951a84"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Internal server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "INTERNAL_ERROR": {
+ "value": {
+ "error": {
+ "message": "Internal error occurred. Please contact us if the error persists.",
+ "code": "INTERNAL_ERROR",
+ "id": "5d37dbcb-891e-41ca-a3d6-e690c97775ac"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
"/notes/unrenote": {
"post": {
"operationId": "notes___unrenote",
@@ -77132,6 +77481,9 @@
"isCat": {
"type": "boolean"
},
+ "isVI": {
+ "type": "boolean"
+ },
"instance": {
"type": "object",
"properties": {
@@ -81191,6 +81543,7 @@
"isLocked",
"isBot",
"isCat",
+ "isVI",
"isExplorable"
]
}
@@ -81483,6 +81836,9 @@
"canUseTranslator": {
"type": "boolean"
},
+ "canUseTTS": {
+ "type": "boolean"
+ },
"canHideAds": {
"type": "boolean"
},
@@ -81554,6 +81910,7 @@
"canManageAvatarDecorations",
"canSearchNotes",
"canUseTranslator",
+ "canUseTTS",
"canHideAds",
"driveCapacityMb",
"alwaysMarkNsfw",
@@ -82097,6 +82454,9 @@
"translatorAvailable": {
"type": "boolean"
},
+ "ttsAvailable": {
+ "type": "boolean"
+ },
"mediaProxy": {
"type": "string"
},
@@ -82201,6 +82561,7 @@
"enableEmail",
"enableServiceWorker",
"translatorAvailable",
+ "ttsAvailable",
"mediaProxy",
"enableUrlPreview",
"backgroundImageUrl", |
I think we should discuss the feature first (especially large scale one like this) in an issue before actually implement it |
|
What
This is an initial implementation of the TTS functionality, which can subsequently be built upon to improve ease of use, add providers (the existing ones can actually be deployed on our own), and even be set up by the user.
Why
Hopefully it can be an emergency measure for some of the population at some point.
Additional info (optional)
It is currently only a preliminary realization, so only a rough framework has been formed.
Checklist
Thanks to @MarryDream for the guidance in implementing the feature.