yta-audio-narration 0.0.9__py3-none-any.whl → 0.0.10__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,220 +1,6 @@
1
- # TODO: Mix this narrator with the coqui
2
- # because they are using the same engine
3
-
4
- # """
5
- # This voice engine is based in Coqui and I
6
- # have another voice engine which is Coqui,
7
- # but using other voice narrators.
8
-
9
- # TODO: Consider mixing both voice engines
10
- # and appending this voice narrator to the
11
- # Coqui system and keep only one of them.
12
-
13
- # -- Update 19/04/2025 --
14
- # I've found that they created a fork in
15
- # https://github.com/idiap/coqui-ai-TTS with
16
- # a new version that is maintained, and the
17
- # 'tts' was generating conflicts.
18
- # """
19
- # from yta_audio_narration_common.consts import DEFAULT_VOICE
20
- # from yta_audio_narration_common.enums import NarrationLanguage, VoiceEmotion, VoiceSpeed, VoicePitch
21
- # from yta_audio_narration_common.voice import NarrationVoice
22
- # from yta_constants.enum import YTAEnum as Enum
23
- # from yta_constants.file import FileType
24
- # from yta_programming.output import Output
25
- # from typing import Union
26
- # from TTS.api import TTS
27
-
28
-
29
- # """
30
- # The options below are specified even if we
31
- # don't use them later when processing the
32
- # voice narration. This is to keep the same
33
- # structure for any voice narration and to
34
- # simplify the way we offer the options in
35
- # an API that is able to make requests.
36
- # """
37
-
38
- # # 1. The voices we accept, as Enums
39
- # class TortoiseVoiceName(Enum):
40
- # """
41
- # Available voices. The value is what is used
42
- # for the audio creation.
43
- # """
44
-
45
- # DEFAULT = DEFAULT_VOICE
46
- # SPANISH = 'es_002'
47
- # MEXICAN = 'es_mx_002'
48
- # # TODO: There a a lot of English US and more languages voices
49
-
50
- # # 2. The languages we accept
51
- # LANGUAGE_OPTIONS = [
52
- # NarrationLanguage.SPANISH,
53
- # NarrationLanguage.DEFAULT
54
- # ]
55
-
56
- # # 3. The emotions we accept
57
- # EMOTION_OPTIONS = [
58
- # VoiceEmotion.DEFAULT,
59
- # VoiceEmotion.NORMAL,
60
- # ]
61
-
62
- # # 4. The speeds we accept
63
- # SPEED_OPTIONS = [
64
- # VoiceSpeed.DEFAULT,
65
- # VoiceSpeed.NORMAL,
66
- # ]
67
-
68
- # # 5. The pitches we accept
69
- # PITCH_OPTIONS = [
70
- # VoicePitch.DEFAULT,
71
- # VoicePitch.NORMAL,
72
- # ]
73
-
74
- # class TortoiseNarrationVoice(NarrationVoice):
75
- # """
76
- # Voice instance to be used when narrating with
77
- # Tortoise engine.
78
- # """
79
-
80
- # @property
81
- # def processed_name(
82
- # self
83
- # ) -> str:
84
- # """
85
- # Get the usable name value from the one that has
86
- # been set when instantiating the instance.
87
- # """
88
- # # TODO: We are not using voice names here
89
- # return None
90
-
91
- # @property
92
- # def processed_emotion(
93
- # self
94
- # ) -> str:
95
- # """
96
- # Get the usable emotion value from the one that
97
- # has been set when instantiating the instance.
98
- # """
99
- # # This narration is not able to handle any
100
- # # emotion (at least by now)
101
- # return None
102
-
103
- # @property
104
- # def processed_speed(
105
- # self
106
- # ) -> int:
107
- # """
108
- # Get the usable speed value from the one that
109
- # has been set when instantiating the instance.
110
- # """
111
- # # This is not used here
112
- # return None
113
-
114
- # @property
115
- # def processed_pitch(
116
- # self
117
- # ) -> int:
118
- # """
119
- # Get the usable pitch value from the one that
120
- # has been set when instantiating the instance.
121
- # """
122
- # # This is not used here
123
- # return None
124
-
125
- # @property
126
- # def processed_language(
127
- # self
128
- # ) -> str:
129
- # """
130
- # Get the usable language value from the one that
131
- # has been set when instantiating the instance.
132
- # """
133
- # language = (
134
- # NarrationLanguage.SPANISH
135
- # if self.language == NarrationLanguage.DEFAULT else
136
- # self.language
137
- # )
138
-
139
- # return {
140
- # NarrationLanguage.SPANISH: 'es'
141
- # }[language]
142
-
143
- # def validate_and_process(
144
- # self,
145
- # name: str,
146
- # emotion: VoiceEmotion,
147
- # speed: VoiceSpeed,
148
- # pitch: VoicePitch,
149
- # language: NarrationLanguage
150
- # ):
151
- # TortoiseVoiceName.to_enum(name)
152
- # if VoiceEmotion.to_enum(emotion) not in EMOTION_OPTIONS:
153
- # raise Exception(f'The provided {emotion} is not valid for this narration voice.')
154
- # if VoiceSpeed.to_enum(speed) not in SPEED_OPTIONS:
155
- # raise Exception(f'The provided {speed} is not valid for this narration voice.')
156
- # if VoicePitch.to_enum(pitch) not in PITCH_OPTIONS:
157
- # raise Exception(f'The provided {pitch} is not valid for this narration voice.')
158
- # if NarrationLanguage.to_enum(language) not in LANGUAGE_OPTIONS:
159
- # raise Exception(f'The provided {language} is not valid for this narration voice.')
160
-
161
- # @staticmethod
162
- # def default():
163
- # return TortoiseNarrationVoice(
164
- # name = TortoiseVoiceName.DEFAULT.value,
165
- # emotion = VoiceEmotion.DEFAULT,
166
- # speed = VoiceSpeed.DEFAULT,
167
- # pitch = VoicePitch.DEFAULT,
168
- # language = NarrationLanguage.DEFAULT
169
- # )
170
-
171
- # # The voices but for a specific language, to be able to
172
- # # choose one when this is requested from the outside
173
- # def get_narrator_names_by_language(
174
- # language: NarrationLanguage
175
- # ) -> list[str]:
176
- # language = NarrationLanguage.to_enum(language)
177
- # language = (
178
- # NarrationLanguage.SPANISH
179
- # if language is NarrationLanguage.DEFAULT else
180
- # language
181
- # )
182
-
183
- # return {
184
- # NarrationLanguage.SPANISH: [
185
- # TortoiseVoiceName.DEFAULT.value,
186
- # ]
187
- # }[language]
188
-
189
- # # All the remaining functionality we need to make it
190
- # # work properly
191
- # def narrate(
192
- # text: str,
193
- # voice: TortoiseNarrationVoice = TortoiseNarrationVoice.default(),
194
- # output_filename: Union[str, None] = None
195
- # ):
196
- # """
197
- # @deprecated
198
-
199
- # TODO: Remove this file and method if useless. Please, read below to check.
200
- # This method should be removed and also the file as it is only one specific
201
- # model in TTS narration library. It is not a different system. So please,
202
- # remove it if it won't be used.
203
- # """
204
- # output_filename = Output.get_filename(output_filename, FileType.AUDIO)
205
-
206
- # # TODO: Delete tortoise lib?
207
- # # TODO: Delete en/multi-datase/tortoise-v2 model
208
- # tts = TTS("tts_models/es/multi-dataset/tortoise-v2")
209
-
210
- # # Check code here: https://docs.coqui.ai/en/latest/models/tortoise.html
211
- # tts.tts_to_file(text = text, language = voice.processed_language, file_path = output_filename)
212
-
213
- # return output_filename
214
-
215
- # #reference_clips = [utils.audio.load_audio(p, 22050) for p in clips_paths]
216
-
217
- # #pcm_audio = tts.tts(text)
218
- # #pcm_audio = tts.tts_with_preset("your text here", voice_samples=reference_clips, preset='fast')
219
-
220
- # #from tortoise.utils.audio import load_audio, load_voice
1
+ """
2
+ TODO: Do we make this optional or not? If it
3
+ is optional we can allow installing the libs
4
+ only if using this one.
5
+ """
6
+ from yta_audio_narration_tortoise import TortoiseVoiceName, LANGUAGE_OPTIONS, EMOTION_OPTIONS, SPEED_OPTIONS, PITCH_OPTIONS, TortoiseNarrationVoice, get_narrator_names_by_language, narrate
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: yta-audio-narration
3
- Version: 0.0.9
3
+ Version: 0.0.10
4
4
  Summary: Youtube Autonomous Audio Narration Module.
