Networked Speaker Driver

That didn't seem to work...but thank you for the suggestion! That led me to append "a" to the beginning of the string, that never comes through so it works.

Is it the delay of the speaker turning on? Wondering if you could string a command to turn on and "play" just before sending the tts request?

1 Like

It actually seems like the speakers automatically ramp up the volume. I had to add some silence at the beginning of all my mp3 files when I was generating hard-coded phrases and playing them from the NAS. The speakers are always on, though they do go on stand-by. But I can play the TTS file back-to-back and it always drops the first second or two of the file.

I do need to test playing back music and then sending a notification, as their docs say "speaker will gracefully stop whatever its doing, play the Audio Notification, and then resume whatever it was doing"...

Just read that there is an SSML break tag that will insert a pause...tried to append that to the data string but it didn't work. I am no Groovy expert :wink:

text = "<break time='2s'/>" + text

Might need to URL encode it

Thanks. Tested and works great.

Does the system keep a database of phrases stored locally, or do I need to remember the url for future use?

For each textToSpeech invocation We hash the phrase + the voiceId (currently Matthew) , if this file exists on the hub, we return it, otherwise we fetch it from the cloud, cache it, then return it.

1 Like

+1 on being able to change the voice. My family did not approve of the male voice. The female ones got a much better reception. :slight_smile:

Currently the TTS methods aren't set up expecting SSML tags.
I will look into enabling this as long as it doesn't break any of the existing functionality.

1 Like

Which section did you comment out?

On my code is it lines 407 - 431 (need to keep the bracket ( '}' ) on line 419 just above the 'else' clause. See below ....

  		if (!results) {
  			def bodyHtml = msg.body ? msg.body.replaceAll('(<[a-z,A-Z,0-9,\\-,_,:]+>)','\n$1\n')
  				.replaceAll('(</[a-z,A-Z,0-9,\\-,_,:]+>)','\n$1\n')
  				.replaceAll('\n\n','\n').encodeAsHTML() : ""
  			results << createEvent(
  				name: "mediaRendererMessage",
  				value: "${msg.body.encodeAsMD5()}",
  				description: description,
  				descriptionText: "Body is ${msg.body?.size() ?: 0} bytes",
  				data: "<pre>${msg.headers.collect{it.key + ': ' + it.value}.join('\n')}</pre><br/><pre>${bodyHtml}</pre>",
  				isStateChange: false, displayed: false)
  		} */
  	} /*
  	else {
  		def bodyHtml = msg.body ? msg.body.replaceAll('(<[a-z,A-Z,0-9,\\-,_,:]+>)','\n$1\n')
  			.replaceAll('(</[a-z,A-Z,0-9,\\-,_,:]+>)','\n$1\n')
  			.replaceAll('\n\n','\n').encodeAsHTML() : ""
  		results << createEvent(
  			name: "unknownMessage",
  			value: "${msg.body.encodeAsMD5()}",
  			description: description,
  			descriptionText: "Body is ${msg.body?.size() ?: 0} bytes",
  			data: "<pre>${msg.headers.collect{it.key + ': ' + it.value}.join('\n')}</pre><br/><pre>${bodyHtml}</pre>",
  			isStateChange: true, displayed: true)
  	}

I put the entire file here ....

Trying to get an Eugy Genie to connect to Media Renderer. It doesn't find it even after 15 minutes of searching. Brand new and fully updated. Any tricks? Anyway of just entering in the ip address or mac? @veeceeoh @Matthew

thanks

All of my available speakers showed up right away. I did have to select them one at a time and quickly or else they would all de-select before I could click on the 'Done' (or Next?) button. Once I selected one it would stay and I could add another until they were all selected.

I haven't mentioned it, but my main rig is a Mac, and the Safari browser did not work at all with the modified parent Media Renderer Connect app. I had to use Chrome.

Also - Are you using the modified code for the Media Renderer Connect app? Besides replacing all instances of physicalgraph with hubitat, there's one line that needs to be changed, from

sendHubCommand(new hubitat.device.HubAction("""GET $ssdpPath HTTP/1.1\r\nHOST: $ip\r\n\r\n""", hubitat.device.Protocol.LAN, "${deviceNetworkId}"))

to

sendHubCommand(new hubitat.device.HubAction("""GET $ssdpPath HTTP/1.1\r\nHOST: $ip\r\n\r\n""", hubitat.device.Protocol.LAN, deviceNetworkId, [callback: locationHandler]))

Thanks for the replies. I checked the code and that line has already been changed. I'm using a windows 10 laptop with the latest chrome browser.

For sanity sake, I loaded up the media renderer on smartthings and it found my sonos:1 and the new eugy right away. Tried again on HE for 10 minutes and found nothing. :frowning:

This is what I see in the log:
[app:715](http://192.168.86.77/logs#app715)2018-05-10 16:39:47.218:tracemediaRendererDiscovery() state.subscribe true

I got the code for both the DLNA Player and the Media Renderer from this link...

I guess it doesn't like something on my system.

Did you eventually get your speaker discovered? I'm running into the same issue with a Hitachi speaker that gets discovered immediately on ST but not at all on HE. Hoping you might be able to throw a tip my way.

Thanks

I did not. Let it run for 10 minutes and found nothing. On ST it only took about 30 seconds to find my speakers.

Thanks for the reply. I'll keep trying as there has got to be something simple I'm overlooking.

1 Like

bptworld, did you ever resolve your problem? I am having the same issue getting my Fabriq speakers discovered. :frowning: