-
Notifications
You must be signed in to change notification settings - Fork 1
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
[FEATURE] gpt 결과물 & SSML 연결 작업 #23
Conversation
수고하셨습니다 🤝 |
byte[] audioBytes = Base64.getDecoder().decode(audioContent); | ||
//S3 설정 후 변경 예정 | ||
String rand= UUID.randomUUID().toString(); | ||
String outputFilePath = "src/main/resources/speech/" + rand + ".mp3"; | ||
try (OutputStream out = new FileOutputStream(outputFilePath)) { | ||
out.write(audioBytes); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
return "success"; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다 잘 작동하네용 👍
requestSpeech()
함수 부분 읽으면서 든 생각 몇 가지 있는데 괜찮다 싶으면 적용해주세요
outputFilePath
같은 건 함수 윗 부분이나 static 변수로 따로 빼는 게 어떨지"success"
를 반환하기보단, 생성된 파일명 등을 return하는 게 어떨지 (이후 스트리밍 등에 사용할 테니까)- 파일 저장 중 예외 발생 시 콘솔 출력 후 끝나는데, 새로운 RuntimeException 등을 던지는 게 어떨지
- 지금은 에러만 출력한 후 똑같이
return "success";
를 거쳐서 정상적인 흐름으로 넘어가는데,
파일 저장을 못하면 여기서 흐름을 끊어버리는 게 맞다고 생각해요 - 그래서 RuntimeException을 새로 던져서 상위의
CastService
나ExceptionAdvice
등에서 처리하도록 두는 게 더 나을 거 같습니다 - 교수님이 '처리 못할 예외는 다시 던져라`라고 강조하시는 걸 여러 번 들어서 적음..
- 지금은 에러만 출력한 후 똑같이
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- S3 설정 후 어짜피 바꿀 로직이여서 일단 그냥 두겠습니다!
- 반환하는 부분 파일명 반환으로 바꾸고 번역 기능 마무리 후에 exception 처리 하겠습니다아
Map<String, Object> voice = new HashMap<>(); | ||
voice.put("name", ttsdto.getVoice()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
voice default 처리...
사실 enum 처리를 하는 방법도 있는데 나아중에 이야기 해봅시다ㅋㅋㅋ
ResponseEntity<Map> response = restTemplate.exchange(url, HttpMethod.POST, entity, Map.class); | ||
String audioContent = (String) response.getBody().get("audioContent"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
그리고 궁금한 점 있는데
Google API 읽어보니까 response
에서 timepoints
로 문장별 시작시간 접근할 수 있는 거 맞죠??
요 timepoints
들을 어디다 저장해야할지 모르겠네
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
네네 따로 사진 보내드린 것처럼 나오는데 아무래도 sentence에 저장하는게 맞지 않을까요??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sentence에 칼럼 새로 추가해서요??
낫배드
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넴 반영할게요~
DONE
TODO