-
Notifications
You must be signed in to change notification settings - Fork 98
Media Devices #493
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
base: main
Are you sure you want to change the base?
Media Devices #493
Conversation
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.
Nice!!
except StopAsyncIteration: | ||
exhausted = True | ||
break | ||
# AudioStream may yield either AudioFrame or AudioFrameEvent; unwrap if needed |
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.
The correct typing should be:
self, stream: AsyncIterator[AudioFrame | AudioFrameEvent], buf: np.ndarray
stream_kwargs["mapping"] = mapping | ||
elif mapping is not None: | ||
logging.getLogger(__name__).warning( | ||
"sounddevice.InputStream does not support 'mapping' in this version; " |
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.
Do we have to support that? or only latest?
input_channel_index, | ||
) | ||
|
||
input_stream = sd.InputStream(**stream_kwargs) |
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.
nit: Ideally we keep the typed args (no dict)
participant: rtc.RemoteParticipant, | ||
): | ||
if track.kind == rtc.TrackKind.KIND_AUDIO: | ||
stream = rtc.AudioStream(track, sample_rate=48000, num_channels=1) |
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.
I think we should abstract further down, and directly allow to add a AudioTrack
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.
do you mean we should add a add_track
and remove_track
method to the AudioMixer class?
def open_output( | ||
self, | ||
*, | ||
apm_for_reverse: Optional[AudioProcessingModule] = None, |
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.
This should be exposed to the user. Let's make this an internal detail
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.
do you mean should not?
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.
Yes sry, it shouldn't
MediaDevices
that provides centralized access to local audio input/outputs.