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

TTS with wyoming-piper creates mp3 files with multiple ID3 headers, which won't play back on some devices #118023

Open
davidmonro opened this issue May 24, 2024 · 1 comment

Comments

@davidmonro
Copy link

The problem

I am trying to use tts.speak with the wyoming integration to produce output on an android tablet using the fullykioskbrowser app. This doesn't work; I can see from the web traffic that the tablet (repeatedly!) attempts to retrieve the resulting mp3 from the homeassistant server, but no sound results.

Using the google translate tts, does work (showing that the tablet can access and play cached TTS mp3 output just fine).

Directing the wyoming-piper tts output to a different media player (eg a chromecast) also works fine.

Analyzing the resulting mp3 file that is generated by the tts process, it has two ID3 headers stuck on the front.

If I copy this mp3 to the homeassistant local media folder and then play it on the tablet media player entity through the 'media' entry on the sidebar, it also fails to work (but does work if the target is a chromecast).

If I remove the first ID3 header from the mp3 file, I can play the resulting file through the media entry on the sidebar on the tablet.

I don't know if it is the tablet itself, or the media player entity exposed by fullykiosk, that is being picky. Either way, perhaps it would be best if the process didn't stick multiple ID3 headers on the file.

(Slightly confusingly one of the headers seems to indicate that the language should be been Spanish, given the es_ES string? I'm using the en_GB-alba-medium voice and everything is in English).

What version of Home Assistant Core has the issue?

core-2024.5.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

wyoming

Link to integration documentation on our website

https://www.home-assistant.io/integrations/wyoming/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

Here's a hex dump of the beginning of the file, showing the two headers:

00000000  49 44 33 04 00 00 00 00  09 29 54 65 78 74 00 00  |ID3......)Text..|
00000010  00 07 00 00 03 65 73 5f  45 53 00 54 65 78 74 00  |.....es_ES.Text.|
00000020  00 00 07 00 00 03 70 69  70 65 72 00 54 53 53 45  |......piper.TSSE|
00000030  00 00 00 0f 00 00 03 4c  61 76 66 36 30 2e 31 36  |.......Lavf60.16|
00000040  2e 31 30 30 00 54 65 78  74 00 00 00 43 00 00 03  |.100.Text...C...|
00000050  68 65 6c 6c 6f 20 74 68  69 73 20 69 73 20 61 20  |hello this is a |
00000060  73 6f 6d 65 77 68 61 74  20 6c 6f 6e 67 65 72 20  |somewhat longer |
00000070  74 65 73 74 20 6f 66 20  74 65 78 74 20 74 6f 20  |test of text to |
00000080  73 70 65 65 63 68 20 6f  75 74 70 75 74 20 61 61  |speech output aa|
00000090  61 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |a...............|
000000a0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000004b0  00 00 00 49 44 33 04 00  00 00 00 00 23 54 53 53  |...ID3......#TSS|
000004c0  45 00 00 00 0f 00 00 03  4c 61 76 66 36 30 2e 31  |E.......Lavf60.1|
000004d0  36 2e 31 30 30 00 00 00  00 00 00 00 00 00 00 00  |6.100...........|
000004e0  ff f3 58 c0 00 00 00 00  00 00 00 00 00 58 69 6e  |..X..........Xin|
000004f0  67 00 00 00 0f 00 00 00  75 00 00 84 30 00 06 08  |g.......u...0...|
00000500  0a 0c 0e 12 14 16 1a 1c  1f 22 24 26 28 2b 2c 31  |........."$&(+,1|
00000510  34 38 3a 3c 3e 42 44 46  48 4a 4c 51 53 55 58 5c  |48:<>BDFHJLQSUX\|
00000520  5e 63 65 67 69 6a 6c 70  73 75 78 7b 7f 82 85 87  |^cegijlpsux{....|
00000530  8b 8d 91 93 96 99 9d 9f  a3 a5 a8 ab af b2 ba bd  |................|
00000540  c0 c2 c5 c7 cb ce d0 d1  d3 d6 da dc de e0 e2 e4  |................|
00000550  e8 ea eb ed ef f1 f4 f6  f8 f9 fb fd fe fe ff ff  |................|
00000560  ff 00 00 00 00 4c 61 76  63 36 30 2e 33 31 00 00  |.....Lavc60.31..|
@home-assistant
Copy link

Hey there @balloob, @synesthesiam, mind taking a look at this issue as it has been labeled with an integration (wyoming) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of wyoming can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign wyoming Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


wyoming documentation
wyoming source
(message by IssueLinks)

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

No branches or pull requests

3 participants