Hi guys,
I am using pepper 47
I am developing a pepper api to stream audio/video upon network. The audio codec is AAC . In general, all standard AAC codecs, use 512, 1024, 2048 samples to code a frame.
When I call the method configure of the class pp::MediaStreamAudioTrack, I realized that I can set only the PP_MEDIASTREAMAUDIOTRACK_ATTRIB_DURATION, and I cannot set the values for sample rate, sample size and channels number. It seems they are fix, respectively, to 48000, 2, 1.
Here is my code
int32_t attribs[] = {
PP_MEDIASTREAMAUDIOTRACK_ATTRIB_BUFFERS, 1,
/**
* The duration of an audio buffer in milliseconds.
* Valid range: 10 to 10000
*/
PP_MEDIASTREAMAUDIOTRACK_ATTRIB_DURATION, 10,
PP_MEDIASTREAMAUDIOTRACK_ATTRIB_NONE
};
audio_track_.Configure(attribs, callback_factory_.NewCallback(&stream::OnConfigure));
In such situation I cannot retrieve just 512 samples, in fact when I set
PP_MEDIASTREAMAUDIOTRACK_ATTRIB_DURATION = 10 I recover 480 samples and when I set PP_MEDIASTREAMAUDIOTRACK_ATTRIB_DURATION = 11 I recover 528. So I am around to 512.
Right now my work around was to truncate the number of sample from 528 to 512 and fill the decoder with 512 samples.
What am I doing wrong ?
What I did not understand ?
Thanks in advance,
Giovanni