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

Author Topic: [solved]problem with playing second music  (Read 4788 times)

0 Members and 1 Guest are viewing this topic.

riadh

  • Newbie
  • *
  • Posts: 12
    • View Profile
    • Email
[solved]problem with playing second music
« on: December 27, 2012, 11:47:22 pm »
Hello , in my game i have this
-i play a background music ,
-then i closed the window ,
-i opned a new one
-i close the first muic
-i play new musc
---> the new musc doesn't start
do u know why ?
Thanks
« Last Edit: December 28, 2012, 12:23:28 am by riadh »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11037
    • View Profile
    • development blog
    • Email
Re: problem with playing second music
« Reply #1 on: December 27, 2012, 11:53:49 pm »
Rather than make some (hard to read, due to the lack of using a proper list or adding a space between the dash and I) listing, you should provide a complete and minimal example, that reproduces the problem.

What exactly do you mean by 'I close the first music'? And what's your 'new music'? ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

riadh

  • Newbie
  • *
  • Posts: 12
    • View Profile
    • Email
Re: problem with playing second music
« Reply #2 on: December 27, 2012, 11:56:59 pm »
Rather than make some (hard to read, due to the lack of using a proper list or adding a space between the dash and I) listing, you should provide a complete and minimal example, that reproduces the problem.

What exactly do you mean by 'I close the first music'? And what's your 'new music'? ;)


at the first
 backMusic.OpenFromFile("src/jungle_1.ogg");
    backMusic.SetLoop(true);
    backMusic.Play();
 


in the seconde window
    backMusic.Stop();
    lostMusic.OpenFromFile("src/dead.ogg");
    lostMusic.SetLoop(true);
    lostMusic.Play();
 

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11037
    • View Profile
    • development blog
    • Email
Re: problem with playing second music
« Reply #3 on: December 28, 2012, 12:00:13 am »
And now provide a complete example, so we actually see what's going on. ;)
Stopping music and closing music are two different terms, so use the one that actually describes the action.

Additionally I strongly advice you to use SFML 2, because SFML 1.6 hasn't been touched in over 2.5 years, has many bugs and lacks a lot of features. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

riadh

  • Newbie
  • *
  • Posts: 12
    • View Profile
    • Email
Re: problem with playing second music
« Reply #4 on: December 28, 2012, 12:06:26 am »
And now provide a complete example, so we actually see what's going on. ;)
Stopping music and closing music are two different terms, so use the one that actually describes the action.

and how to close the music ??  there aren't a function called close :/

riadh

  • Newbie
  • *
  • Posts: 12
    • View Profile
    • Email
Re: problem with playing second music
« Reply #5 on: December 28, 2012, 12:23:18 am »
Solved , : my code is correct , just need to put it out of the while(opned)

 

anything