def clip_upload_as_reel_with_music(
        self,
        path: Path,
        caption: str,
        track: Track,
        extra_data: Dict[str, str] = {},
    ) -> Media:

        """
        Upload CLIP as reel with music metadata.
        It also add the music under the video, therefore a mute video is required.

        If you just want to add music metadata to your reel,
        just copy the extra data you find here and add it
        to the extra_data parameter of the clip_upload function.

        Parameters
        ----------
        path: Path
            Path to CLIP file
        caption: str
            Media caption
        track: Track
            The music track to be added to the video reel
            use cl.search_music(title)[0].dict()

        extra_data: Dict[str, str], optional
            Dict of extra data, if you need to add your params, like {"share_to_facebook": 1}.

        Returns
        -------
        Media
            A Media response from the call
        """
        tmpaudio = Path(tempfile.mktemp(".m4a"))
        tmpaudio = self.track_download_by_url(track.uri, "track", tmpaudio.parent)
        try:
            highlight_start_time = track.highlight_start_times_in_ms[0]
        except IndexError:
            highlight_start_time = 0
        try:
            import moviepy.editor as mp
        except ImportError:
            try:
                import moviepy as mp
            except ImportError:
                raise Exception("Please install moviepy>=1.0.3 and retry")
        # get all media to create the reel
        video = mp.VideoFileClip(str(path))
        audio_clip = mp.AudioFileClip(str(tmpaudio))
        # set the start time of the audio and create the actual media
        start = highlight_start_time / 1000
        end = highlight_start_time / 1000 + video.duration
        audio_clip = audio_clip.subclip(start, end)
        video = video.set_audio(audio_clip)
        # save the media in tmp folder
        tmpvideo = Path(tempfile.mktemp(".mp4"))
        video.write_videofile(str(tmpvideo))
        # close the media
        try:
            video.close()
        except AttributeError:
            pass
        try:
            audio_clip.close()
        except AttributeError:
            pass
        # create the extra data to upload with it
        data = extra_data or {}
        data["clips_audio_metadata"] = (
            {
                "original": {"volume_level": 0.0},
                "song": {
                    "volume_level": 1.0,
                    "is_saved": "0",
                    "artist_name": track.display_artist,
                    "audio_asset_id": track.id,
                    "audio_cluster_id": track.audio_cluster_id,
                    "track_name": track.title,
                    "is_picked_precapture": "1",
                },
            },
        )
        data["music_params"] = {
            "audio_asset_id": track.id,
            "audio_cluster_id": track.audio_cluster_id,
            "audio_asset_start_time_in_ms": highlight_start_time,
            "derived_content_start_time_in_ms": 0,
            "overlap_duration_in_ms": 15000,
            "product": "story_camera_clips_v2",
            "song_name": track.title,
            "artist_name": track.display_artist,
            "alacorn_session_id": "null",
        }
        clip_upload = self.clip_upload(tmpvideo, caption, extra_data=data)
        # remove the tmp files
        tmpvideo.unlink()
        tmpaudio.unlink()
        return clip_upload

        Upload CLIP as reel with music metadata.
        It also add the music under the video, therefore a mute video is required.

        If you just want to add music metadata to your reel,
        just copy the extra data you find here and add it
        to the extra_data parameter of the clip_upload function.

        Parameters
        ----------
        path: Path
            Path to CLIP file
        caption: str
            Media caption
        track: Track
            The music track to be added to the video reel
            use cl.search_music(title)[0].dict()

        extra_data: Dict[str, str], optional
            Dict of extra data, if you need to add your params, like {"share_to_facebook": 1}.

        Returns
        -------
        Media
            A Media response from the call
        
instagrapi/mixins/clip.py