2023-10-09 17:22:48 +00:00
|
|
|
const express = require('express')
|
|
|
|
const router = express.Router()
|
|
|
|
const { authorization, } = require('../middleware/authentication')
|
2023-11-03 12:02:59 +00:00
|
|
|
const { audioUpload } = require("../utils")
|
|
|
|
const { getSentiment, getAudioFromText, getTextFromAudio, getVoiceConfig, uploadAudioToTranscript, getJobStatus } = require('../controllers/naturalLanguageController')
|
2023-10-09 17:22:48 +00:00
|
|
|
|
|
|
|
router.route('/sentiment').post(authorization, getSentiment)
|
2023-11-03 14:42:13 +00:00
|
|
|
router.route('/text-to-speech').get(authorization, getAudioFromText)
|
|
|
|
router.route('/speech-to-text').post(audioUpload.single('audio'), authorization, getTextFromAudio)
|
|
|
|
router.route('/upload-audio-to-transcript').post(audioUpload.single('audio'), authorization, uploadAudioToTranscript)
|
2023-11-03 12:02:59 +00:00
|
|
|
router.route('/query-job-status').get(getJobStatus)
|
2023-10-09 17:22:48 +00:00
|
|
|
router.route('/voice-config').get(getVoiceConfig)
|
|
|
|
|
|
|
|
module.exports = router
|