找回密码
 加入
搜索
楼主: lxsh010

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

 火.. [复制链接]
 楼主| 发表于 2012-3-5 11:02:31 | 显示全部楼层
回复 15# 502762378

呵呵,是哪个帖子呢?请指教。看来我提问的方式不好,有待于改进。谢谢提醒。
发表于 2012-3-5 11:12:33 | 显示全部楼层
回复 16# lxsh010


    没有,非常好,只是我淡腾多言,是BOB的一个推广语言建议的一个帖子
 楼主| 发表于 2012-3-5 12:51:01 | 显示全部楼层
回复 14# 虫子樱桃

虫子大大,谢谢您。我想弄个更好操作一点,就是可以把MP3文件,拖到GUICtrlCreateInput里,然后读取 ,共有四个首限制。运行开始合并,则运行 那个 DOS命令,进行合并。。可我尝试了一下,就是不行,不知
_RunDOS("copy /b"&$MPin_Dropped01&"+ "&$MPin_Dropped02&"' '"&$Mpinlujing&"/合并.MP3"""  )
不知上面这句代码哪儿错了。
;~ #include <WindowsConstants.au3>
;~ #include <file.au3>
;~ #include <array.au3>
;~ #include <ButtonConstants.au3>
;~ #include <EditConstants.au3>
;~ #include <TabConstants.au3>

 #include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <Process.au3>

Opt("GUIOnEventMode", 1) ;Gui事件响应模式
Opt("GUIEventOptions", 1) ;修改特殊的 Gui 函数的返回值类型 1=立即通知
;~ Global $IEHCDesp="D:\MP3合并文"
 $MPinForm = GUICreate("MP3文件合并工具", 430, 460, -1, -1,-1, 0x00000018);

GUICtrlCreateGroup("选择歌曲", 10, 10, 410, 190)
GUICtrlCreateLabel("第1首:",20, 40, 50, 22, 0, "")
Global $MPinInput1 = GUICtrlCreateInput("", 60, 35, 280, 22) ;拖进文件的框框
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
GUICtrlSetTip(-1, "先清空,再拖拽到我这边来")

Global $MPinButton1 = GUICtrlCreateButton("浏览(&V)", 350, 33, 60, 25)

GUICtrlCreateLabel("第2首:",20, 80, 50, 22, 0, "")
Global $MPinInput2 = GUICtrlCreateInput("", 60, 75, 280, 22) ;拖进文件的框框
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
GUICtrlSetTip(-1, "先清空,再拖拽到我这边来")

Global $MPinButton2 = GUICtrlCreateButton("浏览(&V)", 350, 73, 60, 25)

GUICtrlCreateLabel("第3首:",20, 120, 50, 22, 0, "")
Global $MPinInput3 = GUICtrlCreateInput("", 60, 115, 280, 22) ;拖进文件的框框
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
GUICtrlSetTip(-1, "先清空,再拖拽到我这边来")

GUICtrlCreateLabel("第4首:",20, 160, 50, 22, 0, "")
Global $MPinInput4 = GUICtrlCreateInput("", 60, 155, 280, 22) ;拖进文件的框框
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
GUICtrlSetTip(-1, "先清空,再拖拽到我这边来")


Global $MPinButton5 = GUICtrlCreateButton("开始合并(&V)", 150, 260, 80, 25)
GUICtrlSetOnEvent(-1,"_Mpinbutton5")

Global $MPinInput5 = GUICtrlCreateInput(@DesktopDir, 80, 225, 230, 20) ;IE缓存保存到目录路径 
 $IEHCButton3 = GUICtrlCreateButton("保存到", 20, 223, 55, 25)
;~ GUICtrlSetOnEvent(-1, "_IEHCKeep")
$IEHCButton4 = GUICtrlCreateButton("打开(&O)", 315, 223, 55, 25)
;~ GUICtrlSetOnEvent(-1, "_IEHCopenFile")

GUISetOnEvent($GUI_EVENT_CLOSE, "_mp3inexit")
GUISetOnEvent($GUI_EVENT_DROPPED, "_MpinDropped")
GUISetState(@SW_SHOW)
;~ GUISetState(@SW_SHOW,$MPinForm)

While 1
        Sleep(500)
WEnd

Func _mp3inexit()
Exit
EndFunc

Func _MpinDropped()
EndFunc

Func _Mpinbutton5()
        $MPin_Dropped01 = GUICtrlRead($MPinInput1) ;读取第一首MP3
        $MPin_Dropped02 = GUICtrlRead($MPinInput2);读取第二首MP3
        $MPin_Dropped03 = GUICtrlRead($MPinInput3)
        $MPin_Dropped04 = GUICtrlRead($MPinInput4)
        
         $Mpinlujing = GUICtrlRead($MPinInput5)        ;这是读取路径
        
        _RunDOS("copy /b"&$MPin_Dropped01&"+ "&$MPin_Dropped02&"' '"&$Mpinlujing&"/合并.MP3"""  )
        
        ;~    MsgBox(64, '温馨提示', $MPin_Dropped01, 3, $MPinForm)
        
