current_frames = 0
                decoder = decoders.SHNDecoder(self.filename)
                frame = decoder.read(4096)
                while (len(frame) > 0):
                    f.write(frame.to_bytes(True, True))
                    current_frames += frame.frames
                    if (progress is not None):
                        progress(current_frames, total_frames)
                    frame = decoder.read(4096)
                f.write(tail)
                f.close()
            except IOError, msg:
                self.__unlink__(aiff_filename)
                raise EncodingError(str(msg))
        else:
            AiffAudio.from_pcm(aiff_filename, to_pcm_progress(self, progress))

    @classmethod
    def from_wave(cls, filename, wave_filename, compression=None,
                  block_size=256, progress=None):
        """encodes a new AudioFile from an existing .wav file

        takes a filename string, wave_filename string
        of an existing WaveAudio file
        and an optional compression level string
        encodes a new audio file from the wave's data
        at the given filename with the specified compression level
        and returns a new ShortenAudio object"""

        wave = WaveAudio(wave_filename)