I have been trying for about a week now to get an extremely difficult concept completed for a project. I am attempting to use the 19 bytes BLE
allows to transfer raw PCM data through Bluetooth LE
to all other Android devices in the vicinity.
我现在已经尝试了大约一个星期来为一个项目完成一个非常困难的概念。我试图使用19字节BLE允许通过蓝牙LE将原始PCM数据传输到附近的所有其他Android设备。
I used Audacity to reduce a FLAC format song into a mono, 2000Hz sample rate, 8-bit unsigned WAV file, which still sounds semi-decent. The problem is that the BLE loads the data through to nearby devices at a rate half of what is needed to stream the file on the other side (part of my plan is to have the song streamed live on each device).
我使用Audacity将FLAC格式歌曲缩减为单声道,2000Hz采样率,8位无符号WAV文件,这仍然听起来不太合适。问题是BLE将数据加载到附近的设备,其速率是在另一端流式传输文件所需的速率的一半(我的计划的一部分是让歌曲在每个设备上实时流式传输)。
My plan is to send the data to the other device, upsample the 2000Hz audio data into 4000Hz audio data; This is the lowest sample rate supported by AudioTrack that I know of. In regular Java I could use the Tritonus packages to change the sample rate up to the necessary Hz level, but I can't get the package to load in Android (I'm using Android Studio).
我的计划是将数据发送到其他设备,将2000Hz音频数据上采样为4000Hz音频数据;这是我所知道的AudioTrack支持的最低采样率。在常规Java中,我可以使用Tritonus包将采样率更改为必要的Hz级别,但我无法在Android中加载包(我正在使用Android Studio)。
Basically I am asking, is there a known package or algorithm that can upsample raw music data that is Android-compatible? I am digging through the Tritonus page for code snippets that might help me along the way. I am getting very little sleep... all programming and no play makes omikey a dull boy...
基本上我要问的是,是否有一个已知的包或算法可以对Android兼容的原始音乐数据进行上采样?我正在挖掘Tritonus页面中的代码片段,这可能对我有所帮助。我睡得很少......所有节目和没有戏剧让omikey成为一个沉闷的男孩......
2 个解决方案
#1
Maybe you should look into 7zip. It has the best compression rate and runs at a decent speed.
也许你应该看看7zip。它具有最佳的压缩率并以合适的速度运行。
#2
I ended up adding some of the Tritonus files I mentioned before, but they required a java package not included with Android. This is a bit hacky, but I just ended up taking the code from the original java packages I needed and included them in my library files. Now it works! Well... the sound quality is still abysmal, but the sample rate conversion works quickly.
我最后添加了一些我之前提到过的Tritonus文件,但是他们需要一个不包含在Android中的java包。这有点hacky,但我最终从我需要的原始java包中获取代码并将它们包含在我的库文件中。现在它有效!嗯...音质仍然很糟糕,但采样率转换很快就能完成。
#1
Maybe you should look into 7zip. It has the best compression rate and runs at a decent speed.
也许你应该看看7zip。它具有最佳的压缩率并以合适的速度运行。
#2
I ended up adding some of the Tritonus files I mentioned before, but they required a java package not included with Android. This is a bit hacky, but I just ended up taking the code from the original java packages I needed and included them in my library files. Now it works! Well... the sound quality is still abysmal, but the sample rate conversion works quickly.
我最后添加了一些我之前提到过的Tritonus文件,但是他们需要一个不包含在Android中的java包。这有点hacky,但我最终从我需要的原始java包中获取代码并将它们包含在我的库文件中。现在它有效!嗯...音质仍然很糟糕,但采样率转换很快就能完成。