找回密码
 加入
搜索
查看: 10008|回复: 28

[AU3基础] 关于MP3合并、剪切的交流与讨论(已解决,谢谢各位兄弟)

 火.. [复制链接]
发表于 2012-3-4 10:14:24 | 显示全部楼层 |阅读模式
本帖最后由 lxsh010 于 2012-3-6 01:25 编辑

咱们ACN技术非常强大,系统类,设置类,资源非常多,非常方便借鉴学习。在此,深表谢意。

但我认为AU3,还应发扬光大,如写一些实用的、绿色的、智能简单的软件。经常在网上搜到许多小软件,非常小,非常实用,但不是AU3写的。

如许多人(特别是像我这样的教育工作者)经常用的MP3剪切、合并软件,我就没发现,有一款是用AU3写的,其实用AU3实现,应该是一件很容易的事。但我是菜鸟……

就像这款,简单实用,但有广告,呜……


至于MP3剪切,百度应用就有,
http://app.baidu.com/widget?appid=116512


谁来写一个,MP3合并软件,我们菜鸟感激不尽,并努力加分。谢谢!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×

评分

参与人数 1金钱 +20 收起 理由
afan + 20 感谢主动将修改帖子分类为[已解决],请继续 ...

查看全部评分

发表于 2012-3-4 10:56:19 | 显示全部楼层
本帖最后由 Ycxw2008 于 2012-3-4 11:43 编辑

楼主是想这样吗?合并一些自己喜欢的音乐的音轨?
建议楼主尝试foobar2000,很简单很简单,右键>选择转换>然后选择你自己需要的选项


我是这样转成功的,楼主你可以参考下,但不一定肯定是正确的




表达能力不好,就做个gif给楼主参考,
重要的就是自动生成*cue,
我看的一些网站都是这样说的,有损无损都好,
就是在转换格式的时候需要选择wav(其他我也没测试)
如果想变小,之后再转回mp3然后把cue文件里的wav改成mp3就行
下面是GIF,方法不一定是正确的,仅供参考 :)

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×

评分

参与人数 1金钱 +20 收起 理由
lxsh010 + 20 谢谢!!!

查看全部评分

 楼主| 发表于 2012-3-4 11:00:01 | 显示全部楼层
回复 2# Ycxw2008

谢谢你的回复。我知道很多软件可以实现,但我想,如果咱们AU3也能实现,多好呀。就是,把几首歌合并为一首歌。
发表于 2012-3-4 11:31:47 | 显示全部楼层
楼主是想让咱们用Au3写个类似的软件???
发表于 2012-3-4 11:46:44 | 显示全部楼层
本帖最后由 Ycxw2008 于 2012-3-4 11:51 编辑

回复 3# lxsh010


                                        Foobar2000之所以受欢迎,

                                        好像是因为开源的原因,

                                        具体的我也没研究,                                       

                                         楼主可以自己去参考下源码之类的,

                                        编程编程,

                                         我享受的是

                                        编程的过程,

                                        而不是

                                        结果

                                        楼主你认为呢?

评分

参与人数 1金钱 +30 收起 理由
lxsh010 + 30 感谢一如既往的指导,帮助 。

查看全部评分

 楼主| 发表于 2012-3-4 12:29:41 | 显示全部楼层
回复 5# Ycxw2008

是呀,编程享受的是其过程。只是我在百度中,知道了一些皮毛,却不知道对否,也不知道如何用编程实现。
如:

1.DOS法

Copy是DOS中一个很重要的命令,巧妙利用其参数/b就可以实现将几个文件合并的功能。比如要把D盘根目录下的A.mp3和B.mp3合并为C.mp3并保存到E盘,可以这样操作:进入MS-DOS方式,键入:

C:\〉copy /b d:\a.mp3+d:\b.mp3 e:\c.mp3

然后回车就可以了,合并速度飞快!利用Copy /b的这个特点,还可以把.wma、.mpeg、.avi、.dat等多种音视频文件连接起来,既简单又方便。
 楼主| 发表于 2012-3-4 12:30:57 | 显示全部楼层
回复 4# Chinacat

呵呵,是呀。老大,能提供点思路吗?
发表于 2012-3-4 14:49:39 | 显示全部楼层
发表于 2012-3-4 18:55:52 | 显示全部楼层
好东西
 楼主| 发表于 2012-3-4 23:04:01 | 显示全部楼层
回复 8# Ycxw2008

哇,资源很丰富。可还是一知半解。
发表于 2012-3-4 23:06:23 | 显示全部楼层
谢谢分享
发表于 2012-3-4 23:43:07 | 显示全部楼层
回复 8# Ycxw2008
官方论坛的例子

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=..\icons\SafetyHelmet.ico
#AutoIt3Wrapper_outfile=test\Volly's MP3 Resizer.exe
#AutoIt3Wrapper_UseUpx=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GUIConstants.au3>
#include <Process.au3>
#include <EditConstants.au3>
FileInstall ("lame.exe", "lame.exe", 1)
FileInstall ("lame_enc.dll","lame_enc.dll", 1)
DIM $f
DIM $j = 0
DIM $e
DIM $r = @ScriptDir
DIM $ini = @ScriptDir&"/bin/settings.ini"
if FileExists($r&"/lame.exe") = 0 then
MsgBox(16, "Error!", "LAME.exe not found in default directory. CLick OK to exit")
Exit
endif

