『漫游』酷论坛>『字幕制作交流区』>[求助]卡拉OK的字幕怎 ..

MeteorRain@2004-07-27 21:47

写出来没用……要你们都能用才行
引用

wangh@2004-07-27 22:00

这种好用吗?
我用VB来写个吧
引用

MeteorRain@2004-07-27 22:04

既然有vb的了,那我用php来试试看……
引用

wangh@2004-07-27 22:43

可以了,舍入时间费了好大劲……
稍后放出

Dialogue: 0,0:00:33.22,0:00:37.10,Default,,0,0,0,,{\K153}....{\K26}季{\K28}節{\K28}は{\K29}ず{\K24}れ{\K34}の{\K33}beach {\K33}side
Dialogue: 0,0:00:37.46,0:00:40.60,Default,,0,0,0,,{\K26}夜{\K25}に{\K23}隱{\K41}れ{\K198}た...
Dialogue: 0,0:00:43.59,0:00:46.07,Default,,0,0,0,,{\K33}君{\K46}の{\K70}橫{\K63}顏{\K36}は
Dialogue: 0,0:00:46.53,0:00:50.10,Default,,0,0,0,,{\K41}何{\K53}を{\K23}み{\K32}つ{\K43}め{\K30}て{\K35}る{\K48}の{\K51}?
Dialogue: 0,0:00:52.20,0:00:54.83,Default,,0,0,0,,{\K75}僕{\K31}ら{\K30}は{\K43}何{\K60}一{\K24}つ
Dialogue: 0,0:00:55.41,0:00:57.07,Default,,0,0,0,,{\K23}知{\K25}る{\K27}こ{\K28}との{\K33}な{\K30}い
Dialogue: 0,0:00:57.07,0:00:58.96,Default,,0,0,0,,{\K19}未{\K32}來{\K31}の{\K70}為{\K37}に
Dialogue: 0,0:00:59.97,0:01:01.47,Default,,0,0,0,,{\K72}手に{\K78}入れたり
Dialogue: 0,0:01:01.53,0:01:03.64,Default,,0,0,0,,{\K135}投げ出した{\K76}りして
Dialogue: 0,0:01:04.25,0:01:08.47,Default,,0,0,0,,{\K71}儚{\K38}く{\K54}誘{\K33}う{\K42}行{\K59}方{\K30}め{\K33}ざ{\K24}し{\K37}て
Dialogue: 0,0:01:08.73,0:01:09.78,Default,,0,0,0,,{\K46}Flying {\K59}Gone
Dialogue: 0,0:01:10.91,0:01:12.61,Default,,0,0,0,,{\K19}夢{\K23}見{\K55}る{\K38}樣{\K34}に
Dialogue: 0,0:01:13.16,0:01:15.08,Default,,0,0,0,,{\K23}墮{\K29}ち{\K45}て{\K26}ゆ{\K34}く{\K34}の
Dialogue: 0,0:01:15.36,0:01:17.25,Default,,0,0,0,,{\K41}君{\K54}の{\K50}中{\K43}へ
Dialogue: 0,0:01:17.65,0:01:19.59,Default,,0,0,0,,{\K34}恐{\K32}れ{\K54}な{\K44}い{\K30}で
Dialogue: 0,0:01:19.99,0:01:21.70,Default,,0,0,0,,{\K40}傷{\K49}つ{\K27}い{\K27}た{\K27}ら
Dialogue: 0,0:01:21.94,0:01:22.70,Default,,0,0,0,,{\K20}き{\K31}っ{\K25}と
Dialogue: 0,0:01:22.88,0:01:26.08,Default,,0,0,0,,{\K23}切{\K16}な{\K18}い{\K51}優{\K21}し{\K21}さ{\K23}を{\K24}抱{\K21}い{\K23}て{\K42}い{\K37}る
Dialogue: 0,0:01:26.53,0:01:27.97,Default,,0,0,0,,{\K40}Flying {\K49}Fall {\K55}Down
Dialogue: 0,0:01:28.75,0:01:30.69,Default,,0,0,0,,{\K15}羽{\K16}ば{\K18}た{\K61}さ{\K28}な{\K29}が{\K27}ら
Dialogue: 0,0:01:31.02,0:01:32.90,Default,,0,0,0,,{\K34}墮{\K21}ち{\K47}て{\K25}ゆ{\K26}く{\K34}の
Dialogue: 0,0:01:33.15,0:01:35.12,Default,,0,0,0,,{\K40}君{\K60}の{\K60}傍{\K37}へ
Dialogue: 0,0:01:35.39,0:01:36.95,Default,,0,0,0,,{\K43}何{\K47}も{\K26}な{\K40}い
Dialogue: 0,0:01:37.09,0:01:39.49,Default,,0,0,0,,{\K21}明{\K37}日{\K28}が{\K23}く{\K45}る{\K24}瞬{\K28}間{\K34}は
Dialogue: 0,0:01:39.83,0:01:41.38,Default,,0,0,0,,{\K33}君{\K33}に{\K21}出{\K29}會{\K21}え{\K17}た
Dialogue: 0,0:01:41.62,0:01:43.51,Default,,0,0,0,,{\K20}奇{\K23}跡{\K24}胸{\K29}に{\K21}た{\K43}い{\K29}て
Dialogue: 0,0:01:44.28,0:01:47.57,Default,,0,0,0,,{\K24}ね{\K53}むらせ{\K251}て......
引用

