Advertisement
Guest User

Untitled

a guest
Jul 4th, 2012
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. Ricky Romero rlr@ricky-romero.com
  2.  
  3. 7:41 PM (2 hours ago)
  4.  
  5. to me
  6. Hey again Grant,
  7.  
  8. Thank you for your help previously. I'm using XAudioJS in an HTML5 version of Cave Story which is launching in a few weeks. It works well, but I have a question.
  9.  
  10. My game runs at 60fps, at a 44100 Hz sample rate. Currently, I'm using xAudioJS.executeCallback() 60 times per second, and generating two frames' worth of audio (1,470 samples, times 2 channels) to have a reasonable buffer in case my framerate drops. In practice, this means that my callback is used 30 times per second, but the audio is seamless.
  11.  
  12. However, I wish to reduce my latency, and there are some things in my game that occur more than 30 times per second which generate sound effects. Ideally, what I want to do is generate audio 60 times per second, but continue to send 2 (or more) frames' worth of audio to XAudioJS. From what I can see in XAudioJS's API, this is not possible without accumulating in XAudioJS's buffer and causing greater and greater latency.
  13.  
  14. Given your familiarity with the different audio APIs you're using, do you know if it's possible to send more audio to the browser than is needed, and overwrite the samples remaining in its buffer when the next frame is rendered? I ask because I'd be willing to try forking the project and adding this functionality. Or, is there something that does what I want in XAudioJS's API already?
  15.  
  16. Thanks for your time.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement