mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 09:47:13 +00:00
Fix TTS ID3 Tag capability check (#41343)
This commit is contained in:
parent
3c22834751
commit
0470142701
@ -11,7 +11,7 @@ from typing import Dict, Optional
|
|||||||
|
|
||||||
from aiohttp import web
|
from aiohttp import web
|
||||||
import mutagen
|
import mutagen
|
||||||
from mutagen.id3 import ID3, TextFrame as ID3Text
|
from mutagen.id3 import ID3FileType, TextFrame as ID3Text
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.http import HomeAssistantView
|
from homeassistant.components.http import HomeAssistantView
|
||||||
@ -468,7 +468,7 @@ class SpeechManager:
|
|||||||
try:
|
try:
|
||||||
tts_file = mutagen.File(data_bytes)
|
tts_file = mutagen.File(data_bytes)
|
||||||
if tts_file is not None:
|
if tts_file is not None:
|
||||||
if isinstance(tts_file.tags, ID3):
|
if isinstance(tts_file, ID3FileType):
|
||||||
tts_file["artist"] = ID3Text(encoding=3, text=artist)
|
tts_file["artist"] = ID3Text(encoding=3, text=artist)
|
||||||
tts_file["album"] = ID3Text(encoding=3, text=album)
|
tts_file["album"] = ID3Text(encoding=3, text=album)
|
||||||
tts_file["title"] = ID3Text(encoding=3, text=message)
|
tts_file["title"] = ID3Text(encoding=3, text=message)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user