Skip to content

Commit 9df957a

Browse files
committed
Created project tree
1 parent 767c0dd commit 9df957a

File tree

5 files changed

+67
-0
lines changed

5 files changed

+67
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
11
# voice_ukr_to_eng
2+
3+
## Setup
4+
5+
6+
## Use
7+

results/.gitkeep

Whitespace-only changes.

src/main.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import uuid
2+
from utils import (
3+
get_aduio_from_youtube_video,
4+
transcribe,
5+
translate,
6+
create_voice_samples_dataset,
7+
generate_translated_speech,
8+
merge_audio_samples
9+
)
10+
11+
12+
def main(url: str):
13+
audio = get_aduio_from_youtube_video(audio)
14+
transcription = transcribe(audio) # [(time_start, time_end, text), ...]
15+
translation = translate(transcription) # [(time_start, time_end, translated_text), ...]
16+
path_to_voice_samples = create_voice_samples_dataset(audio, transcription)
17+
path_to_generated_audio = generate_translated_speech(path_to_voice_samples, translation)
18+
path_to_result_audio = merge_audio_samples(path_to_generated_audio, translation)
19+
return path_to_result_audio
20+
21+
if __name__ == "__main__":
22+
url = "https://www.youtube.com/watch?v=prfaWHQoxVg"
23+
main(url)
24+

src/utils.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
from typing import Dict, List
2+
3+
4+
class TranscriptionElement:
5+
"""Basic element of Transcription with time stamps.
6+
Full transcription is a list of such elements"""
7+
time_start: float
8+
time_end: float
9+
text: str
10+
11+
12+
def get_aduio_from_youtube_video(url: str):
13+
raise NotImplemented()
14+
15+
16+
def transcribe(audio) -> List[TranscriptionElement]:
17+
raise NotImplemented()
18+
19+
20+
def translate() -> List[TranscriptionElement]:
21+
raise NotImplemented()
22+
23+
24+
def create_voice_samples_dataset(audio, transcription: List[TranscriptionElement]) -> str:
25+
raise NotImplemented()
26+
27+
28+
def generate_translated_speech(path_to_voice_samples: str, translation: List[TranscriptionElement]):
29+
raise NotImplemented()
30+
31+
32+
def merge_audio_samples(path_to_generated_audio: str, transcription: List[TranscriptionElement]):
33+
raise NotImplemented()
34+
35+
36+
if __name__ == "__main__":
37+
print("Hello")

test/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)