【发布时间】:2012-06-28 14:25:33
【问题描述】:
我开发了一个内核模块 (Android),它为我提供:
PCM
16-bit
48000 Hz
2 channel
我想用 java 将它流式传输到 Apple 的 Airport Express (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?!
【问题讨论】:
标签: java c java-native-interface kernel-module resampling