GetMusicRow issue

Just starting out? Need help? Post your questions and find answers here.
Azur
User
User
Posts: 63
Joined: Sat Jan 28, 2012 11:13 am

GetMusicRow issue

Post by Azur »

Hello.
Can anyone confirm the getMusicRow function dosent fetch the position correctly ?

Code: Select all

EnableExplicit

InitSound()

Define win=OpenWindow(#PB_Any,0,0,320,240,"",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)

LoadMusic(0,"name.xm")
PlayMusic(0)

Repeat
  If WaitWindowEvent(5)=#PB_Event_CloseWindow
    End
  EndIf
  
  Debug GetMusicRow(0)
  
ForEver
You can find Xm modules here

http://modarchive.org/

thx.
infratec
Always Here
Always Here
Posts: 7583
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: GetMusicRow issue

Post by infratec »

Hi,

row is not position.

Code: Select all

EnableExplicit


Define.i Win, Row, OldRow, Pos, OldPos

InitSound()



Win = OpenWindow(#PB_Any,0,0,320,240,"",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)

If LoadMusic(0,"fall.xm")
  PlayMusic(0)
EndIf 

Repeat
  
  If WindowEvent() = #PB_Event_CloseWindow
    End
  EndIf
  
  If IsMusic(0)
    Row = GetMusicRow(0)
    Pos = GetMusicPosition(0)
    If Row <> OldRow Or Pos <> OldPos
      Debug Str(Pos) + " " + Str(Row)
      OldRow = Row
      OldPos = Pos
    EndIf
  EndIf
  
ForEver
Bernd
Azur
User
User
Posts: 63
Joined: Sat Jan 28, 2012 11:13 am

Re: GetMusicRow issue

Post by Azur »

Yes my bad, the word "position" was not a good choice ( Frenchfrog here ).
Your example works better since it fetch all rows number. Thx, i will study this.
But there is a +-1 second shift between the row position and the actual audio.
Is this bufferisation related ?
Post Reply