Skip to content

Commit

Permalink
Fixed string/int error
Browse files Browse the repository at this point in the history
  • Loading branch information
tmoroney committed Feb 20, 2024
1 parent cd32e81 commit 0254047
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions auto-subs.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
#SOFTWARE.
#
# Support development of this script by buying me a coffee: https://www.buymeacoffee.com/tmoroney
#

import stable_whisper
import time
Expand Down Expand Up @@ -238,7 +241,7 @@ def OnTranscribe(ev):
print("Current project has no timelines")
return

frame_rate = timeline.GetSetting("timelineFrameRate") # get timeline framerate
frame_rate = int(timeline.GetSetting("timelineFrameRate")) # get timeline framerate (sometimes returned as string so must cast to int)

# RENDER AUDIO FOR TRANSCRIPTION
project.LoadRenderPreset('H.265 Master')
Expand Down Expand Up @@ -361,7 +364,7 @@ def OnGenerate(ev):
return

timelineStartFrame = timeline.GetStartFrame()
frame_rate = timeline.GetSetting("timelineFrameRate") # get timeline framerate
frame_rate = int(timeline.GetSetting("timelineFrameRate")) # get timeline framerate

# Create clip object for each line in the SRT file
for i in range(0, len(lines), 4):
Expand Down Expand Up @@ -503,7 +506,7 @@ def OnPopulateSubs(ev):

# Retrieve subtitles from the specified timeline track
itm["Tree"].Clear()
frame_rate = timeline.GetSetting("timelineFrameRate") # get timeline framerate
frame_rate = int(timeline.GetSetting("timelineFrameRate")) # get timeline framerate
for count, clip in enumerate(clipList):
comp = clip.GetFusionCompByIndex(1) # get fusion comp from Text+
if (comp is not None):
Expand Down

0 comments on commit 0254047

Please sign in to comment.