5
5
  Author: danialcala94
6
6
  Author-email: danielalcalavalera@gmail.com
@@ -14,6 +14,7 @@ Requires-Dist: yta_audio_narration_microsoft (>=0.0.1,<1.0.0)
14
14
  Requires-Dist: yta_audio_narration_open_voice (>=0.0.1,<1.0.0)
15
15
  Requires-Dist: yta_audio_narration_tetyys (>=0.0.1,<1.0.0)
16
16
  Requires-Dist: yta_audio_narration_tiktok (>=0.0.1,<1.0.0)
17
+ Requires-Dist: yta_audio_narration_tortoise (>=0.0.1,<1.0.0)
17
18
  Requires-Dist: yta_audio_narration_ttsmp3 (>=0.0.1,<1.0.0)
18
19
  Requires-Dist: yta_constants (>=0.0.1,<1.0.0)
19
20
  Requires-Dist: yta_programming (>=0.0.1,<1.0.0)
@@ -8,9 +8,9 @@ yta_audio_narration/voices/microsoft.py,sha256=DnMyc2C5Zy2VEpYK2Xljsrhx8QibUPlIr
8
8
  yta_audio_narration/voices/open_voice.py,sha256=zU4LmXVAHgF3YCMrM--55RM1UGQX7kn9Y2137wCNu1Y,347
