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

Author Topic: Music and sounds are silent when I load and play them  (Read 1929 times)

0 Members and 1 Guest are viewing this topic.

WarrenM

  • Newbie
  • *
  • Posts: 2
    • View Profile
Music and sounds are silent when I load and play them
« on: July 23, 2018, 01:49:30 am »
Probably a super basic question, and I apologize of this has been asked 100 times but my google'ing is coming up dry.

So, I have a simple program that opens a window and waits for me to close it.  Before that main loop, I load an play a music clip like so ...

sf::Music music;
music.openFromFile( "../sounds/music_01.wav" );
music.play();

I debugged this and the sound file loads successfully but I hear nothing.  Same thing with sound effects. Just silence...

Volume seems to be set to 100 so ... what else should I be looking at?  This feels like it should "just work" but I'm sort of hitting a wall here.

Thanks!

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10800
    • View Profile
    • development blog
    • Email
Re: Music and sounds are silent when I load and play them
« Reply #1 on: July 23, 2018, 08:14:47 am »
What does openFromFile return?

Also make sure your PC isn't muted. :D
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

WarrenM

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Music and sounds are silent when I load and play them
« Reply #2 on: July 23, 2018, 05:49:36 pm »
I can't believe I did that. Path was wrong, music wasn't being loaded ... when you think of this thread in the future, try not to laugh TOO hard.  :)

Thanks for making me double check the return value ...