-
Notifications
You must be signed in to change notification settings - Fork 23
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
[ts-sdk] Add audio support #715
Conversation
3d5a601
to
c22dc85
Compare
e82394d
to
b3e5041
Compare
b3e5041
to
e1122ab
Compare
/** | ||
* Audio volume represented by a number between 0 and 1. | ||
*/ | ||
volume?: number; | ||
/** | ||
* Mute audio. | ||
*/ | ||
mute?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you add mute
? Can't they just set volume=0
if somebody wants to mute audio? Having 2 separate fields for that doesn't make sense IMO. It also introduces ambiguity when both values are specified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you add mute?
I think it's a useful API, especially in React you can do <InputStream mute/>
. I also considered using muted
instead (I think mute is better, but muted is the same as in <video/>
HTML tag), but I don't have strong opinions on that.
Can't they just set volume=0
Yes, as you can see below it's literally what it does internally
Having 2 separate fields for that doesn't make sense IMO.
It's often true, but I disagree with it as a general statement. This is a tradeoff, we are getting simpler API to do sth specific, but increase the complexity because user needs to know how those 2 ways interact. You can argue if you want that tradeoff is not worth it here, but not in general.
It also introduces ambiguity when both values are specified.
Does it? Can you imagine someone seeing those 2 options and assuming that volume has higher priority than mute?
Co-authored-by: Mikołaj Radkowski <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Public API
useInputAudio
useInputStreams
to return map instead of a listInternal
@live-compositor/core
andlive-compositor
so I exported _liveCompositorInternals object that groups everything. Those types are not intended to be used by user<View />