jishi / node-sonos-http-api

An HTTP API bridge for Sonos easing automation. Hostable on any node.js capable device, like a raspberry pi or similar.
http://jishi.github.io/node-sonos-http-api/
MIT License
1.83k stars 462 forks source link

Error: File not found: /app/static/tts/elevenlabs-xxxxxxx.mp3 #885

Closed Barloew closed 4 months ago

Barloew commented 4 months ago

ERROR MESSAGE IN BROWSER

{ "status": "error", "error": "File not found: /app/static/tts/elevenlabs-bd0a4193b78044b25b85cba4b9a779a8a4bd4bca-Serena.mp3", "stack": "Error: File not found: /app/static/tts/elevenlabs-bd0a4193b78044b25b85cba4b9a779a8a4bd4bca-Serena.mp3\n at Object.fromFile (/app/node_modules/strtok3/lib/index.js:43:45)\n at ParserFactory.parseFile (/app/node_modules/music-metadata/lib/ParserFactory.js:29:24)\n at MusicMetadataParser.parseFile (/app/node_modules/music-metadata/lib/index.js:83:46)\n at Object.parseFile (/app/node_modules/music-metadata/lib/index.js:175:46)\n at fileDuration (/app/lib/helpers/file-duration.js:4:20)\n at /app/lib/tts-providers/elevenlabs.js:70:14\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)" }

ERROR MESSAGE IN DOCKER CONTAINER (chrisns / docker-node-sonos-http-api : latest)

