package com.ruoyi.web.controller.smartor.tools; import com.ruoyi.common.core.controller.BaseController; import com.smartor.service.PersonVoiceService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.Map; /** * 人工语音Controller * * @author ls * @date 2023-11-17 */ @Api(description = "语音合成转换") @RestController @RequestMapping("/smartor/voice") public class PersonVoiceController extends BaseController { @Autowired private PersonVoiceService personVoiceService; @ApiOperation("语音转文字") @GetMapping("/speechtotext") public Map speechtotext(@RequestParam("filePath") String filePath) { String recognizerListener = personVoiceService.speechtotext(filePath); return success(recognizerListener); } @ApiOperation("文字转语音") @GetMapping("/texttospeech") public Map texttospeech(@RequestParam("textspeech") String textspeech, @RequestParam("filePath") String filePath) { String recognizerListener = personVoiceService.texttospeech(textspeech, filePath); return success(recognizerListener); } @ApiOperation("html文件处理") @GetMapping("/explainHTML") public Map explainHTML() { Boolean aBoolean = personVoiceService.explainHTML(); return success(aBoolean); } }