SIPp / sipp

The SIPp testing tool
https://sipp.readthedocs.io
Other
915 stars 380 forks source link

Cannot play wav file of opus into rtp_stream #203

Open salmanchauhan opened 8 years ago

salmanchauhan commented 8 years ago

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.

wdoekes commented 8 years ago

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;
    }