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

Author Topic: Synchronized playing of multiple ogg files  (Read 2993 times)

0 Members and 1 Guest are viewing this topic.

Spellbreaker

  • Newbie
  • *
  • Posts: 33
    • ICQ Messenger - 287156171
    • MSN Messenger - spellbreaker@live.de
    • Yahoo Instant Messenger - Spellbreaker1979
    • View Profile
    • http://www.apeironstudios.com
Synchronized playing of multiple ogg files
« on: April 12, 2011, 08:11:31 pm »
Hey there!

For a couple of time, I am trying to write a small program that does nothing than playing three .ogg files 100 % synchronized. Since it seems it is not possible, I wonder if I can use a multichannel ogg ( three active channels ), and change the volume of the channels to fade between the actual songs?

I want to use this to make it possible to fade in / out additional instrument tracks.

I tried the following simple code :
Code: [Select]
   music1.OpenFromFile("mansion-present-hihat.ogg");
     music2.OpenFromFile("mansion-present-hihat.ogg");
     music3.OpenFromFile("mansion-present-hihat.ogg");
     music1.Play();
     music2.Play();
     music3.Play();


I also tried to add the folowing :
Code: [Select]

     music1.SetPlayingOffset(0);
     music2.SetPlayingOffset(music1.GetPlayingOffset());
     music3.SetPlayingOffset(music2.GetPlayingOffset());


Any Ideas?

Sincerly,

Spellbreaker.
[/code]

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Synchronized playing of multiple ogg files
« Reply #1 on: April 12, 2011, 10:05:41 pm »
To be honest, I've never really thought about synchronization issues. I don't even know if you can do it without specialized APIs (I guess it depends on how accurate you want to be).
Laurent Gomila - SFML developer