def set_bandwidth(self, req):
        if req not in band_ctl:
            raise KeyError('%r is not a valid bandwidth setting. Try one of: %s' % (req, ','.join(band_ctl)))

        k = band_ctl[req]
        ret = _lib.opus_encoder_ctl(self._state, CTL_SET_BANDWIDTH, k)

        if ret < 0:
            log.info('error has happened in set_bandwidth')
            raise OpusError(ret)
dataset/ETHPy150Open Rapptz/discord.py/discord/opus.py/Encoder.set_bandwidth/original