sipp icon indicating copy to clipboard operation
sipp copied to clipboard

Cannot play wav file of opus into rtp_stream

Open salmanchauhan opened this issue 9 years ago • 1 comments

When I am trying to play a .wav file of opus codec the audio is not clear and very distorted any help will be surely appreciated.

salmanchauhan avatar Mar 21 '16 13:03 salmanchauhan

As far as I can tell, there is no built in support for Opus, only ulaw, alaw and g729. If these values match your opus codec, it might work, but if it doesn't, you'll surely get distorted audio.

    /* Setup based on what we know of payload types */
    switch (M_rtpstream_actinfo.payload_type) {
    case 0:
        M_rtpstream_actinfo.ms_per_packet = 20;
        M_rtpstream_actinfo.bytes_per_packet = 160;
        M_rtpstream_actinfo.ticks_per_packet = 160;
        break;
    case 8:
        M_rtpstream_actinfo.ms_per_packet = 20;
        M_rtpstream_actinfo.bytes_per_packet = 160;
        M_rtpstream_actinfo.ticks_per_packet = 160;
        break;
    case 18:
        M_rtpstream_actinfo.ms_per_packet = 20;
        M_rtpstream_actinfo.bytes_per_packet = 20;
        M_rtpstream_actinfo.ticks_per_packet = 160;
        break;
    default:
        M_rtpstream_actinfo.ms_per_packet= -1;
        M_rtpstream_actinfo.bytes_per_packet= -1;
        M_rtpstream_actinfo.ticks_per_packet= -1;
        ERROR("Unknown rtp payload type %d - cannot set playback parameters\n",
              M_rtpstream_actinfo.payload_type);
        break;
    }

wdoekes avatar Mar 23 '16 15:03 wdoekes