cutted 0.2.1__py3-none-any.whl → 0.3.1__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.
cutted/__init__.py CHANGED
@@ -1,2 +1,2 @@
1
- __version__ = "0.1.0"
1
+ __version__ = "0.3.1"
2
2
  __author__ = "simon0302010"
cutted/app.py CHANGED
@@ -8,9 +8,19 @@ from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
8
8
 
9
9
  customtkinter.set_appearance_mode("Dark")
10
10
 
11
+ try:
12
+ from .core import transcribe
13
+ whisper_support = True
14
+ print_info("Whisper support present.")
15
+ except:
16
+ whisper_support = False
17
+ print_info("Whisper support is not present.")
18
+
11
19
  class CuttedApp:
12
20
  def __init__(self):
13
21
  self.AudioProcessor = audio_processor.AudioProcessor()
22
+ if whisper_support:
23
+ self.whisper = None
14
24
  self.gemini = gemini.GeminiClient()
15
25
  self.canvas = None
16
26
  self.cursor_line = None
@@ -44,12 +54,21 @@ class CuttedApp:
44
54
 
45
55
  undo_button = customtkinter.CTkButton(self.root, text="Undo", command=self.undo_last, width=70)
46
56
  undo_button.place(relx=0.1, rely=1.0, anchor="s", y=-30)
57
+
58
+ if whisper_support:
59
+ self.use_transcript_checkbox = customtkinter.CTkCheckBox(
60
+ self.root,
61
+ text="Give Gemini a transcript (very slow)",
62
+ text_color="#888888",
63
+ font=("Arial", 12)
64
+ )
65
+ self.use_transcript_checkbox.place(relx=0.0, rely=1.0, anchor="w", y=-12)
47
66
 
48
67
  self.play_button = customtkinter.CTkButton(self.root, text="Play", command=self.play_audio, width=50)
49
68
  self.play_button.place(relx=0.3, rely=1.0, anchor="s", y=-30)
50
69
  self.stop_button = customtkinter.CTkButton(self.root, text="Stop", command=self.stop_audio, width=50)
51
70
  self.stop_button.place(relx=0.7, rely=1.0, anchor="s", y=-30)
52
-
71
+
53
72
  self.input_frame = customtkinter.CTkFrame(self.root, fg_color="transparent", height=36)
54
73
  self.input_frame.place(relx=0.5, rely=1.0, anchor="s", y=-90, relwidth=0.8)
55
74
 
@@ -165,6 +184,13 @@ class CuttedApp:
165
184
 
166
185
  text = self.entry.get()
167
186
  full_prompt = f"You are a audio editing AI. You are controllable via natural language and editing a audio file. The audio file is {round(self.AudioProcessor.get_lenght())}s long."
187
+ if whisper_support:
188
+ if self.use_transcript_checkbox.get():
189
+ if not self.whisper:
190
+ messagebox.showinfo("Info", "Loading Whisper model. This may take a few minutes depending on your internet connection. See the progress in your command line. If this window appears to be frozen, the transcription is running.")
191
+ self.whisper = transcribe.Whisper()
192
+ transcript = self.whisper.transcribe(self.AudioProcessor.audio_path)
193
+ full_prompt += f"\nThis is a transcript with per word timestamps of the audio:\n{transcript}"
168
194
  full_prompt += f"\n\nUser Prompt: {text}"
169
195
  self.entry.delete(0, "end")
170
196
 
@@ -205,4 +231,4 @@ class CuttedApp:
205
231
 
206
232
  def main():
207
233
  app = CuttedApp()
208
- app.run()
234
+ app.run()
cutted/core/transcribe.py CHANGED
@@ -2,7 +2,7 @@ import json
2
2
  import whisper_timestamped as whisper
3
3
 
4
4
  class Whisper:
