Ticket #504 (closed defect: fixed)
Fixed support for stereo audio all the way in pjmedia
| Reported by: | nanang | Owned by: | nanang |
|---|---|---|---|
| Priority: | normal | Milestone: | release-0.9.0 |
| Component: | pjmedia | Version: | trunk |
| Keywords: | Cc: |
Description (last modified by bennylp) (diff)
Identified issues:
- The PA callbacks implementations contains wrong assertion, because of samples_per_frame misinterpretation (thanks Rodrigo Vega, http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/2008-March/001974.html):
- Soundport's samples_per_frame is total samples number per frame of ALL channels.
- While PA's frameCount refers to number of samples for EACH channel.
- Lack of channel_count multiplication in samples_per_frame calculation in some parts of stream causing silence in stereo audio call.
- STEREO_DEMO in pjsua causing crash in PortAudio without call (perhaps because of some pointer to PA buffer get overwritten)
- Add channel_count field in pjsua_media_config to configure number of channels for both sound device and conference bridge. Add --stereo option in pjsua to change set this channel_count field to 2.
- Create two utility functions to:
- convert one mono channel audio frame to N-channel audio frame. Just duplicate the sample to all channels.
- convert N-channel audio from to mono audio frame. The function should have an option to either mix sample from all the channels into one channel, or to just take audio samples from one of the channel. To make the implementation simpler, we can just implement these two functions as inline functions in a new header file (e.g., stereo.h) rather than a media port.
- Use these channel conversion functions in the conference bridge, to convert audio samples from media ports when the media port has different channel number with the conference bridge.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.
![(please configure the [header_logo] section in trac.ini)](/repos/chrome/site/pj.jpg)
