feat: implement QuestionBank CRUD with pagination and template query
- Add pagination support to findAll (page, limit query params) - Add findByTemplateId method to service - Add GET /by-template/:templateId endpoint to controller - Service already includes CRUD for QuestionBank and QuestionBankItem
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import asyncio
|
||||
import argparse
|
||||
import edge_tts
|
||||
|
||||
async def generate_speech(text, voice, output_file):
|
||||
communicate = edge_tts.Communicate(text, voice)
|
||||
await communicate.save(output_file)
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(description='Text to Speech using Edge TTS')
|
||||
parser.add_argument('--text', required=True, help='Text to convert to speech')
|
||||
parser.add_argument('--voice', required=True, help='Voice to use (e.g., zh-CN-YunxiNeural)')
|
||||
parser.add_argument('--output', required=True, help='Output MP3 file path')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
try:
|
||||
asyncio.run(generate_speech(args.text, args.voice, args.output))
|
||||
print(f"Success: {args.output}")
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
exit(1)
|
||||
Reference in New Issue
Block a user