Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Sound channels?  (Read 4875 times)

0 Members and 1 Guest are viewing this topic.

Sigvatr

  • Newbie
  • *
  • Posts: 32
    • MSN Messenger - msn@sigvatr.com
    • AOL Instant Messenger - SigvatrAIM
    • View Profile
    • http://www.sigvatr.com
Sound channels?
« on: August 30, 2009, 12:50:13 am »
I can't seem to find anywhere how many sounds SFML can play at once, I'm assuming there is probably a hard cap on 16 sounds at once without audio hardware, am I correct?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Sound channels?
« Reply #1 on: August 30, 2009, 01:03:34 am »
Hi

First, please post in the correct forum. There's no reason to post in the General forum for a question about audio ;)

The maximum number of sounds that you can create at the same time is defined by the underlying audio API used by SFML, which is OpenAL. I don't remember the minimum number of sound sources it has to support, but it's higher than what you need. Something like 64 or 256.
Laurent Gomila - SFML developer

Sigvatr

  • Newbie
  • *
  • Posts: 32
    • MSN Messenger - msn@sigvatr.com
    • AOL Instant Messenger - SigvatrAIM
    • View Profile
    • http://www.sigvatr.com
Sound channels?
« Reply #2 on: September 01, 2009, 12:01:11 pm »
I have another question.

When I load a sound into memory and then create a sound based on that file in memory, does it make a copy of the original sound buffer file? And if so, when I put changes on it, say, pitch and such, does that apply changes to the sound in the sound buffer or is it processed real time?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Sound channels?
« Reply #3 on: September 01, 2009, 12:17:20 pm »
Nothing is duplicated. That's the reason why there are sound buffers, where all the sound data is stored, and sound sources, that just play this unique sound data with different parameters.
Laurent Gomila - SFML developer

Sigvatr

  • Newbie
  • *
  • Posts: 32
    • MSN Messenger - msn@sigvatr.com
    • AOL Instant Messenger - SigvatrAIM
    • View Profile
    • http://www.sigvatr.com
Sound channels?
« Reply #4 on: September 01, 2009, 12:37:25 pm »
Thanks.

One thing I have noticed is that pitch shifting isn't entirely authentic (I know real pitch shifting is probably sucks the processor juice), as in it speeds up or down the playback (I think).

I'm assuming that, based on what you've just said, when I have a sound pitch shifted and I try to SetPlayingOffset, it jumps to the actual offset time that you specify in the sound of the buffer's position, rather than the pitch shifted time, which theoretically would have been different because the timing would have been changed given the nature of the pitch shifting.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Sound channels?
« Reply #5 on: September 01, 2009, 01:16:34 pm »
I know, but unfortunately I have no control over the pitch, it is handled by OpenAL.
Laurent Gomila - SFML developer

 

anything