Announcement functionality broken completely

Posted on
Mon Feb 27, 2023 8:09 am
shapa offline
Posts: 483
Joined: Sep 08, 2014
Location: Swindon

Announcement functionality broken completely

It could be an Apple Silicon issue or MacOS 13.2.1, or Sonos latest firmware.

But all my announcements have stopped working recently. Apple TTS.

The Indigo part works:

"room Sonos
Sonos ZonePlayer: Office Bathroom Sonos, Current Volume: 25, New Volume: 70
Sonos Announcement Length: 1.23070294785
"

I see an error on Sonos: "Unable to play 'announcement.aiff' - the song is not encoded correctly."
The generated file itself is accessible via the Sonos Plugin webserver and is playing fine on the mac.

Could it be some codec incompatibility? Is it possible to change the plugin to generate mp3 instead?

Pre-generated .mp3 files work fine.
Attachments
Screenshot 2023-02-27 at 13.35.02.png
Screenshot 2023-02-27 at 13.35.02.png (264.79 KiB) Viewed 1125 times

Posted on
Fri Mar 17, 2023 7:47 am
shapa offline
Posts: 483
Joined: Sep 08, 2014
Location: Swindon

Re: Announcement functionality broken completely

OK, If someone is interested - I "fixed" the issue by adding .aiff to .mp3 conversion into the plugin (via lame).

Some dirty hack, works fine.

<------><------><------><------>ru = NSURL.fileURLWithPath_("./announcement.aiff")
<------><------><------><------>sp.startSpeakingString_toURL_(announcement, ru)
<------><------><------><------>s_announcement = "announcement.mp3"^M
<------><------><------><------>tts_delay = 0.5^M
<------><------><------><------># small delay to allow MP3 file creation completion^M
<------><------><------><------>self.plugin.sleep(0.5)^M
<------><------><------><------>lameExe = '"' + '/opt/homebrew/bin/lame' + '"'
<------><------><------><------>lameCommand = lameExe + ' -h "' + '"announcement.aiff"' + '" "' + '"announcement.mp3"' + '"'
<------><------><------><------>ps = subprocess.Popen(lameCommand,
<------><------><------><------><------>stdout=subprocess.PIPE,
<------><------><------><------><------>stderr=subprocess.PIPE,
<------><------><------><------><------>shell=True)
<------><------><------><------>self.plugin.sleep(0.5)^M

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 12 guests