启动设备时禁用麦克风的Android模拟器

发布于 2025-01-27 08:41:16 字数 1239 浏览 3 评论 0原文

在启动仿真器时如何禁用(虚拟)麦克风?

情况
在启动Android Studio库存模拟器设备时,麦克风始终启用和侦听。

为什么我们要这个修复程序

  • 便利性,许多用户具有麦克风耳机,并且当启用麦克风时,他们会失去降噪和/或立体声。这可能非常烦人,迫使用户断开将模拟器音频 +声音交换到另一个麦克风/扬声器输入/输出的设备。
  • 安全风险,麦克风正在积极倾听。数据是否在任何地方?谁知道...对于任何组织来说,这都是不必要的安全风险,即开发人员正在使用使用麦克风和聆听的开放式仿真器(Zoom,Teams,会议)呼叫)。

可能的解决方案(基于实用性)

  1. 标志以禁用虚拟音频设备(即带有Mac的扬声器或带有麦克风的附加耳机)。我已经看到了0个关于这样的标志的文档。
  2. 标志以提供给模拟器以禁用所有音频输入(请参阅答案1)。 tldr添加标志-no-audio
  3. 路由Android Studio Emulator(或Mac的麦克风音频输入)到不侦听的虚拟设备中。或将默认的OS麦克风输入设置为0卷。这可以通过MACOSX Automator
  4. 将ADB模拟器路由到Mac的内部麦克风而不是电流麦克风来完成,以避免触发头戴式麦克风设置。

首选解决方案

  • 麦克风音频启动时,启动模拟器
  • Android设备的音频保留并使用计算机的默认扬声器
  • (完全没有触发计算机的默认麦克风)来避免立即引起立体声 - &GT ;单声道交换或消除噪声破裂。

系统信息:

  • Android仿真器:31.2.10.0
  • MacOS 12.3.1
  • 测试了这些问题:
    • Bose NC 700
    • Bose QC系列
    • Sony WF-1000XM4
    • Sony WH-1000XM3
    • 任何带有麦克风连接宏的耳机与扬声器(例如通话)或输入音频(如Stereo) - >单声道。

How do we disable the (virtual) microphone when launching the emulator?

Situation
When launching an Android Studio stock emulator device, the microphone is always enabled and listening.

Why would we want this fix

  • Convenience, Many users have a microphone headset and when the microphone is enabled, they lose noise canceling and/or stereo. It can be extremely annoying, forcing the user to disconnect the device which swaps the emulator audio + sounds to another microphone/speaker input/output.
  • Security risk, the microphone is actively listening. Is the data going anywhere? Who knows...this is an unnecessary security risk for any organization, IE a dev is on a (zoom, teams, meetings) call with an open emulator that is using the microphone and listening).

Possible Solutions (based on practicality)

  1. flag to disable virtual audio devices (IE the mac's speaker or attached headphones w/ a microphone). I've seen 0 documentation regarding a flag like this.
  2. flag to provide to the emulator to disable all audio input (see answer 1). TLDR add the flag -no-audio
  3. route the android studio emulator (or the mac's microphone audio input) to a virtual device that is not listening. Or have the default OS microphone input set to 0 volume. This can be done via macOSX Automator
  4. route the adb emulator to the mac's internal microphone instead of the current microphone to avoid it triggering the headsets microphone settings.

The preferred solution

  • Microphone audio-in is disabled when booting the emulator
  • Android device audio-out remains and uses the computer's default speakers
  • The computer's default microphone is not triggered (at all) to avoid causing a stereo -> mono swap or noise cancellation breakage.

System Information:

  • android emulator: 31.2.10.0
  • MacOS 12.3.1
  • Headsets tested with these issues:
    • Bose NC 700
    • Bose QC series
    • Sony WF-1000XM4
    • Sony WH-1000XM3
    • any headset with a microphone connection macro that does something with the speaker (like talk through) or with the input audio like stereo -> mono.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

故事与诗 2025-02-03 08:41:16

您可以从这里尝试以下方法:

当我启动Android模拟器时,Mac桌面上的音频停止
它工作得很好。

将下面的值从模拟器中设置为config.ini。它将再也不会打扰您了。

hw.audioInput=no
hw.audioOutput=no

You can try the approach from here:

When I start Android Emulator, the audio on my Mac desktop stops
It just works well.

Set the values below into the config.ini from your emulator. It will never bother you again.

hw.audioInput=no
hw.audioOutput=no
左耳近心 2025-02-03 08:41:16

基于模拟器的可选论点的部分解决方案,该论点 可以从启动的仿真器中禁用所有音频。

运行仿真器-help-all命令-no-audio-noaudio可用于传递。

这些命令是相同的,并且禁用所有音频,因此没有麦克风或音频从模拟器中删除。

示例命令

模拟器-avd< name> -no-audio

pros :运行上述命令,使用麦克风禁用来启动模拟器。 Microsnitch之类的耳机和应用不会检测到麦克风活性。

cons :单击UI或通过模拟器播放音频不会通过机器(或耳机)扬声器播放音频。

Partial solution based on the emulator's optional arguments which disables all audio in/out from the launched emulator.

Running emulator -help-all the commands -no-audio and -noaudio are available to pass.

These commands are the same and disable ALL audio, so no microphone or audio out from the emulator.

Example command

emulator -avd <name> -no-audio

Pros: Running the above command, launches the emulator with the microphone disabled. Headsets and apps like microsnitch will not detect microphone activity.

Cons: Clicking on the UI, or playing audio through the emulator will not play audio through the machine (or headset) speakers.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文