4
pylintrc
4
pylintrc
@@ -307,8 +307,8 @@ min-public-methods=2
|
|||||||
[EXCEPTIONS]
|
[EXCEPTIONS]
|
||||||
|
|
||||||
# Exceptions that will emit a warning when caught.
|
# Exceptions that will emit a warning when caught.
|
||||||
overgeneral-exceptions=BaseException,
|
overgeneral-exceptions=builtins.BaseException,
|
||||||
Exception
|
builtins.Exception
|
||||||
|
|
||||||
|
|
||||||
[FORMAT]
|
[FORMAT]
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
Communicate package.
|
Communicate package.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
import ssl
|
import ssl
|
||||||
@@ -152,7 +151,9 @@ def split_text_by_byte_length(
|
|||||||
yield new_text
|
yield new_text
|
||||||
|
|
||||||
|
|
||||||
def mkssml(text: Union[str, bytes], voice: str, rate: str, volume: str, pitch: str) -> str:
|
def mkssml(
|
||||||
|
text: Union[str, bytes], voice: str, rate: str, volume: str, pitch: str
|
||||||
|
) -> str:
|
||||||
"""
|
"""
|
||||||
Creates a SSML string from the given parameters.
|
Creates a SSML string from the given parameters.
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
Main package.
|
Main package.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import asyncio
|
import asyncio
|
||||||
import sys
|
import sys
|
||||||
@@ -60,9 +59,9 @@ async def _run_tts(args: Any) -> None:
|
|||||||
pitch=args.pitch,
|
pitch=args.pitch,
|
||||||
)
|
)
|
||||||
subs: SubMaker = SubMaker()
|
subs: SubMaker = SubMaker()
|
||||||
with open(
|
with (
|
||||||
args.write_media, "wb"
|
open(args.write_media, "wb") if args.write_media else sys.stdout.buffer
|
||||||
) if args.write_media else sys.stdout.buffer as audio_file:
|
) as audio_file:
|
||||||
async for chunk in tts.stream():
|
async for chunk in tts.stream():
|
||||||
if chunk["type"] == "audio":
|
if chunk["type"] == "audio":
|
||||||
audio_file.write(chunk["data"])
|
audio_file.write(chunk["data"])
|
||||||
|
|||||||
Reference in New Issue
Block a user