If DirGetSize($R & "/Bin") = -1 then DirCreate($R & "/Bin")
$ini1= iniread($ini, "1", "1", "")
$ini2= iniread($ini, "1", "2", "")
$ini3= iniread($ini, "1", "3", "")
$ini4= iniread($ini, "1", "4", "")
$ini5= iniread($ini, "1", "5", "")
$ini6= iniread($ini, "1", "6", "")
$Form1_1 = GUICreate("LAME mp3 File resizer", 626, 318, 193, 115)
$Label1 = GUICtrlCreateLabel("Source file", 16, 16, 54, 17)
$Input1 = GUICtrlCreateInput("", 80, 16, 457, 21, 0x0880)
$Button1 = GUICtrlCreateButton("Select", 568, 16, 41, 25, 0)
$Label2 = GUICtrlCreateLabel("Destination", 16, 56, 57, 17)
$Input2 = GUICtrlCreateInput("", 80, 56, 457, 21, 0x0880)
$Button3 = GUICtrlCreateButton("Process", 16, 256, 105, 33, 0)
$Input3 = GUICtrlCreateInput("", 80, 96, 177, 21) ;title
$Label3 = GUICtrlCreateLabel("Title", 16, 96, 24, 17)
$Label4 = GUICtrlCreateLabel("Artist", 16, 136, 27, 17)
$Label5 = GUICtrlCreateLabel("Album", 16, 176, 33, 17)
$Input4 = GUICtrlCreateInput("", 80, 136, 177, 21) ;artist
$Input5 = GUICtrlCreateInput("", 80, 176, 177, 21) ;album
$Label6 = GUICtrlCreateLabel("Track", 16, 224, 32, 17)
$Input6 = GUICtrlCreateInput("", 80, 216, 41, 21) ;track
$Label7 = GUICtrlCreateLabel("Comment", 336, 96, 48, 17)
$Edit1 = GUICtrlCreateEdit("", 408, 96, 201, 145, $ES_MULTILINE);comment
$Checkbox1 = GUICtrlCreateCheckbox("Exit on Process", 136, 256, 105, 25)
$Radio1 = GUICtrlCreateRadio("16Kbps", 281, 264, 63, 25)
$Radio2 = GUICtrlCreateRadio("32 Kbps", 352, 264, 65, 25)
$Radio3 = GUICtrlCreateRadio("48 Kbps", 432, 264, 65, 25)
$Radio4 = GUICtrlCreateRadio("64 Kbps", 504, 268, 73, 17)
$Group1 = GUICtrlCreateGroup("", 272, 248, 321, 57)
$Label8 = GUICtrlCreateLabel("Genre", 168, 224, 33, 17)
$Combo1 = GUICtrlCreateCombo("", 232, 216, 153, 25)
GUICtrlSetData($Input3, $ini1)
GUICtrlSetData($Input4, $ini2)
GUICtrlSetData($Input5, $ini3)
GUICtrlSetData($Input6, $ini4)
GUICtrlSetData($Combo1, "Alternative|Audio Book|Rock", $ini5)
if $ini6= "1" then GUICtrlSetState($Radio1, $GUI_CHECKED)
if $ini6= "2" then GUICtrlSetState($Radio2, $GUI_CHECKED)
if $ini6= "3" then GUICtrlSetState($Radio3, $GUI_CHECKED)
if $ini6= "4" then GUICtrlSetState($Radio4, $GUI_CHECKED)
GUISetState(@SW_SHOW)

