LEADTOOLS Support
Multimedia
Multimedia SDK Questions
Application hangs after you do a fixed number of getsample .
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Monday, September 10, 2007 3:16:58 AM(UTC)
Groups: Registered
Posts: 3
I am using ltmmConvertCtrl to convert mp3/PCM data to audio in avi.
The application hangs at the getSample call to samplesource object after a fixed number of audio samples are got and delivered
In my comp it hangs at 16 or 17
Find below the part of code in which error occurs
While (True)
Dim frameHeader As MP3FRAMEHEADER
FileGet(fno, frameHeader)
If (Not (frameHeader.byte1 = &HFF And (frameHeader.byte2 And &HF0) = &HF0)) Then
'Assuming only tag is at end of file .fixed bit rate sample rate.
sampleSource.DeliverEndOfStream(1, 1000)
GoTo exitloop
End If
If (Not ((frameHeader.byte3 And &HF0) = &H90)) Then
MsgBox("VBR file")
GoTo exitloop
End If
Dim padding As Integer
padding = 0
If ((frameHeader.byte3 And &H2) = &H2) Then
padding = 1
End If
stoptime = starttime + 1152 * (10000000.0# / 44100.0#)
sample = sampleSource.GetSampleBuffer(1, 1000)
Dim samplesize As Integer = 417 - 4 + padding
sample.ActualDataLength = samplesize
Dim mp3audiodata(samplesize - 1) As Byte
FileGet(fno, mp3audiodata)
sample.SetData(samplesize, mp3audiodata)
sample.SetTime(HighLong(starttime), LowLong(starttime), HighLong(stoptime), LowLong(stoptime))
sampleSource.DeliverSample(1, 1000, sample)
sample = Nothing
starttime = stoptime
End While
Does anyone know why this occurs or how to fix it?
#2
Posted
:
Tuesday, September 11, 2007 12:32:39 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
Did you try the AudioReplace
demo that ships with our toolkit? If not, you can find it in the following
folder:
Examples\ltmm\VB\AudioReplace
If the demo works, but your own project doesn't, try
to begin from a clean copy of the demo and modify it gradually to do what you
want.
LEADTOOLS Support
Multimedia
Multimedia SDK Questions
Application hangs after you do a fixed number of getsample .
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.