android - 通过蓝牙的通知音

发布于 2024-10-05 02:12:39 字数 76 浏览 0 评论 0原文

有没有办法通过蓝牙播放声音?

我不想传输音频或任何花哨的东西,我只是想让耳机发出蜂鸣声,就像按下屏幕按钮或接到电话时一样。

is there a way to play a tone over bluetooth?

I'm not trying to stream audio or anything fancy, I just want the headset to make a beep sound like when pressing an on screen button or getting a call.

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

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

发布评论

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

评论(1

玩心态 2024-10-12 02:12:39

当前没有方法来指定设备播放声音。它将始终在默认输出设备上播放。

如果此时蓝牙耳机是默认输出设备,则其中会听到MediaPlayer的声音。

音频和视频

音频和视频播放

媒体可以从任何地方播放:
来自原始资源、来自文件
系统,或从可用的
网络(URL)。

您只能播放音频数据
到标准输出设备;
目前,这是移动设备
扬声器或蓝牙耳机。你
无法播放声音文件
对话音频。

There is no current way to assign the device to play a sound. It will always play to the default output device.

If the Bluetooth headset is the default output device at that time, the MediaPlayer sounds will be heard in it.

Audio and Video

Audio and Video Playback

Media can be played from anywhere:
from a raw resource, from a file from
the system, or from an available
network (URL).

You can play back the audio data only
to the standard output device;
currently, that is the mobile device
speaker or Bluetooth headset. You
cannot play sound files in the
conversation audio.

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