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

Author Topic: Unsupported File  (Read 6051 times)

0 Members and 2 Guests are viewing this topic.

Mbass

  • Newbie
  • *
  • Posts: 7
    • View Profile
Unsupported File
« on: February 17, 2017, 05:16:12 pm »
Hey,
i tried to play a file but its printing me, that my file is a invalid or unsupported file.
I'm tried .mp3 and .wav but it isnt working.

I also move already the libsndfile-1dll.dll and openal32.dll in the ordner with the .exe.
Is this right? or do i have to make something else to play sounds?

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: Unsupported File
« Reply #1 on: February 17, 2017, 07:05:01 pm »
SFML doesn't support mp3 files, wav depends on the actual encoding. Can you post/attach the wav file you've tried? Or try using ogg.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Unsupported File
« Reply #2 on: February 17, 2017, 07:19:43 pm »
Also, if you're using an SFML version that still uses libsndfile, you should upgrade SFML.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Mbass

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Unsupported File
« Reply #3 on: February 18, 2017, 03:01:43 pm »
Hey,
i'm using now .ogg files and its working. (btw. i'm using the newest version of SFML, i just thought, that i have to use the libsndfile, because of some old threads :p)

But i got a new problem. If i create a SoundBuffer, it takes 3300ms to create it.
I guess thats not how it suppose to be. 

        clock_t zeit1, zeit2;
        zeit1 = clock();

        sf::SoundBuffer soundBuffer;

        zeit2 = clock();
        std::cout << "time: : " << (zeit2 - zeit1) << "\n"; //3300ms

 

I dont even load any sound into it anymore. :/

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Unsupported File
« Reply #4 on: February 18, 2017, 03:08:40 pm »
And what is clock_t and clock() supposed to be? Do they actually do what you think they should?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Mbass

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Unsupported File
« Reply #5 on: February 18, 2017, 03:44:01 pm »
It's just to count the time, so i know how long it takes to create a SoundBuffer.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Unsupported File
« Reply #6 on: February 18, 2017, 06:16:49 pm »
If it prints "3300" then it's most likely not 3300 milliseconds. Read the documentation of this function before assuming anything ;)
Laurent Gomila - SFML developer

Mbass

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Unsupported File
« Reply #7 on: February 18, 2017, 08:59:41 pm »
@Laurent
I dont really get what you mean. Do i use the clock function of c++ wrong?

But i guess it's pretty off topic.

It takes a lot of time to create the SoundBuffer for me.
Any ideas?

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Unsupported File
« Reply #8 on: February 18, 2017, 11:11:14 pm »
Do i use the clock function of c++ wrong?

But i guess it's pretty off topic.
I think it's actually the point of the topic. If you're misunderstanding the value given to you by a clock reading, the amount of time that sound buffer is actually taking is not known.

Apart from your programatic timing, how long do you think sound buffer actually takes? Does your program freeze for a number of seconds? It might be something else causing that delay...
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Unsupported File
« Reply #9 on: February 19, 2017, 10:57:46 am »
Quote
I dont really get what you mean. Do i use the clock function of c++ wrong?
Where did you read that std::clock() was returning milliseconds?

Quote
But i guess it's pretty off topic.
If it's 3300 microseconds instead of 3300 milliseconds then there's no problem, so to me it's exactly on topic.
« Last Edit: February 19, 2017, 10:59:48 am by Laurent »
Laurent Gomila - SFML developer

Mbass

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Unsupported File
« Reply #10 on: February 23, 2017, 01:24:18 pm »
Its 3300 milliseconds. I guess i can feel the difference between 3300 microseconds ans 3300 milliseconds.

But nvm i hope i will find a way to fix it



Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Unsupported File
« Reply #11 on: February 23, 2017, 03:08:36 pm »
Quote
I guess i can feel the difference between 3300 microseconds ans 3300 milliseconds.
Ok, so there is something wrong somewhere. However... if it outputs 3300 and these are microseconds, then the problem may be elsewhere. So be sure that you correctly interpret what std::clock() gives you.
Laurent Gomila - SFML developer

 

anything