i8beef / node-red-contrib-castv2

MIT License
22 stars 14 forks source link

Preventing chime sound when starting new media #79

Closed psy0rz closed 2 years ago

psy0rz commented 2 years ago

Whenever I send a media-request to some of my chromecast, i get the annoying "chime sound" before it starts playing.

I'm trying to use my chromecast speakers for short notiifcation sounds, so i dont want the other sound.

As a workaround for google speakers: it seems you wont get the sound if you start a playback of a silence sound and you pause that. That way the status will stay "joined", so you wont get a new chime.

However this doesnt help with my JBL speaker: It always gives me the chime, even when its already joined.

A QUEUE_INSERT would be a nice workaround (in combination with PAUSE), but that doesnt seem to be implemented in this module?

psy0rz commented 2 years ago

After some debugging: It seems node.receiver.APP_ID does never exist. I JSON stringified it but there doesnt seem to be an Appid in that whole object.

On this line: https://github.com/i8beef/node-red-contrib-castv2/blob/master/castv2-sender.js#L529

I commented out that last comparison with that object and now it reuses the session correctly. (but if there is a different session/app it offcourse returns and error, which is fine for my application)

So it seems a bug?

(Tested on JBL portable google home speaker)

i8beef commented 2 years ago

The chime is a built in Google thing whenever a new app launches (like the cast target). I don't believe there is a way to disable it.

That check is to ensure that if another app is currently running (say YouTube, or Spotify, or whatever) that it closes it and launches the correct receiver app before attempting to send commands which may not apply to the current running app. That is necessary, but the check could be wrong actually...

Try changing node.receiver.APP_ID !== castV2App.APP_ID to !(node.receiver instanceof castV2App) and see if that works for you.

psy0rz commented 2 years ago

The chime is a built in Google thing whenever a new app launches (like the cast target). I don't believe there is a way to disable it.

Ok i expected that.

That check is to ensure that if another app is currently running (say YouTube, or Spotify, or whatever) that it closes it and launches the correct receiver app before attempting to send commands which may not apply to the current running app. That is necessary, but the check could be wrong actually...

Yes i believe this is the case.

Try changing node.receiver.APP_ID !== castV2App.APP_ID to !(node.receiver instanceof castV2App) and see if that works for you.

Ok i'll try later.

i8beef commented 2 years ago

Did you ever get a chance to try this out?

i8beef commented 2 years ago

Try 4.1.3.

psy0rz commented 2 years ago

thanks i will

i8beef commented 2 years ago

Closed as stale.