;~         RunWait(@ComSpec&' /c copy /b *.mp3 Joined.mp3',$cmdline[1],@SW_HIDE)
;~          _RunDOS(copy /b d:\a.mp3+d:\b.mp3 e:\c.mp3  )
EndFunc        
发表于 2012-3-5 13:01:15 | 显示全部楼层
回复 13# lxsh010


    按照你那样说的 如何控制播放? 合并的意义就是为了缩小?或者变成一个文件?
    还有音质的问题就更别提了
 楼主| 发表于 2012-3-5 13:02:55 | 显示全部楼层
回复 19# Ycxw2008

就是合并成一个文件。没有其他功能。音质也不作考虑。
发表于 2012-3-5 13:05:31 | 显示全部楼层
本帖最后由 Ycxw2008 于 2012-3-5 15:05 编辑
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <Process.au3>
Opt("GUIEventOptions", 1)
Opt("GUIOnEventMode", 1)
Global $MPinInput[5], $MPinButton[5]
$MPinForm = GUICreate("MP3文件合并工具", 430, 460, -1, -1, -1, 0x00000010);
GUISetOnEvent(-3, "_mp3inexit")

GUICtrlCreateGroup("选择歌曲", 10, 10, 410, 190)
$y = 0
For $i = 1 To 4
        $y += 40
        GUICtrlCreateLabel('第' & $i & '首', 20, $y, 50, 22, 0)
        $MPinInput[$i - 1] = GUICtrlCreateInput('', 60, $y - 5, 280, 22)
        GUICtrlSetState(-1, $GUI_DROPACCEPTED)
        $MPinButton[$i - 1] = GUICtrlCreateButton("浏览(&V)", 350, $y - 7, 60, 25)
        GUICtrlSetOnEvent(-1, "_Mpinbutton5")
Next

$MPinInput[4] = GUICtrlCreateInput(@DesktopDir, 80, 225, 230, 20)
$MPinButton[4] = GUICtrlCreateButton("开始合并(&V)", 150, 260, 80, 25)
GUICtrlSetOnEvent(-1, "_Mpinbutton5")


GUISetState()
While 1
        Sleep(500)
WEnd

Func _mp3inexit()
        Exit
EndFunc   ;==>_mp3inexit

Func _Mpinbutton5()
        Local $NUM = -1
        For $x = 0 To UBound($MPinButton) - 2
                If @GUI_CtrlId = $MPinButton[$x] Then $NUM = $x
        Next
        
        Switch $NUM
                Case 0 To 3
                        GUICtrlSetData($MPinInput[$NUM], FileSaveDialog("", "", "mp3 (*.mp3)"))
        EndSwitch
        If @GUI_CtrlId = $MPinButton[4] Then
                Local $text = ""
                For $x = 0 To UBound($MPinInput) - 2
                        If GUICtrlRead($MPinInput[$x]) <> "" Then
                                $text &= '"' & GUICtrlRead($MPinInput[$x]) & '"+'
                        EndIf
                Next
                If $text <> "" Then
                        $text = 'copy /b ' & StringTrimRight($text, 1) & ' "' & GUICtrlRead($MPinInput[4]) & '\合并.mp3"'
                        RunWait('"' & @ComSpec & '" /c ' & $text, '', @SW_HIDE)
                        MsgBox(0, '', '合并成功')
                        ShellExecute(@DesktopDir)
                EndIf
        EndIf
        
EndFunc   ;==>_Mpinbutton5

评分

参与人数 1金钱 +30 贡献 +5 收起 理由
lxsh010 + 30 + 5 老大,你太厉害了。特别是那个For,用得出神 ...

查看全部评分

 楼主| 发表于 2012-3-6 01:24:03 | 显示全部楼层
回复 21# Ycxw2008

谢谢兄弟的帮忙。不胜感激。
发表于 2012-3-6 01:41:26 | 显示全部楼层
回复 22# lxsh010


    呵呵  也只是帮个小忙而已,其实用listview或list都比inputbox方便
发表于 2012-3-10 13:47:36 | 显示全部楼层
回复 21# Ycxw2008


   呵呵,我合并好后听了一下,后面的歌曲变调的
发表于 2012-3-10 21:40:42 | 显示全部楼层
回复 24# zldfsz


    哪种方法合并?
发表于 2012-3-10 21:53:49 | 显示全部楼层
回复 25# Ycxw2008


    21楼的,我将两首歌曲合并后前一首没听出变化,可第二首变调了,节奏变慢了
发表于 2012-3-10 22:05:08 | 显示全部楼层
回复 26# zldfsz


    你细看我的回复就知道了,我不建议楼主这样合并的,你看我前面的gif就知道了
    我都是那样合并的
发表于 2012-3-10 22:11:32 | 显示全部楼层
呵呵,只是测测代码,那软件看起来不错哦
 楼主| 发表于 2012-3-12 19:03:19 | 显示全部楼层
回复 27# Ycxw2008

谢谢提醒,两种方法都记下来。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-6-13 12:32 , Processed in 0.077143 second(s), 16 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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