You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
virtual-patient/virtual-patient-web/src/main/java/com/supervision/service/impl/AskServiceImpl.java

23 lines
600 B
Java

2 years ago
package com.supervision.service.impl;
import cn.hutool.core.codec.Base64;
import com.supervision.service.AskService;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
@Service
public class AskServiceImpl implements AskService {
@Override
public String receiveVoiceFile(MultipartFile file) throws IOException {
// 首先编码为base64编码
String encode = Base64.encode(file.getBytes());
// TODO 这里调用Python的接口,将文字转换为语音
return encode;
}
}