kiasushou@2004-07-28 01:15

vb还是vba...真不简单^.^
引用

icc@2004-07-28 09:20

不错不错,支持一下^^
引用

wangh@2004-07-28 09:54

ftp://agt:wt@218.89.28.48/karaokvb6.exe

ftp://agt:wt@218.89.28.48/karaokvb7.exe

原本是用的vb.net,后来想到很多人都没装.net,所以还是改回了用VB6来做
引用

MeteorRain@2004-07-28 10:09

引用
最初由 wangh 发布
原本是用的vb.net,后来想到很多人都没装.net,所以还是改回了用VB6来做
源代码公开吗?……
引用

wangh@2004-07-28 10:26

引用
最初由 MeteorRain 发布
源代码公开吗?……

OK,直接贴了
__________________________________________

Public Class FormMain
Inherits System.Windows.Forms.Form
Private cDialHead As String = "Dialogue: 0,"
Private cDialText As String = ",Default,,0,0,0,,"
Private OutText(1000) As String

#Region " Windows 窗体设计器生成的代码 "

Public Sub New()
MyBase.New()

'该调用是 Windows 窗体设计器所必需的。
InitializeComponent()

'在 InitializeComponent() 调用之后添加任何初始化

End Sub

'窗体重写 dispose 以清理组件列表。
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

'Windows 窗体设计器所必需的
Private components As System.ComponentModel.IContainer

'注意: 以下过程是 Windows 窗体设计器所必需的
'可以使用 Windows 窗体设计器修改此过程。
'不要使用代码编辑器修改它。
Friend WithEvents TextBoxIn As System.Windows.Forms.TextBox
Friend WithEvents SplitterMain As System.Windows.Forms.Splitter
Friend WithEvents PanelMain As System.Windows.Forms.Panel
Friend WithEvents TextBoxOut As System.Windows.Forms.TextBox
Private Sub InitializeComponent()
Me.TextBoxIn = New System.Windows.Forms.TextBox
Me.SplitterMain = New System.Windows.Forms.Splitter
Me.PanelMain = New System.Windows.Forms.Panel
Me.TextBoxOut = New System.Windows.Forms.TextBox
Me.PanelMain.SuspendLayout()
Me.SuspendLayout()
'
'TextBoxIn
'
Me.TextBoxIn.Dock = System.Windows.Forms.DockStyle.Top
Me.TextBoxIn.Location = New System.Drawing.Point(0, 0)
Me.TextBoxIn.Multiline = True
Me.TextBoxIn.Name = "TextBoxIn"
Me.TextBoxIn.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
Me.TextBoxIn.Size = New System.Drawing.Size(496, 160)
Me.TextBoxIn.TabIndex = 0
Me.TextBoxIn.Text = ""
'
'SplitterMain
'
Me.SplitterMain.Dock = System.Windows.Forms.DockStyle.Top
Me.SplitterMain.Location = New System.Drawing.Point(0, 160)
Me.SplitterMain.MinExtra = 64
Me.SplitterMain.MinSize = 64
Me.SplitterMain.Name = "SplitterMain"
Me.SplitterMain.Size = New System.Drawing.Size(496, 8)
Me.SplitterMain.TabIndex = 2
Me.SplitterMain.TabStop = False
'
'PanelMain
'
Me.PanelMain.Controls.Add(Me.TextBoxOut)
Me.PanelMain.Dock = System.Windows.Forms.DockStyle.Fill
Me.PanelMain.Location = New System.Drawing.Point(0, 168)
Me.PanelMain.Name = "PanelMain"
Me.PanelMain.Size = New System.Drawing.Size(496, 157)
Me.PanelMain.TabIndex = 5
'
'TextBoxOut
'
Me.TextBoxOut.Dock = System.Windows.Forms.DockStyle.Fill
Me.TextBoxOut.Location = New System.Drawing.Point(0, 0)
Me.TextBoxOut.Multiline = True
Me.TextBoxOut.Name = "TextBoxOut"
Me.TextBoxOut.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
Me.TextBoxOut.Size = New System.Drawing.Size(496, 157)
Me.TextBoxOut.TabIndex = 5
Me.TextBoxOut.Text = ""
'
'FormMain
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(496, 325)
Me.Controls.Add(Me.PanelMain)
Me.Controls.Add(Me.SplitterMain)
Me.Controls.Add(Me.TextBoxIn)
Me.MinimumSize = New System.Drawing.Size(320, 320)
Me.Name = "FormMain"
Me.Text = "KaraOK"
Me.PanelMain.ResumeLayout(False)
Me.ResumeLayout(False)

