def get_wave_duration(file_path):
    """
    Gets the duration of a WAV file in seconds.

    :param file_path: Path to the WAV file.
    :return: Duration of the WAV file in seconds.
    """
    try:
        with wave.open(file_path, 'rb') as wf:
            # Get the number of frames
            num_frames = wf.getnframes()
            # Get the frame rate
            frame_rate = wf.getframerate()
            # Calculate duration
            duration = num_frames / float(frame_rate)
            return duration, frame_rate, num_frames
    except wave.Error as e:
        print(f"Error reading {file_path}: {e}")
        return None, None, None
    except FileNotFoundError:
        print(f"File not found: {file_path}")
        return None, None, None
    except Exception as e:
        print(f"An unexpected error occurred: {e}")
        return None, None, None

    Gets the duration of a WAV file in seconds.

    :param file_path: Path to the WAV file.
    :return: Duration of the WAV file in seconds.
    
clearvoice/clearvoice/dataloader/meldataset.py