英文:
WebRtc android custom audio input
问题
我有一串类似于JavaAudioDeviceModule中WebRtc提供的短音频字节流。
我想将其发送到WebRtc后端。
唯一的方法是从中创建AudioTrack,然后添加到peerConnection吗?
如果是的,那么如何将自定义流提供给这个native c++指针?
package org.webrtc;
public class AudioTrack extends MediaStreamTrack {
public AudioTrack(long nativeTrack) {
super(nativeTrack);
}
public void setVolume(double volume) {
nativeSetVolume(this.getNativeAudioTrack(), volume);
}
public long getNativeAudioTrack() {
return this.getNativeMediaStreamTrack();
}
private static native void nativeSetVolume(long var0, double var2);
}
英文:
I have stream of shorts/bytes of audio the similar as WebRtc gives in JavaAudioDeviceModule.
I want to send it to WebRtc backend.
Is the only way to do it to create AudioTrack from it and add to peerConnection?
If yes, then how can I feed custom stream to this native c++ pointer?
package org.webrtc;
public class AudioTrack extends MediaStreamTrack {
public AudioTrack(long nativeTrack) {
super(nativeTrack);
}
public void setVolume(double volume) {
nativeSetVolume(this.getNativeAudioTrack(), volume);
}
public long getNativeAudioTrack() {
return this.getNativeMediaStreamTrack();
}
private static native void nativeSetVolume(long var0, double var2);
}
专注分享java语言的经验与见解,让所有开发者获益!
评论