I've been working on using Amazon Polly to do speech on HS3. My system is a Pi 3B running HS3 Standard. Amazon Polly produces mono mp3 files encoded at 22,050Hz. I convert that to 44,100 Hz stereo using the following command.
avconv -i "$1_t" -y -ar 44100 -ac 2 "$1"
The only difference between this and when using flite is the added -ac 2 to make sure the mono file is converted to stereo. Local playback using speak.sh is done using mpg123 and that work great as does sound sent to HSTouch.
The only thing that's not working is getting sound to my Mac. The mac is running 5KPlayer which will act as an Airplay receiver. I have no issues sending music from my iPhone to my Mac running the 5KPlayer.
AirplaySpeak does see the Mac and thinks it an AppleTV which is correct for the 5KPlayer.
Here is the results from the AirplaySpeak log.
This is when it connects to the 5KPlayer
This is when it trys to play speech.
All my Pi's are tied up right now so I can't run Airplay for the Pi which I know works. If everything looks OK then I guess I'll just have to wait till I pickup a Pi Zero and the speaker pHAT and bring up Airplay for the Pi.
avconv -i "$1_t" -y -ar 44100 -ac 2 "$1"
The only difference between this and when using flite is the added -ac 2 to make sure the mono file is converted to stereo. Local playback using speak.sh is done using mpg123 and that work great as does sound sent to HSTouch.
The only thing that's not working is getting sound to my Mac. The mac is running 5KPlayer which will act as an Airplay receiver. I have no issues sending music from my iPhone to my Mac running the 5KPlayer.
AirplaySpeak does see the Mac and thinks it an AppleTV which is correct for the 5KPlayer.
Here is the results from the AirplaySpeak log.
This is when it connects to the 5KPlayer
Code:
Jun-25 18:52:16 INFO Found Service: 787B8AC27D69@Lucas Jun-25 18:52:16 INFO Resolved Service: 787B8AC27D69 - Lucas - 10.0.2.21 - 5004 Jun-25 18:52:16 DEBUG TXT Records = Jun-25 18:52:16 DEBUG am = 'AppleTV3,2' Jun-25 18:52:16 DEBUG da = 'true' Jun-25 18:52:16 DEBUG et = '0,3,5' Jun-25 18:52:16 DEBUG sf = '0x4' Jun-25 18:52:16 DEBUG ss = '16' Jun-25 18:52:16 DEBUG tp = 'UDP' Jun-25 18:52:16 DEBUG vv = '2' Jun-25 18:52:16 DEBUG txtvers = '1' Jun-25 18:52:16 DEBUG md = '0,1,2' Jun-25 18:52:16 DEBUG vn = '65537' Jun-25 18:52:16 DEBUG vs = '220.68' Jun-25 18:52:16 DEBUG sv = 'false' Jun-25 18:52:16 DEBUG ch = '2' Jun-25 18:52:16 DEBUG pk = '482131eacf7e006792da125540724283fb3f2ba6a25cabe13b5f1543b3b234bd' Jun-25 18:52:16 DEBUG sr = '44100' Jun-25 18:52:16 DEBUG ft = '0x5A7FFFF7,0x1E' Jun-25 18:52:16 DEBUG cn = '1,3'
Code:
Jun-25 18:54:28 DEBUG calling SpeakToFile text=<speak>MAY I HAVE YOUR ATTENTION PLEASE<break time="300ms"/> The Outside Gate has been closed.</speak> file=/home/pi/HomeSeer/Temp/AirplaySpeak20180625185428962.wav Jun-25 18:54:30 INFO (Lucas): <speak>MAY I HAVE YOUR ATTENTION PLEASE<break time="300ms"/> The Outside Gate has been closed.</speak> Jun-25 18:54:30 DEBUG Start sleep Jun-25 18:54:30 DEBUG 581 Speaker.Reset() Jun-25 18:54:30 DEBUG 581 Speaker.Reset() gets the lock Jun-25 18:54:30 DEBUG End sleep Jun-25 18:54:30 DEBUG ANNOUNCE rtsp://10.0.2.43/1079979903 RTSP/1.0 CSeq: 1 Content-Type: application/sdp Content-Length: 176 User-Agent: iTunes/7.6.2 ( Windows;N;) Client-Instance: 8FE95CFF71C50DB2 v=0 o=iTunes 1079979903 0 IN IP4 10.0.2.43 s=iTunes c=IN IP4 10.0.2.21 t=0 0 m=audio 0 RTP/AVP 96 a=rtpmap:96 AppleLossless a=fmtp:96 352 0 16 40 10 14 2 255 0 0 44100 Jun-25 18:54:35 DEBUG CSeq, 1 Jun-25 18:54:35 DEBUG Server, AirTunes/230.33 Jun-25 18:54:35 DEBUG Apple-Jack-Status, connected; type=analog Jun-25 18:54:35 DEBUG SETUP rtsp://10.0.2.43/1079979903 RTSP/1.0 CSeq: 2 Transport: RTP/AVP/UDP;unicast;interleaved=0-1;mode=record;control_port=48545;timing_port=60161 User-Agent: iTunes/7.6.2 ( Windows;N;) Client-Instance: 8FE95CFF71C50DB2 Jun-25 18:54:35 DEBUG CSeq, 2 Jun-25 18:54:35 DEBUG Server, AirTunes/230.33 Jun-25 18:54:35 DEBUG Apple-Jack-Status, connected; type=analog Jun-25 18:54:35 INFO Connection to Lucas (10.0.2.21:5004) failed: SETUP: no session in response Jun-25 18:54:35 DEBUG Stack: at RTSPClient.Setup (System.Int32 controlport, System.Int32 timingport) [0x00070] in <b2f4575dd15646579fe26d0a3053b5ce>:0 at RAOPClient.Connect () [0x00342] in <b2f4575dd15646579fe26d0a3053b5ce>:0 at HSPI_AIRPLAY_SPEAK.Speaker.Reset () [0x000fd] in <b2f4575dd15646579fe26d0a3053b5ce>:0 Jun-25 18:54:35 DEBUG 581 Speaker.BeforeSend() Jun-25 18:54:35 DEBUG 581 Speaker.SendSample() Jun-25 18:54:35 DEBUG 581 Speaker.SendSample() gets lock Jun-25 18:54:35 DEBUG 581 Speaker.AfterSend()
Comment