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

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

0 Members and 3 Guests are viewing this topic.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • 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: 11033
    • 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
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

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: 11033
    • 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
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

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.

 

anything