Google Play Services 10.2包含AudioBytes:https://developers.google.com/android/guides/releases#february_2017_-_v102

据我了解,这是一条消息,可以使用超声波直接从一个设备传输到另一个设备,而不是像附近消息通常那样通过互联网路由有效载荷 .

文档几乎不存在:https://developers.google.com/android/reference/com/google/android/gms/nearby/messages/audio/AudioBytes

但我很困惑,我应该尝试:

AudioBytes audioBytes = new AudioBytes("Hello".getBytes());
Message message = audioBytes.toMessage();
Nearby.Messages.publish(googleApiClient, message);

尽我所知,主要区别在于它改变了Message的 type . 问题是,我的订阅代码永远不会收到使用AudioBytes创建的消息,虽然它确实收到常规消息就好了 . 发布和订阅电话在物理上彼此相邻,并且它们的扬声器和麦克风是可用的 .

我可以在线找到AudioBytes的唯一其他参考是https://www.reddit.com/r/androiddev/comments/5vlt9r/anyone_have_luck_with_nearby_messagings_audiobytes/,这是其他人说他们无法让它工作 .

有什么我做错了吗?或者AudioBytes刚破裂?