我开发了一个内核模块(Android),它为我提供:
PCM
16-bit
48000 Hz
2 channel
我想用java将它流式传输到Apple的机场快线(AEX)。
AEX 需要 44.1 kHz PCM,所以我必须重新采样 PCM 流。
我有以下可能性,但哪个是最好的?
1. 使用 C 程序“raop_play”(raop-play的一部分)
advantages:
high-performant due to native C
already uses libsamplerate to resample wav, mp3, ogg, flac, aac, pls
openssl as static library
usable via command-line from my java-program via Runtime.exec()
disadvantages:
I am relative new to C
overloaded: I don't need wav, mp3.. only PCM
many dependencies with GPL-libraries which I have to compile for Android
only supports PCM already with 44.1 kHz, no resampling for PCM implemented yet
-> have to implement resampling for PCM
2.在java中重采样和流(使用libresample JNI-bridge)
advantages:
I CAN java :)
middle-performant due to resamling in C , but streaming in java
just one dependency to LGPL-library
no Runtime.exec() needed
disadvantages:
needs [bouncycastle][3] for AES which is a bit larger than openssl
less performant than solution #1 (but maybe fast enough)
3. 内核模块中已经重采样
advantages:
most performant
no resampling at higher level
disadvantages:
I am relative new to C
Is it possible to use libsamplerate or libresample in kernel-space?!