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

Author Topic: [SFML 2] Is it possible to put multiple sound files in one sf::SoundBuffer?  (Read 2391 times)

0 Members and 1 Guest are viewing this topic.

Dormoxx

  • Newbie
  • *
  • Posts: 2
    • View Profile
I've been looking around for the past hour-ish and can't seem to find any answer that I can understand. The tutorial says that you can load directly from an array of samples, but I don't know how to do that. I want to be able to load 2 different sound effect files into one buffer and choose when to play each sound. Is it possible to have 2 sound files loaded into an sf::SoundBuffer? And if so, could someone point me in the right direction?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
You can merge as many sounds into a single buffer (sounds are just arrays of integers), but you won't be able to keep them separate and choose one or another later.
Laurent Gomila - SFML developer

Dormoxx

  • Newbie
  • *
  • Posts: 2
    • View Profile
So, one soundbuffer per sound? Sounds good to me. Thanks for the help!:D

 

anything