仅从 10 厘米处检测音频。仅在人说话时流式传输音频 android

Detect audio only from 10 cm. Stream audio only when person speaks android

我正在开发一个会议系统,所有电话都通过 google 附近的服务 api 相互连接。我已经按照 link: https://github.com/googlesamples/android-nearby/tree/master/connections/walkietalkie in this tutorial the person must press volume key to talk. What I want is that the person should not press the voulume key but when he starts to talk it should stream the voice. For this I followed the following link: Voice Detection in Android Application 中的 google 对讲机教程进行操作,但是当我测试它时,声音断断续续,无法准确地听清其他人在说什么。我已经用 8000 和 44100 测试了 RECORDER_SAMPLERATE 但没有成功。此外,我希望我的麦克风仅传输来自 10 厘米的声音。例如,如果这个人在 10 厘米内说话,它应该传输声音,而在他旁边说话的人和他距离麦克风 10 厘米远的人应该听不到他的声音。

您可以使用 FFmpeg 进行降噪处理。 Android 有一个很好的 FFmpeg 包装器。您可以导航到此 https://github.com/WritingMinds/ffmpeg-android-java 存储库。然后在android.

中集成这个FFmpeg

之后,你可以使用下面的命令来降噪

ffmpeg -i <input_file> -af "highpass=f=200, lowpass=f=3000" <output_file>

这只会降低噪音。我认为这个范围可以很好地消除噪音。您可以根据需要更改它。但是您可以使用 FFmpeg 库做很多事情。这是一个非常强大的库。导航到 https://ffmpeg.org/ffmpeg.html 这个。你可以找到很多音频编辑命令。他们中的大多数可以在这个 FFmpeg android 包装器中使用。 我认为您需要将 ffmpeg 替换为 -y 才能在该 FFmpeg 包装器

中执行命令