src/Backend/src/api/adapters/google/speech_to_text.py [167:215]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    async def _rerun_audio(
        self,
        path: str,
        desired: str,
        start_time: datetime.timedelta,
        last_time: datetime.timedelta,
        phrases: str,
        words: list[str],
        duration: int,
        i: int,
        depth: int,
        sample_rate: int | None = None,
        channels: int | None = None,
    ) -> str:
        """
        Method to rerun portion of audio.
        """
        temp_path = await self.storage.download(path, desired)
        temp_path = await self._cut_audio(
            temp_path, desired, start_time.total_seconds(), last_time.total_seconds()
        )
        desired_name = f"{desired.replace('.wav', '')}-{i}.wav"

        new_uri = await self.storage.upload_by_file(f"cutted/{desired_name}", temp_path)
        process_result = await self.process(
            phrases_id=phrases,
            path=f"gs://{new_uri}",
            desired=desired,
            words=words,
            duration=duration,
            depth=depth,
            sample_rate=sample_rate,
            channels=channels,
            model_type="latest_short",
        )
        return process_result

    async def _cut_audio(
        self, audio_path: str, file_name: str, start_time: float, end_time: float
    ) -> str:
        """
        Cut portion of the audio.
        """
        audio_cutted = f"/{self.audio_tmp}/cutted_{file_name}"
        ffmpeg.input(audio_path).output(
            audio_cutted, **{"ss": start_time, "to": end_time}
        ).run(overwrite_output=True, quiet=True)
        os.remove(audio_path)
        return audio_cutted
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



