Retrieve operating systems in the Jovo Request


#1

Hi all!

I have a question, is it possible to retrieve the operating system in the Jovo Request? I’m building a Google Action that plays a livestream using the Media Response object, I’d like to send an “.mp3” stream to iOS clients and an “.ogg” stream to Android clients (via Google Assistant mobile app).
This is because the “mp3” livestream works very bad on Android phones (with clips and glitches) and the “.ogg” doesn’t work at all on iOS phones.

Thanks in advance


#2

I can only answer for Jovo v3; I haven’t used v4 yet and it may have better solutions:

As the podcast player example (and my skill on github) demonstrate, you can use this.isAlexaSkill and this.isGoogleAction to distinguish Alexa from Google Home (I’m not sure whether Google Assistant counts as the latter). Presumably there are similar flags for other platforms Jovo supports.

In fact – again, as existing code demonstrates – In Jovo3 you must use those, and issue calls against either this.$alexaSkill or this.$googleAction since the media responses are specific to the platform.

However, I disagree with you strongly about MP3’s on Android phones. That sounds like a problem with a specific phone. I have had a fairly substantial pile of MP3’s on my Androids for years, and have not encountered any such problems. MP3 is a lossy compression and does have some forms of distortion compared to a non-lossy form like FLAC (or some of the ogg codecs), but on a phone you really are not likely to ever hear the difference, especially if you’re listening on the go with background noise and using a cheap set of earbuds. (And for the record I’m at least partially trained as a sound engineer, though so far I’ve spent most of my time doing live reinforcement rather than in the studio.)

Never let the ideal drive out the good enough.


#3

Hi @keshlam! Thanks for your reply. Yes I’m already using the flag you mentioned to distinguish Alexa from Google Action

In my case the problem is that, using the “Google Assistant” application on Android the “.mp3” livestream has a lot of distortion with audible clips and bad glitches, and we verified that in various Android devices, for all Google Action which are using a livestream (mainly local and national radios). Using the “.ogg” format on the other hand, the livestream works far better.

On iOS or other devices (like the Google Nest) the “mp3” works great.
That’s why I was asking if there’s a way to check via code if the request comes from an Android or iOS device


#4

Ah. So this is workaround for a bug in Android’s implementation of Google Assistant. (Which I’d suggest reporting to Google; sounds like it’s having trouble keeping its buffer filled, and that should be fixable.)

In that case: no clue.


#5

I’m currently not sure if it’s part of the request in Alexa or Google Assistant. I recommend taking a look at the request and retrieve the property using this.$request