def init_from_wave_file(wavpath):
        """Init a sonic visualiser environment structure based the analysis 
        of the main audio file. The audio file have to be encoded in wave

        Args:
          wavpath(str): the full path to the wavfile 
        """

        try:
            samplerate, data =  SW.read(wavpath)
            nframes = data.shape[0]
        except:
            # scipy cannot handle 24 bit wav files
            # and wave cannot handle 32 bit wav files
            try:
                w = wave.open(wavpath)
                samplerate = w.getframerate()
                nframes = w.getnframes()
            except:
                raise Exception('Cannot decode wavefile ' + wavpath)

        return SVEnv(samplerate, nframes, wavpath)
Init a sonic visualiser environment structure based the analysis 
        of the main audio file. The audio file have to be encoded in wave

        Args:
          wavpath(str): the full path to the wavfile