С помощью BASS
Add(MainForm,16529224,175,147)
{
Width=455
Height=122
Caption="BASS Position"
Point(Handle)
link(onCreate,4252681:doInit,[])
}
Add(BASS_Init,4252681,252,161)
{
link(onInit,10183901:doCheck,[])
link(onError,11232751:doMessage,[(296,174)(296,216)])
link(Handle,16529224:Handle,[(272,149)(226,149)(226,191)(181,191)])
}
Add(BASS_Version,10183901,308,161)
{
link(onCheckFailed,109118:doMessage,[(352,174)(352,216)])
}
Add(Message,11232751,308,210)
{
Message="Error BASS initialization"
Caption="Error"
Icon=1
}
Add(Message,109118,364,210)
{
Message="Incorrect version of BASS library "
Caption="Error"
Icon=1
}
Add(BASS_StreamCreateFile,2073512,342,343)
{
Name="MainSound"
link(onCreate,10701583:doPlay,[])
link(onEndPlay,13896816:doMessage,[(390,356)(390,293)])
link(onError,12393418:doMessage,[(390,363)(390,391)])
link(FileName,12373576:Text,[])
}
Add(Edit,12373576,342,294)
{
Left=15
Top=15
Width=350
Text=""
}
Add(Button,13708268,245,343)
{
Left=15
Top=45
Caption="Play"
link(onClick,2073512:doCreate,[])
}
Add(Button,13089460,244,294)
{
Left=375
Top=15
Caption="Обзор"
link(onClick,4225408:doExecute,[])
}
Add(ODialog,4225408,293,294)
{
link(onExecute,12373576:doText,[])
}
Add(Message,12393418,405,385)
{
Message="Ошибка!"
Caption="Error"
Icon=1
}
Add(BASS_ChannelPlay,10701583,405,343)
{
Channel="MainSound"
link(onPlay,14122420:doData,[])
}
Add(BASS_ChannelPosition,9802659,454,441)
{
Channel="MainSound"
Mode=2
}
Add(Timer,3915133,405,497)
{
link(onTimer,12272575:doData,[])
}
Add(DoData,12272575,454,497)
{
link(onEventData,884648:doPosition,[(550,503)(550,342)])
link(Data,9802659:CurPosition,[])
}
Add(DoData,14122420,510,343)
{
link(onEventData,884648:doMax,[(554,349)(554,349)])
link(Data,9802659:Length,[(516,331)(492,331)(492,485)(467,485)])
}
Add(Message,13896816,405,287)
{
}
Add(ScrollBarEx,884648,566,336)
{
Left=75
Top=45
Width=280
ScrollMode=1
Point(doMax)
link(onPosition,9802659:doPosition,[(612,342)(612,430)(442,430)(442,447)])
}
C помощью MediaPlayer
Add(MainForm,16529224,175,161)
{
Width=455
Height=122
Caption="BASS Position"
}
Add(Edit,12373576,273,217)
{
Left=15
Top=15
Width=350
Text=""
}
Add(Button,13708268,175,266)
{
Left=15
Top=45
Caption="Play"
link(onClick,8266895:doEvent1,[])
}
Add(Button,13089460,175,217)
{
Left=375
Top=15
Caption="Обзор"
link(onClick,4225408:doExecute,[])
}
Add(ODialog,4225408,224,217)
{
link(onExecute,12373576:doText,[])
}
Add(DoData,14122420,329,273)
{
link(onEventData,884648:doMax,[])
link(Data,13782588:Length,[(335,267)(315,267)(315,310)(286,310)])
}
Add(ScrollBarEx,884648,385,266)
{
Left=75
Top=45
Width=280
ScrollMode=1
Point(doMax)
link(onPosition,13782588:doPosition,[(440,272)(440,365)(213,365)(213,312)(265,312)(265,293)])
}
Add(MediaPlayer,13782588,273,266)
{
link(FileName,12373576:Text,[])
}
Add(Timer,13059487,224,322)
{
Interval=80
link(onTimer,16085623:doData,[])
}
Add(DoData,16085623,273,322)
{
link(onEventData,884648:doPosition,[(372,328)(372,272)])
link(Data,13782588:Position,[])
}
Add(Hub,8266895,238,266)
{
link(onEvent1,13782588:doPlay,[])
link(onEvent2,14122420:doData,[])
}