Reputation: 16798
I'm integrating WebRTC into my project (using Java library), and as I can see, it can use pre-defined audio sources like microphone.
I've already implemented a custom audio source that generates PCM data, but I'm struggling to figure out how to inject this data into WebRTC's audio pipeline. I couldn't find any clear documentation or examples on how to achieve this.
Here are my questions:
Any guidance or code examples would be greatly appreciated!
Upvotes: 1
Views: 243
Reputation: 76807
This isn't exactly a Java question, but maybe rather a C++/JNI question.
Whatever implementation one looks at, they all just wrap native assembly.
And this assembly would generally support your requirement: wav_file.cc
.
This is what provides the jingle_peerconnection.so
; for example:
Java wrapper for a C++
AudioSourceInterface
.
Used as the source for one or moreAudioTrack
objects.
In order to get there, one might have to expose more native methods through JNI;
eg. one which permits passing a file-name and one which permits switching the stream.
Or even PCM with voice-over; it all depends which methods the JNI (glue) might expose.
If you'd build the assembly from source, you'd get the debug symbols, to set breakpoints.
This makes it a whole lot easier to deal with, because one doesn't deal with a black box.
Upvotes: 1