End Sub

#End Region

Private Sub TextBoxIn_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxIn.TextChanged
Array.Clear(OutText, 0, 1000)
AzalText(TextBoxIn.Text)
OutTexts()
End Sub

Private Sub AzalText(ByVal inText As String)
Dim i As Integer
Dim pStr As Integer
Dim tST As Integer
Dim tED As Integer
Dim tStr As String
tST = 1
Do
tST = InStr(tST, inText, "karaoke.add")
If tST Then
pStr = InStr(tST, inText, "'") + 1
tStr = Mid$(inText, pStr, 8)
OutText(i) = cDialHead & "0:" & tStr
pStr = InStr(pStr + 10, inText, "'") + 1
tStr = Mid$(inText, pStr, 8)
OutText(i) = OutText(i) & ",0:" & tStr & cDialText
pStr = InStr(pStr + 10, inText, "'") + 1
tED = InStr(pStr, inText, ")")
If tED = 0 Then
tED = Len(inText)
End If
OutText(i) = OutText(i) & AzalSub(Mid$(inText, pStr, tED - pStr))
i = i + 1
tST = pStr
Else
Exit Do
End If
Loop
End Sub

Private Function AzalSub(ByVal inText As String) As String
Dim SubText() As String
Dim SubTimeText() As String
Dim SubTime() As Integer
Dim tST As Integer
Dim i As Integer
Dim pStr As Integer
Dim Chars As Integer
Dim tStr As String
tST = InStr(1, inText, ", '")
tStr = Mid(inText, tST + 3)
SubTimeText = Split(tStr, ",")
If SubTimeText.Length Then
ReDim SubText(SubTimeText.Length - 1)
ReDim SubTime(SubTimeText.Length - 1)
End If
Do
pStr = pStr + 1
If i > SubTimeText.Length - 1 Then Exit Do
tStr = (Mid(inText, pStr, 1))
If tStr = "[" Then
Chars = 1
GoTo passC
ElseIf tStr = "]" Then
Chars = 0
i = i + 1
GoTo passC
End If
If Chars Then
SubText(i) = SubText(i) & tStr
Else
SubText(i) = tStr
i = i + 1
End If
passC:
Loop While pStr < tST
For i = 0 To SubTime.Length - 1
SubTime(i) = Val(SubTimeText(i))
Next i
For i = 1 To SubTime.Length - 1
SubTime(i) = SubTime(i) + SubTime(i - 1)
Next i
For i = 0 To SubTime.Length - 1
SubTime(i) = SubTime(i) \ 10
Next i
Dim j As Integer
For i = 0 To SubTime.Length - 1
For j = i + 1 To SubTime.Length - 1
SubTime(j) = SubTime(j) - SubTime(i)
Next j
Next i
For i = 0 To SubTime.Length - 1
SubText(i) = "{\K" & (SubTime(i)) & "}" & SubText(i)
AzalSub = AzalSub & SubText(i)
Next i
End Function

Private Sub OutTexts()
Dim i As Integer
Dim tText As String
For i = 0 To 1000
tText = tText & OutText(i) & Chr(13) & Chr(10)
If Len(OutText(i)) = 0 Then Exit For
Next
TextBoxOut.Text = tText
End Sub
End Class

__________________________________________

vb.net和vb6的代码基本一样的,只是自己觉得vb.net用比较方便,做起来更快些
引用

toothlog@2004-07-28 11:23

wangh能寄到我e-mail里吗??????
toothlog@msn.com
toothlog@yahoo.com.cn
toothlog@ktxp.com
引用

wangh@2004-07-28 12:03

引用
最初由 toothlog 发布
wangh能寄到我e-mail里吗??????
toothlog@msn.com
toothlog@yahoo.com.cn
toothlog@ktxp.com


OK,发到了toothlog@msn.com中
引用

monkeyking2002@2004-07-28 13:26

楼上某位8死族人说话语气好象TX某MM。。。。。- -
引用

slsquare@2004-07-28 13:28

karaokvb6.exe
打开怎么就两空窗口....
引用

MeteorRain@2004-07-28 16:06

说一个你的程序的潜在的问题
看你算时间用的都是四舍五入吧
那么假如每个时间长都是295的话,是不是都会变成\K30?也就是慢了0.005秒吧……
那么假如我连续排1000个,最后一个就会慢5秒吧…………
虽然不是明显的错误,但是总是一个小小的缺陷……
引用

ZhenGod@2004-07-28 20:40

引用
最初由 slsquare 发布
karaokvb6.exe
打开怎么就两空窗口....


把那个灰熊的语句复制进去,自动转换........
引用

«1234»共4页

| TOP