Results 1 to 4 of 4

Thread: How do you use .SeekCurrentPosition

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2005
    Posts
    28

    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

  2. #2
    PowerPoster
    Join Date
    Aug 2005
    Location
    College Station, TX
    Posts
    4,521

    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...

  3. #3
    PowerPoster
    Join Date
    Aug 2005
    Location
    College Station, TX
    Posts
    4,521

    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

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Feb 2005
    Posts
    28

    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
  •  



Click Here to Expand Forum to Full Width