Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
x-dr committed Nov 27, 2023
1 parent b52a6d1 commit 8bb8869
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ app.use(Express.json())
app.use(Express.urlencoded({ extended: false }))
app.use(Express.static(__dirname+'/public'));




app.get("/audio", async (req, res) => {
try {

Expand Down Expand Up @@ -48,6 +51,10 @@ app.get("/legado", async (req, res) => {

const { voice, rate, pitch, voiceStyle } = req.query;

// const hostname = req.hostname;
const hostname = req.rawHeaders[1];
console.log(req.rawHeaders[1]);

const dataJson = {
"concurrentRate": "",//并发率
"contentType": "audio/mpeg",
Expand All @@ -58,7 +65,7 @@ app.get("/legado", async (req, res) => {
"loginUi": "",
"loginUrl": "",
"name": `Azure ${voice} ${voiceStyle} pitch: ${pitch} rate:${rate}`,
"url": `${origin}/audio?text={{speakText}}&rate=${rate}&pitch=${pitch}&voice=${voice}&voiceStyle=${voiceStyle},{"method":"GET"}`,
"url": `https://${hostname}/audio?text={{speakText}}&rate=${rate}&pitch=${pitch}&voice=${voice}&voiceStyle=${voiceStyle},{"method":"GET"}`,
}

res.send(dataJson);
Expand Down

0 comments on commit 8bb8869

Please sign in to comment.