recordScore.js 645 B

123456789101112131415161718192021
  1. import { ToolVoiceEval } from '@/api/app';
  2. /**
  3. * 录音评分
  4. */
  5. export function recordSocreSingle(data) {
  6. return ToolVoiceEval({
  7. audio_bytes_base64: data.audio_paramter_type === 0 ? String(data.base64).replace(/^data:audio\/[^;]+;base64,/, '') : null,
  8. audio_file_id: data.audio_paramter_type === 1 ? data.base64 : null,
  9. text: data.text,
  10. audio_paramter_type: data.audio_paramter_type,
  11. is_attach_audio_url_user: 'true',
  12. is_attach_audio_url_standard: data.standard
  13. }).then((res) => {
  14. if (!res ) {
  15. throw new Error((res && (res.error || res.message)) || '评分接口失败');
  16. }
  17. return res;
  18. });
  19. }