sonos-http-api@1.6.9 start node server.js 2024-02-15T13:53:34.788Z INFO Presets loaded: {} 2024-02-15T13:53:37.843Z INFO http server listening on 0.0.0.0 port 5005 (node:19) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. (Use node --trace-deprecation ... to show where the warning was created) 2024-02-15T13:54:38.011Z INFO announce file for phrase "hallo dit is een test" does not seem to exist, downloading AxiosError: Request failed with status code 400 at settle (/app/node_modules/axios/dist/node/axios.cjs:1967:12) at RedirectableRequest.handleResponse (/app/node_modules/axios/dist/node/axios.cjs:3010:9) at RedirectableRequest.emit (node:events:517:28) at RedirectableRequest.emit (node:domain:489:12) at RedirectableRequest._processResponse (/app/node_modules/follow-redirects/index.js:368:10) at RedirectableRequest._onNativeResponse (/app/node_modules/follow-redirects/index.js:65:10) at Object.onceWrapper (node:events:632:26) at ClientRequest.emit (node:events:517:28) at ClientRequest.emit (node:domain:489:12) at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:700:27) at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17) at TLSSocket.socketOnData (node:_http_client:541:22) at TLSSocket.emit (node:events:517:28) at TLSSocket.emit (node:domain:489:12) at addChunk (node:internal/streams/readable:368:12) at readableAddChunk (node:internal/streams/readable:341:9) at Readable.push (node:internal/streams/readable:278:10) at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23) { code: 'ERR_BAD_REQUEST', config: { transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false }, adapter: [ 'xhr', 'http' ], transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: { FormData: [Function], Blob: [class Blob] }, validateStatus: [Function: validateStatus], headers: Object [AxiosHeaders] { Accept: 'audio/mpeg', 'Content-Type': 'application/json', 'xi-api-key': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'User-Agent': 'axios/1.6.2', 'Content-Length': '162', 'Accept-Encoding': 'gzip, compress, deflate, br' }, method: 'post', url: 'https://api.elevenlabs.io/v1/text-to-speech/Serena', at addChunk (node:internal/streams/readable:368:12) at readableAddChunk (node:internal/streams/readable:341:9) at Readable.push (node:internal/streams/readable:278:10) at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23) { code: 'ERR_BAD_REQUEST', config: { transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false }, adapter: [ 'xhr', 'http' ], transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: { FormData: [Function], Blob: [class Blob] }, validateStatus: [Function: validateStatus], headers: Object [AxiosHeaders] { Accept: 'audio/mpeg', 'Content-Type': 'application/json', 'xi-api-key': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'User-Agent': 'axios/1.6.2', 'Content-Length': '162', 'Accept-Encoding': 'gzip, compress, deflate, br' }, method: 'post', url: 'https://api.elevenlabs.io/v1/text-to-speech/Serena', data: '{"text":"hallo dit is een test","voice_settings":{"stability":0.5,"similarity_boost":0.75,"style":1,"use_speaker_boost":true},"model_id":"eleven_multilingual_v2"}', responseType: 'stream' }, request: <ref 1> ClientRequest { _events: [Object: null prototype] { abort: [Function (anonymous)], aborted: [Function (anonymous)], connect: [Function (anonymous)], error: [Function (anonymous)], socket: [Function (anonymous)], timeout: [Function (anonymous)], finish: [Function: requestOnFinish] }, _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: false, _last: true, chunkedEncoding: false, shouldKeepAlive: false, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: true, 'User-Agent': 'axios/1.6.2', 'Content-Length': '162', 'Accept-Encoding': 'gzip, compress, deflate, br' }, method: 'post', url: 'https://api.elevenlabs.io/v1/text-to-speech/Serena', data: '{"text":"hallo dit is een test","voice_settings":{"stability":0.5,"similarity_boost":0.75,"style":1,"use_speaker_boost":true},"model_id":"eleven_multilingual_v2"}', responseType: 'stream' }, request: <ref 1> ClientRequest { _events: [Object: null prototype] { abort: [Function (anonymous)], aborted: [Function (anonymous)], connect: [Function (anonymous)], error: [Function (anonymous)], socket: [Function (anonymous)], timeout: [Function (anonymous)], finish: [Function: requestOnFinish] }, _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: false, _last: true, chunkedEncoding: false, shouldKeepAlive: false, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: true, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: '162', _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: false, socket: TLSSocket { _tlsOptions: [Object], _secureEstablished: true, _securePending: false, _newSessionPending: false, _controlReleased: true, secureConnecting: false, _SNICallback: null, servername: 'api.elevenlabs.io', alpnProtocol: false, authorized: true, authorizationError: null, encrypted: true, _events: [Object: null prototype], _last: true, chunkedEncoding: false, shouldKeepAlive: false, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: true, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: '162', _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: false, socket: TLSSocket { _tlsOptions: [Object], _secureEstablished: true, _securePending: false, _newSessionPending: false, _controlReleased: true, secureConnecting: false, _SNICallback: null, servername: 'api.elevenlabs.io', alpnProtocol: false, authorized: true, authorizationError: null, encrypted: true, _events: [Object: null prototype], _eventsCount: 11, connecting: false, _hadError: false, _parent: null, _host: 'api.elevenlabs.io', _closeAfterHandlingError: false, _readableState: [ReadableState], _maxListeners: undefined, _writableState: [WritableState], allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: undefined, _server: null, ssl: [TLSWrap], _requestCert: true, _rejectUnauthorized: true, parser: [HTTPParser], _httpMessage: [Circular *1],

_SNICallback: null, servername: 'api.elevenlabs.io', alpnProtocol: false, authorized: true, authorizationError: null, encrypted: true, _events: [Object: null prototype], _eventsCount: 11, connecting: false, _hadError: false, _parent: null, _host: 'api.elevenlabs.io', _closeAfterHandlingError: false, _readableState: [ReadableState], _maxListeners: undefined, _writableState: [WritableState], allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: undefined, _server: null, ssl: [TLSWrap], _requestCert: true, _rejectUnauthorized: true, parser: [HTTPParser], _httpMessage: [Circular *1],

}, _header: 'POST /v1/text-to-speech/Serena HTTP/1.1\r\n' + 'Accept: audio/mpeg\r\n' + 'Content-Type: application/json\r\n' + 'xi-api-key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\r\n' + 'User-Agent: axios/1.6.2\r\n' + 'Content-Length: 162\r\n' + 'Accept-Encoding: gzip, compress, deflate, br\r\n' + 'Host: api.elevenlabs.io\r\n' + 'Connection: close\r\n' + '\r\n', _rejectUnauthorized: true, parser: [HTTPParser], _httpMessage: [Circular *1],

}, _header: 'POST /v1/text-to-speech/Serena HTTP/1.1\r\n' + 'Accept: audio/mpeg\r\n' + 'Content-Type: application/json\r\n' + 'xi-api-key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\r\n' + 'User-Agent: axios/1.6.2\r\n' + 'Content-Length: 162\r\n' + 'Accept-Encoding: gzip, compress, deflate, br\r\n' + 'Host: api.elevenlabs.io\r\n' + 'Connection: close\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: Agent { _events: [Object: null prototype], _eventsCount: 2, _maxListeners: undefined, defaultPort: 443, protocol: 'https:', options: [Object: null prototype], requests: [Object: null prototype] {}, sockets: [Object: null prototype], freeSockets: [Object: null prototype] {}, keepAliveMsecs: 1000, keepAlive: false, maxSockets: Infinity, maxFreeSockets: 256, scheduling: 'lifo', maxTotalSockets: Infinity, totalSocketCount: 1, maxCachedSessions: 100, _sessionCache: [Object],

}, socketPath: undefined, 'Content-Type: application/json\r\n' + 'xi-api-key: fxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\r\n' + 'User-Agent: axios/1.6.2\r\n' + 'Content-Length: 162\r\n' + 'Accept-Encoding: gzip, compress, deflate, br\r\n' + 'Host: api.elevenlabs.io\r\n' + 'Connection: close\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: Agent { _events: [Object: null prototype], _eventsCount: 2, _maxListeners: undefined, defaultPort: 443, protocol: 'https:', options: [Object: null prototype], requests: [Object: null prototype] {}, sockets: [Object: null prototype], freeSockets: [Object: null prototype] {}, keepAliveMsecs: 1000, keepAlive: false, maxSockets: Infinity, maxFreeSockets: 256, scheduling: 'lifo', maxTotalSockets: Infinity, totalSocketCount: 1, maxCachedSessions: 100, _sessionCache: [Object],

}, socketPath: undefined, method: 'POST', maxHeaderSize: undefined, insecureHTTPParser: undefined, joinDuplicateHeaders: undefined, path: '/v1/text-to-speech/Serena', _ended: false, res: IncomingMessage { _readableState: [ReadableState], _events: [Object: null prototype], _eventsCount: 4, _maxListeners: undefined, socket: [TLSSocket], httpVersionMajor: 1, httpVersionMinor: 1, httpVersion: '1.1', complete: false, rawHeaders: [Array], rawTrailers: [], joinDuplicateHeaders: undefined, aborted: false, upgrade: false, url: '', method: null, statusCode: 400, maxTotalSockets: Infinity, totalSocketCount: 1, maxCachedSessions: 100, _sessionCache: [Object],

}, socketPath: undefined, method: 'POST', maxHeaderSize: undefined, insecureHTTPParser: undefined, joinDuplicateHeaders: undefined, path: '/v1/text-to-speech/Serena', _ended: false, res: IncomingMessage { _readableState: [ReadableState], _events: [Object: null prototype], _eventsCount: 4, _maxListeners: undefined, socket: [TLSSocket], httpVersionMajor: 1, httpVersionMinor: 1, httpVersion: '1.1', complete: false, rawHeaders: [Array], rawTrailers: [], joinDuplicateHeaders: undefined, aborted: false, upgrade: false, url: '', method: null, statusCode: 400, statusMessage: 'Bad Request', client: [TLSSocket], _consuming: false, _dumped: false, req: [Circular *1], responseUrl: 'https://api.elevenlabs.io/v1/text-to-speech/Serena', redirects: [],

}, aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: HTTPParser { '0': null, '1': [Function: parserOnHeaders], '2': [Function: parserOnHeadersComplete], '3': [Function: parserOnBody], '4': [Function: parserOnMessageComplete], '5': null, '6': null, _headers: [], rawTrailers: [], joinDuplicateHeaders: undefined, aborted: false, upgrade: false, url: '', method: null, statusCode: 400, statusMessage: 'Bad Request', client: [TLSSocket], _consuming: false, _dumped: false, req: [Circular *1], responseUrl: 'https://api.elevenlabs.io/v1/text-to-speech/Serena', redirects: [],

}, aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: HTTPParser { '0': null, '1': [Function: parserOnHeaders], '2': [Function: parserOnHeadersComplete], '3': [Function: parserOnBody], '4': [Function: parserOnMessageComplete], '5': null, '6': null, _headers: [], _url: '', socket: [TLSSocket], incoming: [IncomingMessage], outgoing: [Circular *1], maxHeaderPairs: 2000, _consumed: false, onIncoming: [Function: parserOnIncomingClient], joinDuplicateHeaders: undefined,

}, maxHeadersCount: null, reusedSocket: false, host: 'api.elevenlabs.io', protocol: 'https:', _redirectable: Writable { _writableState: [WritableState], _events: [Object: null prototype], _eventsCount: 3, _maxListeners: undefined, _options: [Object], _ended: true, _ending: true, _redirectCount: 0, _redirects: [], parser: HTTPParser { '0': null, '1': [Function: parserOnHeaders], '2': [Function: parserOnHeadersComplete], '3': [Function: parserOnBody], '4': [Function: parserOnMessageComplete], '5': null, '6': null, _headers: [], _url: '', socket: [TLSSocket], incoming: [IncomingMessage], outgoing: [Circular *1], maxHeaderPairs: 2000, _consumed: false, onIncoming: [Function: parserOnIncomingClient], joinDuplicateHeaders: undefined,

}, maxHeadersCount: null, reusedSocket: false, host: 'api.elevenlabs.io', protocol: 'https:', _redirectable: Writable { _writableState: [WritableState], _events: [Object: null prototype], _eventsCount: 3, _maxListeners: undefined, _options: [Object], _ended: true, _ending: true, _redirectCount: 0, _redirects: [], _requestBodyLength: 162, _requestBodyBuffers: [], _onNativeResponse: [Function (anonymous)], _currentRequest: [Circular *1], _currentUrl: 'https://api.elevenlabs.io/v1/text-to-speech/Serena',

},

[Symbol(kOutHeaders)]: [Object: null prototype] { accept: [Array], 'content-type': [Array], 'xi-api-key': [Array], 'user-agent': [Array], 'content-length': [Array], 'accept-encoding': [Array], host: [Array] },

_events: [Object: null prototype], _eventsCount: 3, _maxListeners: undefined, _options: [Object], _ended: true, _ending: true, _redirectCount: 0, _redirects: [], _requestBodyLength: 162, _requestBodyBuffers: [], _onNativeResponse: [Function (anonymous)], _currentRequest: [Circular *1], _currentUrl: 'https://api.elevenlabs.io/v1/text-to-speech/Serena',

},

[Symbol(kOutHeaders)]: [Object: null prototype] { accept: [Array], 'content-type': [Array], 'xi-api-key': [Array], 'user-agent': [Array], 'content-length': [Array], 'accept-encoding': [Array], host: [Array] },

}, response: { status: 400, statusText: 'Bad Request', headers: Object [AxiosHeaders] { date: 'Thu, 15 Feb 2024 13:54:38 GMT', server: 'uvicorn', 'content-length': '98', 'content-type': 'application/json', 'access-control-allow-origin': '', 'access-control-allow-headers': '', 'access-control-allow-methods': 'POST, OPTIONS, DELETE, GET, PUT', 'access-control-max-age': '600', via: '1.1 google', 'alt-svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000', connection: 'close' }, config: { transitional: [Object], adapter: [Array], transformRequest: [Array], transformResponse: [Array], timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, },

}, response: { status: 400, statusText: 'Bad Request', headers: Object [AxiosHeaders] { date: 'Thu, 15 Feb 2024 13:54:38 GMT', server: 'uvicorn', 'content-length': '98', 'content-type': 'application/json', 'access-control-allow-origin': '', 'access-control-allow-headers': '', 'access-control-allow-methods': 'POST, OPTIONS, DELETE, GET, PUT', 'access-control-max-age': '600', via: '1.1 google', 'alt-svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000', connection: 'close' }, config: { transitional: [Object], adapter: [Array], transformRequest: [Array], transformResponse: [Array], timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: [Object], validateStatus: [Function: validateStatus], headers: [Object [AxiosHeaders]], method: 'post', url: 'https://api.elevenlabs.io/v1/text-to-speech/Serena', data: '{"text":"hallo dit is een test","voice_settings":{"stability":0.5,"similarity_boost":0.75,"style":1,"use_speaker_boost":true},"model_id":"eleven_multilingual_v2"}', responseType: 'stream' }, request: <ref 1> ClientRequest { _events: [Object: null prototype], _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: false, _last: true, chunkedEncoding: false, shouldKeepAlive: false, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: true, sendDate: false, _removedConnection: false, adapter: [Array], transformRequest: [Array], transformResponse: [Array], timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: [Object], validateStatus: [Function: validateStatus], headers: [Object [AxiosHeaders]], method: 'post', url: 'https://api.elevenlabs.io/v1/text-to-speech/Serena', data: '{"text":"hallo dit is een test","voice_settings":{"stability":0.5,"similarity_boost":0.75,"style":1,"use_speaker_boost":true},"model_id":"eleven_multilingual_v2"}', responseType: 'stream' }, request: <ref 1> ClientRequest { _events: [Object: null prototype], _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: false, _last: true, chunkedEncoding: false, shouldKeepAlive: false, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: true, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: '162', _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: false, socket: [TLSSocket], _header: 'POST /v1/text-to-speech/Serena HTTP/1.1\r\n' + 'Accept: audio/mpeg\r\n' + 'Content-Type: application/json\r\n' + 'xi-api-key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\r\n' + 'User-Agent: axios/1.6.2\r\n' + 'Content-Length: 162\r\n' + 'Accept-Encoding: gzip, compress, deflate, br\r\n' + 'Host: api.elevenlabs.io\r\n' + 'Connection: close\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: [Agent], socketPath: undefined, chunkedEncoding: false, shouldKeepAlive: false, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: true, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: '162', _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: false, socket: [TLSSocket], _header: 'POST /v1/text-to-speech/Serena HTTP/1.1\r\n' + 'Accept: audio/mpeg\r\n' + 'Content-Type: application/json\r\n' + 'xi-api-key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\r\n' + 'User-Agent: axios/1.6.2\r\n' + 'Content-Length: 162\r\n' + 'Accept-Encoding: gzip, compress, deflate, br\r\n' + 'Host: api.elevenlabs.io\r\n' + 'Connection: close\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: [Agent], socketPath: undefined, method: 'POST', maxHeaderSize: undefined, insecureHTTPParser: undefined, joinDuplicateHeaders: undefined, path: '/v1/text-to-speech/Serena', _ended: false, res: [IncomingMessage], aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: [HTTPParser], maxHeadersCount: null, reusedSocket: false, host: 'api.elevenlabs.io', protocol: 'https:', _redirectable: [Writable],

[Symbol(kOutHeaders)]: [Object: null prototype],

'Connection: close\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: [Agent], socketPath: undefined, method: 'POST', maxHeaderSize: undefined, insecureHTTPParser: undefined, joinDuplicateHeaders: undefined, path: '/v1/text-to-speech/Serena', _ended: false, res: [IncomingMessage], aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: [HTTPParser], maxHeadersCount: null, reusedSocket: false, host: 'api.elevenlabs.io', protocol: 'https:', _redirectable: [Writable],

[Symbol(kOutHeaders)]: [Object: null prototype],

}, data: IncomingMessage { _readableState: [ReadableState], _events: [Object: null prototype], _eventsCount: 4, _maxListeners: undefined, socket: [TLSSocket], httpVersionMajor: 1, httpVersionMinor: 1, httpVersion: '1.1', complete: false, rawHeaders: [Array], rawTrailers: [], joinDuplicateHeaders: undefined, aborted: false, upgrade: false, url: '', method: null, statusCode: 400, statusMessage: 'Bad Request', client: [TLSSocket], _consuming: false, _dumped: false, req: [ClientRequest], responseUrl: 'https://api.elevenlabs.io/v1/text-to-speech/Serena', redirects: [],

} } } Elevenlabs TTS generated new audio file. 2024-02-15T13:54:38.657Z ERROR Error: File not found: /app/static/tts/elevenlabs-bd0a4193b78044b25b85cba4b9a779a8a4bd4bca-Serena.mp3 at Object.fromFile (/app/node_modules/strtok3/lib/index.js:43:45) at ParserFactory.parseFile (/app/node_modules/music-metadata/lib/ParserFactory.js:29:24) at MusicMetadataParser.parseFile (/app/node_modules/music-metadata/lib/index.js:83:46) at Object.parseFile (/app/node_modules/music-metadata/lib/index.js:175:46) at fileDuration (/app/lib/helpers/file-duration.js:4:20) at /app/lib/tts-providers/elevenlabs.js:70:14 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

