'Returns a byte string representing the raw frame data for the audio represented by the ``AudioData`` instance.
If ``convert_rate`` is specified and the audio sample rate is not ``convert_rate`` Hz, the resulting audio is resampled to match.
If ``convert_width`` is specified and the audio samples are not ``convert_width`` bytes each, the resulting audio is converted to match.
Writing these bytes directly to a file results in a valid `RAW/PCM audio file <https://en.wikipedia.org/wiki/Raw_audio_format>`__.'

def get_raw_data(self, convert_rate=None, convert_width=None):

    assert ((convert_rate is None) or (convert_rate > 0)), 'Sample    rate    to    convert    to    must    be    a    positive    integer'
    assert ((convert_width is None) or (((convert_width % 1) == 0) and (1 <= convert_width <= 4))), 'Sample    width    to    convert    to    must    be    between    1    and    4    inclusive'
    raw_data = self.frame_data
    if (self.sample_width == 1):
        raw_data = audioop.bias(raw_data, 1, (-128))
    if ((convert_rate is not None) and (self.sample_rate != convert_rate)):
        (raw_data, _) = audioop.ratecv(raw_data, self.sample_width, 1, self.sample_rate, convert_rate, None)
    if ((convert_width is not None) and (self.sample_width != convert_width)):
        if (convert_width == 3):
            raw_data = audioop.lin2lin(raw_data, self.sample_width, 4)
            try:
                audioop.bias('', 3, 0)
            except audioop.error:
                raw_data = ''.join((raw_data[(i + 1):(i + 4)] for i in range(0, len(raw_data), 4)))
            else:
                raw_data = audioop.lin2lin(raw_data, self.sample_width, convert_width)
        else:
            raw_data = audioop.lin2lin(raw_data, self.sample_width, convert_width)
    if (convert_width == 1):
        raw_data = audioop.bias(raw_data, 1, 128)
    return raw_data
