零代码编程:用ChatGPT批量提取flash动画swf文件中的mp3

编程入门 行业动态 更新时间:2024-10-21 06:28:58

零代码编程:用ChatGPT<a href=https://www.elefans.com/category/jswz/34/1770428.html style=批量提取flash动画swf文件中的mp3"/>

零代码编程:用ChatGPT批量提取flash动画swf文件中的mp3

文件夹:C:\迅雷下载\有声绘本_flash[淘宝-珍奥下载]\有声绘本 flash,里面有多个flash文件,怎么转换成mp3文件呢?

可以使用swfextract工具从Flash动画中提取音频,下载地址是.html,也可以加入知识星球“AIGC部落”进行下载。

然后将swfextract这个工具的可执行文件的路径已经添加到系统PATH环境变量中:

比如其路径是:D:\Program Files (x86)\SWFTools

然后,在ChatGPT中输入提示词:

你是一个Python编程专家,要完成一个提取flash动画swf文件中的mp3的任务,具体步骤如下:

打开文件夹:C:\迅雷下载\有声绘本_flash[淘宝-珍奥下载]\有声绘本 flash;

读取所有的swf文件;

使用swfextract工具将这些swf文件转换为mp3文件;

注意:每一步都要输出相关信息;

swfextract.exe的地址是:D:\Program Files (x86)\SWFTools

swfextract工具的使用方法:

NAME

swfextract - a tool for extracting data out of swf files.

Synopsis

swfextract [options] [file.swf]

DESCRIPTION

swfextracts allows to extract swf movieclips and objects out of swf files.

SWF files are animation files which can be displayed in Web Browsers using the Flash Plugin.

OPTIONS

−m, −−mp3

Extract main mp3 stream (There may be substreams in the Movieclips, as well. To extract these, first extract the Movieclips with -i and then use -m)

生成源代码如下:

import os

import subprocess

# 文件夹路径

folder_path = "C:\\迅雷下载\\有声绘本_flash[淘宝-珍奥下载]\\有声绘本 flash"

# swfextract 工具的路径

swfextract_path = "D:\\Program Files (x86)\\SWFTools\\swfextract.exe"

# 读取所有的swf文件

swf_files = [f for f in os.listdir(folder_path) if os.path.isfile(os.path.join(folder_path, f)) and f.endswith(".swf")]

# 遍历所有swf文件

for swf_file in swf_files:

print(f"处理文件:{swf_file}")

# 提取swf文件中的音频

mp3_file = swf_file.replace(".swf", ".mp3")

subprocess.run([swfextract_path, "-m", os.path.join(folder_path, swf_file), "-o", os.path.join(folder_path, mp3_file)])

print(f"生成MP3文件:{mp3_file}")

print("所有文件处理完毕。")

运行程序,全部flash动画文件转换成了mp3音频

更多推荐

零代码编程:用ChatGPT批量提取flash动画swf文件中的mp3

本文发布于:2023-11-16 01:33:23,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1611122.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:批量   代码   文件   动画   ChatGPT

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!