MY CONFIG.JSON

{ "elevenlabs": { "auth": { "apiKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, "config": { "voiceId": "Serena", "stability": 0.5, "similarityBoost": 0.75, "speakerBoost": true, "style": 1, "modelId": "eleven_multilingual_v2" } }, "announceVolume": 40, "webhook": "http://localhost:5007/", "spotify": { "clientId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "clientSecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" } }

MY DOCKER CONTAINER CREATION CONFIG

local directories and the settings file:

mkdir clips mkdir cache mkdir presets mkdir tts curl https://raw.githubusercontent.com/jishi/node-sonos-http-api/master/presets/example.json > presets/example.json echo {} > settings.json

run the docker image:

docker run \ --net=host \ --name sonos \ --restart=always \ -d \ -v pwd/settings.json:/app/settings.json \ -v pwd/clips:/app/static/clips \ -v pwd/cache:/app/cache \ -v pwd/presets:/app/presets \ -v pwd/tts:/app/static/tts \ chrisns/docker-node-sonos-http-api

jishi commented 4 months ago

You are getting a 400 response from elevenlabs. Are you sure all the parameters you have configured are valid? Maybe @mgorsk1 has seen this before and has some ideas?

mgorsk1 commented 4 months ago

@Barloew you should configure your sonos service so it uses voice id not voice name. so try "voiceId": "pMsXgVXv3BLzUgSXRplE" instead of "voiceId": "Serena". More info https://elevenlabs.io/docs/voicelab/pre-made-voices

Barloew commented 4 months ago

@jishi @mgorsk1 Thank you both. That fixed it alright!