Wintermute Engine Forum

Wintermute Engine => Bug reports => Topic started by: atm_deev on December 03, 2008, 08:20:24 AM

Title: GetSoundPosition() [wme 1.8.008]
Post by: atm_deev on December 03, 2008, 08:20:24 AM
[wme 1.8.008]

GetSoundPosition()
this function very strange works... not understand.

Code: [Select]
Game.PlaySound ("sounds\fireplace.ogg");
Game.LOG ("this.GetSoundPosition() = "+ Game.GetSoundPosition());

LOG:
this.GetSoundPosition() = 1974

Other sounds give different values.

p.s.
Or I obtuse or one of two...
Title: Re: GetSoundPosition() [wme 1.8.008]
Post by: Mnemonic on December 03, 2008, 01:47:44 PM
Yes, this method is buggy (as well as GetMusicPos()). If you need precise position, you can workaround it by remembering the start time:

Code: WME Script
  1. var StartTime = Game.CurrentTime;
  2. Game.PlaySound("blah.ogg")
  3. ...
  4. var PlaybackTime = Game.CurrentTime - StartTime;
  5.  
Title: Re: GetSoundPosition() [wme 1.8.008]
Post by: atm_deev on December 04, 2008, 07:32:26 AM
Thank you. I was forced to do so to do.
Title: Re: GetSoundPosition() [wme 1.8.008]
Post by: thamesonfire on November 17, 2009, 04:44:36 AM
I was just curious if this issue was ever addressed in a subsequent build. I couldn't find any further information, and it's not in the "will not fix" category. I'm debating engines for a project, but I need pretty precise audio control.
Title: Re: GetSoundPosition() [wme 1.8.008]
Post by: Mnemonic on November 17, 2009, 08:56:10 AM
No, no progress on this one.