While 1
$nMsg = GUIGetMsg()
Select
Case $nMsg = $GUI_EVENT_CLOSE
Exit
Case $nMsg = $Button1
$ddd = IniRead($ini, "1", "8",@ScriptDir)
$f = FileOpenDialog("Select file",$ddd , "Mp3 files (*.mp3)", 3)
GUICtrlSetData($Input1, $f)
$S = StringInStr($f, "\", 0, -1)
$l = StringLen($f)
$R = StringTrimRight($f, ($l - $s))
$l2 = StringLen($R)
$E = StringTrimLeft($f, $l2)
$j = $R & "Converted\"&$E
GUICtrlSetData($Input2, $j)
Case $nMsg = $Button3

IniWrite($ini, "1", "1", GUICtrlRead($Input3));title
IniWrite($ini, "1", "2", GUICtrlRead($Input4));Artist
IniWrite($ini, "1", "3", GUICtrlRead($Input5));Album
IniWrite($ini, "1", "4", GUICtrlRead($Input6));track
IniWrite($ini, "1", "5", GUICtrlRead($Combo1));Genre
IniWrite($ini, "1", "7", GUICtrlRead($edit1)) ;comment
$source = GUICtrlRead($Input1)
$C1 = StringRight($f, 4)
$dest = GUICtrlRead($Input2)
$C2 = StringRight($dest, 4)
if $c1 <> ".mp3" then
MsgBox(0, "Error", "You need to select a file to convert")
ElseIf $c2 <> ".mp3" then
MsgBox(0, "Error", "You need to select a file to save the conversion to.")
else
$kk = GUICtrlRead($Input1)
$S1 = StringInStr($kk, "\", 0, -1)
$l1 = StringLen($kk)
$R1 = StringTrimRight($kk, ($l1 - ($s1-1)))
IniWrite($ini, "1", "8",$R1)
If DirGetSize($R1 & "/Converted") = -1 then DirCreate($R1 & "/Converted")
GUICtrlRead($Input3)
$t = GUICtrlRead($Input3) ;title
$lenT = StringLen($t)
if $lenT >= 1 then
$TT= ' --tt '
$title =$TT&'"'&$t&'"'
Else
$title = ''
EndIf
$Z = GUICtrlRead($Input4);artist
$lenT2 = StringLen($Z)
if $lenT2 >= 1 then
$ta1 = ' --ta '
$artist = $ta1&'"'&$z&'"'
Else
$artist = ''
EndIf
$P = GUICtrlRead($Input5);album
$lenT3 = StringLen($P)
if $lenT3 >= 1 then
$aa =' --tl '
$album = $aa&'"'&$P&'"'
Else
$album = ''
EndIf
$TN = GUICtrlRead($Input6);track
$lenT4 = StringLen($TN)
if $lenT4 >= 1 then
$ttt = ' --tn '
$Track = $ttt&'"'&$TN&'"'
Else
$Track = ''
EndIf
$CC = GUICtrlRead($Edit1);comment
$lenT5 = StringLen($CC)
if $lenT5 >= 1 then
$O = ' --tc '
$comment = $O&'"'&$CC&'"'
Else
$comment = ''
EndIf
$TG = GUICtrlRead($Combo1);genre
$lenT6 = StringLen($TG)
if $lenT6 >= 1 then
$gg = ' --tc '
$genre = $gg&'"'&$TG&'"'
Else
$genre = ''
EndIf
$BR = '32'
$kbps1 = GUICtrlRead($Radio1)
$kbps2 = GUICtrlRead($Radio2)
$kbps3 = GUICtrlRead($Radio3)
$kbps4 = GUICtrlRead($Radio4)
if $kbps1 = $GUI_CHECKED then
$BR = '16'
IniWrite($ini, "1", "6", "1");Genre
endif
if $kbps2 = $GUI_CHECKED then
$BR = '32'
IniWrite($ini, "1", "6", "2");Genre
endif
if $kbps3 = $GUI_CHECKED then
$BR = '48'
IniWrite($ini, "1", "6", "3");Genre
endif
if $kbps4 = $GUI_CHECKED then
$BR = '64'
IniWrite($ini, "1", "6", "4");Genre
endif
runwait(@ScriptDir&'\lame --verbose -b '&$BR&''&$title&''&$artist&''&$album&''&$track&''&$genre&''&$comment&' "'&$source&'" "'&$dest&'"')
$check = GUICtrlRead($Checkbox1)
If $check = 1 then exit
endif
EndSelect
WEnd

Edited by Volly, 12 May 2009 - 01:28 PM. 

评分

参与人数 1贡献 +5 收起 理由
lxsh010 + 5 谢谢虫子樱桃。很好的代码。

查看全部评分

 楼主| 发表于 2012-3-4 23:56:37 | 显示全部楼层
回复 12# 虫子樱桃


虫子樱桃。这个代码不错。但我想,不必如此复杂。只要能实现几个文件,合在一起就可以了。
copy /b d:\a.mp3+d:\b.mp3 e:\c.mp3  那个listView还未试过,不会写。准备直接用GUICtrlCreateInput,直接拖进MP3文件,然后再读取,合并。

再次表达谢意,看过你写的教程,非常好。谢谢
发表于 2012-3-5 00:42:44 | 显示全部楼层
本帖最后由 虫子樱桃 于 2012-3-5 00:45 编辑

回复 13# lxsh010
这样应该可以,编译成EXE,然后将你要合并的mp3放在一个文件夹里面,将文件夹拖动到程序上面即可

#NoTrayIcon
If $cmdline[0] <> 0 Then
                RunWait(@ComSpec&' /c copy /b *.mp3 Joined.mp3',$cmdline[1],@SW_HIDE)
MsgBox(0,'','Mp3合并完毕,文件是'&$cmdline[1]&'\Joined.mp3')
Else
        MsgBox(0,'嘻嘻','请将要合并的Mp3放在一个文件夹,然后将文件夹拖动到本程序上')
EndIf

评分

参与人数 1金钱 +20 贡献 +5 收起 理由
lxsh010 + 20 + 5 谢谢您的分享!!

查看全部评分

发表于 2012-3-5 00:59:50 | 显示全部楼层
楼主问问题的方式怎么感觉和一个帖子很像
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-6-9 20:01 , Processed in 0.100633 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表