5
- def __init__(self, model_size: str = "small", device: str = "cpu"):
5
+ def __init__(self, model_size: str = "small", device = None):
6
6
  self.model = whisper.load_model(
7
7
  model_size, device=device
8
8
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cutted
3
- Version: 0.2.1
3
+ Version: 0.3.1
4
4
  Summary: AI-powered audio editor controllable via natural language.
5
5
  Author-email: simon0302010 <simon0302010@gmail.com>
6
6
  License-Expression: GPL-3.0
@@ -15,6 +15,8 @@ Requires-Dist: pydub
15
15
  Requires-Dist: pygame
16
16
  Requires-Dist: google-genai
17
17
  Requires-Dist: python-dotenv
18
+ Provides-Extra: whisper
19
+ Requires-Dist: whisper-timestamped; extra == "whisper"
18
20
  Dynamic: license-file
19
21
 
20
22
  # Cutted
@@ -0,0 +1,12 @@
1
+ cutted/__init__.py,sha256=Q7ZgbkmUOc-Gzy42zzZcKnzKxdZ023pITyXAC0BDBlM,49
2
+ cutted/__main__.py,sha256=lYGLgtIZ_vGZIJmWG6ZQoqOdyOJnaWEA4NBn5Rc7Q8E,61
3
+ cutted/app.py,sha256=xf5LFHdPLz1WNP05eRruHX2hKnaei8CUrqzVSODweAM,8952
4
+ cutted/core/audio_processor.py,sha256=7-XCuPPTlozeuaD2LqyzwRGinu0NvowTLbAh2X4XJ98,5182
5
+ cutted/core/gemini.py,sha256=Ts_EbC1-rO9jIsdSlzKcmjLVS1o663GmfTdzmix12kE,2872
6
+ cutted/core/logger.py,sha256=AjqrgW2LV9HdPkPQ8oOmyd9lWzVSIg46r74ILR7mVHo,585
7
+ cutted/core/transcribe.py,sha256=0e7aCva4y6D-gKe1xw5HT9VoFgbvHGgV6utn12r8wXA,986
8
+ cutted-0.3.1.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
9
+ cutted-0.3.1.dist-info/METADATA,sha256=6plv-IaqUXQeeAnChYaMBjYSLh8FBTAtvyQqZkRTuuA,1201
10
+ cutted-0.3.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
+ cutted-0.3.1.dist-info/top_level.txt,sha256=PL6glZvzRyKWCDn5aoYI9uH8HlEA5Qd_XFJowJKARYI,7
12
+ cutted-0.3.1.dist-info/RECORD,,
@@ -1,12 +0,0 @@
1
- cutted/__init__.py,sha256=CP0x3JIScNbFVSOoF3eIQTKD5gDRfWXcCFE46rlZCio,49
2
- cutted/__main__.py,sha256=lYGLgtIZ_vGZIJmWG6ZQoqOdyOJnaWEA4NBn5Rc7Q8E,61
3
- cutted/app.py,sha256=vJZ_HZtUffUw36tJFBJCAhBbdluQgaOWIPqM5dNZXgU,7706
4
- cutted/core/audio_processor.py,sha256=7-XCuPPTlozeuaD2LqyzwRGinu0NvowTLbAh2X4XJ98,5182
5
- cutted/core/gemini.py,sha256=Ts_EbC1-rO9jIsdSlzKcmjLVS1o663GmfTdzmix12kE,2872
6
- cutted/core/logger.py,sha256=AjqrgW2LV9HdPkPQ8oOmyd9lWzVSIg46r74ILR7mVHo,585
7
- cutted/core/transcribe.py,sha256=cm6ziM3_grXKpUCFHiAU7-6lFK_SVsf7-6n14vMYQng,992
8
- cutted-0.2.1.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
9
- cutted-0.2.1.dist-info/METADATA,sha256=KKJ3auz3E5piy_1uEa9fWlkgZ72RmpHFMohbrqUmUbk,1122
10
- cutted-0.2.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
- cutted-0.2.1.dist-info/top_level.txt,sha256=PL6glZvzRyKWCDn5aoYI9uH8HlEA5Qd_XFJowJKARYI,7
12
- cutted-0.2.1.dist-info/RECORD,,
File without changes