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

Author Topic: Error loading audio file  (Read 1351 times)

0 Members and 1 Guest are viewing this topic.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32461
    • View Profile
    • SFML's website
    • Email
Re: Error loading audio file
« Reply #15 on: January 17, 2020, 08:37:00 am »
If you copied the right DLL at the right place, it can't say that anymore ;)
Laurent Gomila - SFML developer

TeGeek

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Error loading audio file
« Reply #16 on: January 17, 2020, 10:03:22 am »
ok so i got the sound example to work and it plays the sound without problem. i tried putting the sound file the the example used in my project at the working path location but it still fails to load.

what is the code i need to use to get sfml to print out error since what im trying to use isnt working.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 9630
    • View Profile
    • development blog
    • Email
Re: Error loading audio file
« Reply #17 on: January 17, 2020, 10:37:50 am »
Can you provide your code as a minimal example that still causes the issue?
Official FAQ: https://www.sfml-dev.org/faq.php
Nightly Builds: https://www.nightlybuilds.ch/
——————————————————————
Dev Blog: https://dev.my-gate.net/
Thor: http://www.bromeon.ch/libraries/thor/

TeGeek

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Error loading audio file
« Reply #18 on: January 17, 2020, 11:04:18 am »
so this is from when i tried to get sound to work on a seperate file and its not working


Code: [Select]
#include <SFML/System.hpp>
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>z
#include <iostream>
#include <fstream>
#include <sstream>
#include <streambuf>


using namespace std;

#ifdef _DEBUG
#pragma comment(lib, "sfml-window-d.lib")
#pragma comment(lib, "sfml-system-d.lib")
#pragma comment(lib, "sfml-graphics-d.lib")
#pragma comment(lib, "sfml-audio-d.lib")
#else
#pragma comment(lib, "sfml-window.lib")
#pragma comment(lib, "sfml-system.lib")
#pragma comment(lib, "sfml-graphics.lib")
#pragma comment(lib, "sfml-audio.lib")
#endif


int main()
{

sf::SoundBuffer buffer;
if (!buffer.loadFromFile("sounds/canary.wav"))
{
std::ofstream file("sfml-log.txt");
std::streambuf* previous = sf::err().rdbuf(file.rdbuf());
cerr << "i wantt more debuf info than this";
return -1;
}

sf::Sound death;

death.setBuffer(buffer);

death.play();

getchar();
return 0;
}

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 9630
    • View Profile
    • development blog
    • Email
Re: Error loading audio file
« Reply #19 on: January 17, 2020, 11:39:16 am »
Is this a typo or do you actually have that 'z' in your source code?

#include <SFML/Graphics.hpp>z
Official FAQ: https://www.sfml-dev.org/faq.php
Nightly Builds: https://www.nightlybuilds.ch/
——————————————————————
Dev Blog: https://dev.my-gate.net/
Thor: http://www.bromeon.ch/libraries/thor/

TeGeek

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Error loading audio file
« Reply #20 on: January 17, 2020, 11:44:23 am »
its a type but that wasnt the issue got it solved by a friend. issue was with it being in debug instead of realease mode.