Open kashifshamaz21 opened 9 years ago
hm... hark is emitting events by design.
if you want to query the volume, you could store the last known volume emitted on the (api) client.
@fippo yes that can be done, but just thought adding such an api would only help. Also, is there a way to know what are the min and max volume levels that can be expected in volume_change event? This is useful to normalize the volume range over a certain smaller number range to draw the volume level indicator.
At a guess volume events should be between -100 (no volume) and probably 0 (max volume). Kinda depends exactly what the browser puts out, but that should get you pretty close.
At a guess volume events should be between -100 (no volume) and probably 0 (max volume)
This is not true when the mic is muted (I mean, volume 0): #32
A good addition to the library could be adding an API like getVolume(), which would return the current volume level. Currently, the library does a poll for the speaking events, as well as the volume. Having a poll for speaking events does make sense, but for volume, user might want to run the volume meter poll on the client side, and just query the volume when needed.