I work at San Francisco's PBS station, where we use many "broadcast wav" files. Fool that I am I volunteered to write a VB program that would rename them, using as part of that name their length. Both work and home use W2K.
I have not found aor been able to write any code that gives me accurate length. dbPowerAmp's scripting abilities is my latest attempt. I put AOL's "You've Got Mail" file on my desktop, and then copied the following from the developer page and put put it also on my desktop:
"
Set Multiplayer = CreateObject("dBpowerAMP.Multiplayer") ' Access Multiplayer Object
Multiplayer.FilePlaying = "gotmail.wav"
le = Multiplayer.Length
msgbox (le)
"
It gave me a length of zero. Then I noticed that when I dropped the gotmail.wav" file into the MUltiplayer with drag and drop directly, it played but there was no length shown.
The same happened when I tried this code for VB's MMControl.ocx:
"
Public Function GetLength(fn As String) As Integer
'microsoft multimedia control (provided with vb )
Dim howlong As Integer
Form1.MMControl1.FileName = fn
Form1.MMControl1.DeviceType = "Waveaudio"
Form1.MMControl1.TimeFormat = mciFormatMilliseconds
Form1.MMControl1.Command = "open"
howlong = Form1.MMControl1.Length
Form1.MMControl1.Command = "close"
End Function
"
Could someone tell me just how I screwing up?
Thanks!
I have not found aor been able to write any code that gives me accurate length. dbPowerAmp's scripting abilities is my latest attempt. I put AOL's "You've Got Mail" file on my desktop, and then copied the following from the developer page and put put it also on my desktop:
"
Set Multiplayer = CreateObject("dBpowerAMP.Multiplayer") ' Access Multiplayer Object
Multiplayer.FilePlaying = "gotmail.wav"
le = Multiplayer.Length
msgbox (le)
"
It gave me a length of zero. Then I noticed that when I dropped the gotmail.wav" file into the MUltiplayer with drag and drop directly, it played but there was no length shown.
The same happened when I tried this code for VB's MMControl.ocx:
"
Public Function GetLength(fn As String) As Integer
'microsoft multimedia control (provided with vb )
Dim howlong As Integer
Form1.MMControl1.FileName = fn
Form1.MMControl1.DeviceType = "Waveaudio"
Form1.MMControl1.TimeFormat = mciFormatMilliseconds
Form1.MMControl1.Command = "open"
howlong = Form1.MMControl1.Length
Form1.MMControl1.Command = "close"
End Function
"
Could someone tell me just how I screwing up?
Thanks!
Comment