def METHOD_NAME(source, raw_format_param):
    if source.ext not in ['.wav', '.raw']:
        raise ValueError("path should contains filename extension and"
                         " only .raw .wav formats are now supported.")
    if source.ext == '.raw' and raw_format_param is None:
        raise ValueError("raw_format_param which contains sample_width, frame_rate, and channels"
                         " need to be provided when read raw format audio file.")