Page 1 of 1

GetMusicRow issue

Posted: Thu Nov 27, 2014 12:16 pm
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.

Re: GetMusicRow issue

Posted: Thu Nov 27, 2014 1:58 pm
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

Re: GetMusicRow issue

Posted: Thu Nov 27, 2014 2:18 pm
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 ?