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

Author Topic: exception thrown at music.openFromFile("b.wav");  (Read 3680 times)

0 Members and 1 Guest are viewing this topic.

Dan9321

  • Newbie
  • *
  • Posts: 2
    • View Profile
exception thrown at music.openFromFile("b.wav");
« on: April 03, 2015, 09:31:11 pm »
The .exe and the .wav file are in the same directory and for some reason i am getting this run time exception. And i am hearing a sort of "beep" sound over and over. 

sf::Music music;

exception here ----> music.openFromFile ("b.wav");

pretty basic here nothing crazy

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: exception thrown at music.openFromFile("b.wav");
« Reply #1 on: April 03, 2015, 09:32:30 pm »
Mixing release and debug modes?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Dan9321

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: exception thrown at music.openFromFile("b.wav");
« Reply #2 on: April 03, 2015, 09:33:19 pm »
Right now i am only doing debug mode and everything i need is in the Debug Folder

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: exception thrown at music.openFromFile("b.wav");
« Reply #3 on: April 03, 2015, 09:52:27 pm »
But do you also link the debug libraries of SFML (the ones with the -d suffix)?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: exception thrown at music.openFromFile("b.wav");
« Reply #4 on: April 04, 2015, 02:42:38 pm »
What exception specifically?

What exception text?

What's the current working directory when the program runs (depending on how you run it it is not necesarily the same directory as the .exe)?

What compiler?

Is your application built with the exact same compiler as SFML?

What SFML version?

Pre-built or custom built SFML?

As already mentioned, are you sure you are not linking debug libs to release app (or the other way around)?

Are you linking statically or dynamically?

Please read these links :
  How To Ask Questions The Smart Way
  Short, Self Contained, Correct (Compilable), Example
« Last Edit: April 04, 2015, 02:44:30 pm by Jesper Juhl »

MasterDeveloper

  • Newbie
  • *
  • Posts: 14
  • Forever, is not forever!
    • View Profile
    • Email
Re: exception thrown at music.openFromFile("b.wav");
« Reply #5 on: April 12, 2015, 03:48:29 pm »
Hi, I am newbie at this forum...
but I like to help anybody, about programming!  ;)

1.Did you linked all the libraries what is required? (without and with '-d' suffix)?
2.I think that sf::Music cannot play '.wav' file formats or maybe it can?!?!
3.Maybe you should add first 'sf::SoundBuffer' argument to your '--> music.loadFromFile() <--'!!!
4.Try on Release mode!!! (because, that worked for me sometimes)

One of these four, must be correct but if not, i really don't know what that can be??? (That is really crazy exception)!  :o
M4st3rD3v3l0p3r

Born to be C++ Programmer!

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: exception thrown at music.openFromFile("b.wav");
« Reply #6 on: April 12, 2015, 08:21:46 pm »
Hi, I am newbie at this forum...
but I like to help anybody, about programming!  ;)
That's nice, but please inform yourself at least a bit before telling nonsense ;)

1.Did you linked all the libraries what is required? (without and with '-d' suffix)?
2.I think that sf::Music cannot play '.wav' file formats or maybe it can?!?!
3.Maybe you should add first 'sf::SoundBuffer' argument to your '--> music.loadFromFile() <--'!!!
4.Try on Release mode!!! (because, that worked for me sometimes)
1. If he didn't link the libraries, the program wouldn't even start.
2. It can
3. No idea what you mean exactly, but it's certain wrong. sf::SoundBuffer is a different class.
4. Even if that "fixed" it, it's still no real solution as long as one is not able to run in Debug mode.

And if you use single question/exclamation marks and a bit less of h4xx0r language, people can take you much more seriously. Just some tips for future posts and clarification to avoid confusion in this thread, don't take it personally :)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development: