Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a getVolume() API to support on-demand volume level #16

Open
kashifshamaz21 opened this issue May 6, 2015 · 4 comments
Open

Add a getVolume() API to support on-demand volume level #16

kashifshamaz21 opened this issue May 6, 2015 · 4 comments

Comments

@kashifshamaz21
Copy link

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.

@fippo
Copy link
Member

fippo commented May 6, 2015

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.

@kashifshamaz21
Copy link
Author

@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.

@latentflip
Copy link
Contributor

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.

@ibc
Copy link
Contributor

ibc commented Nov 24, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants