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

Author Topic: Bug on Music.Stop  (Read 7344 times)

0 Members and 2 Guests are viewing this topic.

IsThisTheRealLife

  • Newbie
  • *
  • Posts: 7
    • View Profile
Bug on Music.Stop
« on: November 08, 2015, 12:56:35 pm »
Hello, i'm using last release of csfml (in fact, i use the binaries provided by this page) in windows xp. When i load an ogg file, set it to play and stop, it sounds like the program was stuck in that segment. The file i'm using is 'cave.ogg', the music track you can find in spelunky http://www.spelunkyworld.com/original.html

My question is, is this some bug resolved in 2.4?

EDIT:
CODE HERE
« Last Edit: November 09, 2015, 11:18:17 am by IsThisTheRealLife »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Bug on Music.Stop
« Reply #1 on: November 08, 2015, 02:48:12 pm »
Can you provide more information on this?

When i load an ogg file, set it to play and stop, it sounds like the program was stuck in that segment.
What does that even mean? What segment? What is stuck in your opinion?

Also, what compiler do you use?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

IsThisTheRealLife

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Bug on Music.Stop
« Reply #2 on: November 08, 2015, 03:02:19 pm »
Can you provide more information on this?

When i load an ogg file, set it to play and stop, it sounds like the program was stuck in that segment.
What does that even mean? What segment? What is stuck in your opinion?

Also, what compiler do you use?

I dont know how to explain it, it is a phenomenon pretty common when you are listening to music and for some reason the program playing it crashes or the computer runs out of resources, like it reproduces the last thing it was playing at the moment.

Im using mingw-w64. I dont have this issue if i pause the music and then stop it.

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Bug on Music.Stop
« Reply #3 on: November 09, 2015, 01:13:59 am »
What version of CSFML and SFML do you have? Just linking to the repo doesn't tell me anything because there is no binaries available there. Also writing a complete and minimal example would be helpful (I kinda doubt it is an issue in CSFML as it is just a wrapper around SFML).
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

IsThisTheRealLife

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Bug on Music.Stop
« Reply #4 on: November 09, 2015, 11:13:55 am »
I got the binaries from here http://www.sfml-dev.org/download/csfml/ (2.3 | Visual C++ / GCC - 32-bit)

Minimal example:
Code: [Select]
#include "SFML/Audio.h"

int main(int argc, char * argv[])
{
    sfMusic* music = sfMusic_createFromFile("cave.ogg");
    sfMusic_play(music);
    sleep(5);
    sfMusic_stop(music);
    sfMusic_play(music);
    sleep(5);
    printf("Done\n");
    return 0;
}

Compiled with:
Code: [Select]
gcc ex.c -o ex.exe -g3 -Wall -Wextra -pedantic -IC:csfml\include -LC:csfml\lib\gcc -lcsfml-audio
xp32

IsThisTheRealLife

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Bug on Music.Stop
« Reply #5 on: November 10, 2015, 10:24:14 am »
Do i need to post anything else? It seems to me that problem happens with every audio file used, not just the one i put.

IsThisTheRealLife

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Bug on Music.Stop
« Reply #6 on: November 17, 2015, 05:39:14 pm »
What version of CSFML and SFML do you have? Just linking to the repo doesn't tell me anything because there is no binaries available there. Also writing a complete and minimal example would be helpful (I kinda doubt it is an issue in CSFML as it is just a wrapper around SFML).
I'm sorry if i'm being annoying. Is this all the information you need? I dont know if you saw my post.

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Bug on Music.Stop
« Reply #7 on: November 17, 2015, 09:47:21 pm »
I tested your code and everything works as expected (even downloaded your game and pulled out the cave.ogg). The music plays for 5 seconds, then starts playing again from the beginning for 5 seconds and then the program exits.

When i load an ogg file, set it to play and stop, it sounds like the program was stuck in that segment.

I'm not sure what you mean by this, can you explain in more detail what is happening/what you are hearing and what you expect to happen?
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Bug on Music.Stop
« Reply #8 on: November 17, 2015, 10:19:44 pm »
If I was to guess, I'd guess that this is a case of either
1) mixing debug and release builds of the library (and/or dependencies) and the application; which usually leads to crashes or random weird results (like what you are experiencing).
2) mixing a build of the library (and/or dependencies) with one compiler version with a build of the application with a different compiler version; which often leads to crashes or random weird results (like what you are experiencing).
« Last Edit: November 17, 2015, 10:21:24 pm by Jesper Juhl »

IsThisTheRealLife

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Bug on Music.Stop
« Reply #9 on: November 18, 2015, 05:27:44 pm »
I tested your code and everything works as expected (even downloaded your game and pulled out the cave.ogg). The music plays for 5 seconds, then starts playing again from the beginning for 5 seconds and then the program exits.

When i load an ogg file, set it to play and stop, it sounds like the program was stuck in that segment.

I'm not sure what you mean by this, can you explain in more detail what is happening/what you are hearing and what you expect to happen?

I found the way to record my problem, this is what i hear.

 

anything