9
9
  yta_audio_narration/voices/tetyys.py,sha256=CFVpUJLA_SK7_wMBnhl4mlPNgI-VKvxXy0aX7MvxoxE,316
10
10
  yta_audio_narration/voices/tiktok.py,sha256=hX-u3Aqlu93IxahnrWGoGYIPJCPelsv7lxaxjoX1blE,316
11
- yta_audio_narration/voices/tortoise.py,sha256=i-UVNDBqrete4Eb82Sh_G8vLgmsshsyKkqxVAPvNHtE,7039
11
+ yta_audio_narration/voices/tortoise.py,sha256=B1126W-BMkOe1iHmGvKixVnIqFDjE_3QFVxaW79p7Is,315
12
12
  yta_audio_narration/voices/ttsmp3.py,sha256=zwZftMuM_lziR9DBvaWC7m8QZYsF0i5H71BQzkKA7Sk,314
13
- yta_audio_narration-0.0.9.dist-info/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
14
- yta_audio_narration-0.0.9.dist-info/METADATA,sha256=tYJGZDyOrHK3OTKhl_azAsdTSlWMnklcz4ZDRwKHxgE,1101
15
- yta_audio_narration-0.0.9.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
16
- yta_audio_narration-0.0.9.dist-info/RECORD,,
13
+ yta_audio_narration-0.0.10.dist-info/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
14
+ yta_audio_narration-0.0.10.dist-info/METADATA,sha256=qNsfWJyW_lAWvC7Ku4CizffvkBi0Qc92sktbjr1q3i0,1163
15
+ yta_audio_narration-0.0.10.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
16
+ yta_audio_narration-0.0.10.dist-info/RECORD,,