Skip to content
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

Added a configuration but no audio #15

Open
junalmeida opened this issue Jun 19, 2024 · 3 comments
Open

Added a configuration but no audio #15

junalmeida opened this issue Jun 19, 2024 · 3 comments

Comments

@junalmeida
Copy link

I've added a configuration as per instructions, but I can't hear any audio. Is there any setting missing?

Here is what it looks like:
The device:
image

The service call:

service: tts.speak
data:
  cache: true
  media_player_entity_id: media_player.vlc_telnet
  message: Test
target:
  entity_id: tts.openai_tts_nova

When I run it, I hear nothing, but UI shows as it succeeded.

This is the only log I can say it may be related to this, but I'm not 100% sure, because it is related to tags and this shouldn't stop it from playing.

2024-06-19 09:09:58.141 ERROR (MainThread) [homeassistant.components.tts] ID3 tag error: can't sync to MPEG frame

The media_player seems to be working normally, as I can use other tts services (like google translator google_say service) and I can hear it.

Thanks for your help.

@sfortis
Copy link
Owner

sfortis commented Jun 20, 2024

That's strange. I've connected my VLC (Windows, 3.0.20) using the Telnet interface and the integration works fine.

Integration provides just a plain MP3 file with TTS content. Check your /config/tts folder, and normally you'll find the cached MP3 file there from the TTS engine. Can you play it?

image

@Flight777
Copy link

Same issue for me, can't get it to work. I see the MP3, but only very small file size and when I try to play VLC says it's corrupted.

@dai80027
Copy link

I think I'm seeing the same problem. I see this in the log file:

Logger: aiohttp.server
Source: /usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py:451
First occurred: 3:06:26 PM (2 occurrences)
Last logged: 3:11:21 PM

Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py", line 480, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/aiohttp/web_app.py", line 569, in _handle
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/aiohttp/web_middlewares.py", line 117, in impl
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 86, in ban_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
result = await handler(request, **request.match_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/tts/init.py", line 1099, in get
content, data = await self.tts.async_read_tts(filename)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/tts/init.py", line 953, in async_read_tts
await pending
File "/usr/src/homeassistant/homeassistant/components/tts/init.py", line 806, in get_tts_data
data = await async_convert_audio(
^^^^^^^^^^^^^^^^^^^^^^^^^^
...<7 lines>...
)
^
File "/usr/src/homeassistant/homeassistant/components/tts/init.py", line 227, in async_convert_audio
return await hass.async_add_executor_job(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<9 lines>...
)
^
File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/tts/init.py", line 228, in
lambda: _convert_audio(
~~~~~~~~~~~~~~^
ffmpeg_manager.binary,
^^^^^^^^^^^^^^^^^^^^^^
...<5 lines>...
to_sample_bytes=to_sample_bytes,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/src/homeassistant/homeassistant/components/tts/init.py", line 292, in _convert_audio
raise RuntimeError(
...<2 lines>...
)
RuntimeError: Unexpected error while running ffmpeg with arguments: ['ffmpeg', '-y', '-f', 'wav', '-i', 'pipe:', '-f', 'mp3', '-q:a', '0', '/tmp/tmpdru86v3b.mp3'].See log for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants