|
-
Oct 9th, 2005, 08:23 PM
#1
Thread Starter
Junior Member
How do you use .SeekCurrentPosition
I am using a trackbar to feed the position value into seekcurrentposition. I think that this is in millionths of a second so I multiply the trackbar value by 10000000. When scrolling the trackbar it does seek the music into the correct position however on a lot of files when the trackbar hits around value 215 the program crashes and says
An unhandled exception of type 'System.OverflowException' occurred in Media Player.exe
Additional information: Arithmetic operation resulted in an overflow.
This is my code
tbseek is a trackbar, fileLoader.Item is the audio instance to be manipulated
Private Sub tbSeek_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tbSeek.Scroll
fileLoader.Item(0).SeekCurrentPosition(tbSeek.Value * 10000000, SeekPositionFlags.AbsolutePositioning)
End Sub
-
Oct 9th, 2005, 09:28 PM
#2
Re: How do you use .SeekCurrentPosition
Are you sure you got the time correct? 1 millionth of a second seems to be an awfully small interval... I know in timer ticks, its in milliseconds, so "1000" would be 1 second...
-
Oct 9th, 2005, 09:36 PM
#3
Re: How do you use .SeekCurrentPosition
Hmm.. seems it's actually 10,000,000th of a second interval... read it here..
http://groups.google.com/group/micro...e=UTF-8&rnum=1
-
Oct 10th, 2005, 07:39 AM
#4
Thread Starter
Junior Member
Re: How do you use .SeekCurrentPosition
Yeh I know it needs to be in millionths hence why I multiply the trackbar value by 10million as you can see in my code. However by doing this it seems that the number it generates creates a number bigger then vb can handle as it outputs the error message that I posted above. Do you know how I can prevent it from crashing?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|