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

Author Topic: Larger .ogg files not being played  (Read 6667 times)

0 Members and 1 Guest are viewing this topic.

rahul8590

  • Newbie
  • *
  • Posts: 25
    • View Profile
Larger .ogg files not being played
« on: March 18, 2010, 09:35:45 pm »
I am running the music playing program from the tutorials , and it works awesome for smaller files which is in Kbs . But for larger files , which are in Mbs are just not being played . Wat could be the  problem .. ?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Larger .ogg files not being played
« Reply #1 on: March 18, 2010, 11:13:55 pm »
The ogg file provided with the sound sample is 4.15 MB, and it has always worked so far.

Can you give more informations about your computer?
Laurent Gomila - SFML developer

rahul8590

  • Newbie
  • *
  • Posts: 25
    • View Profile
Larger .ogg files not being played
« Reply #2 on: March 20, 2010, 07:20:29 pm »
Firstly sorry for late reply .

The program is playing original ogg files .
But if i convert mp3 files to ogg format . i dunno why its not playing.

Is the converted flawed .. ?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Larger .ogg files not being played
« Reply #3 on: March 21, 2010, 11:41:43 am »
Quote
Is the converted flawed .. ?

Probably. What converter are you using?
Laurent Gomila - SFML developer

rahul8590

  • Newbie
  • *
  • Posts: 25
    • View Profile
Larger .ogg files not being played
« Reply #4 on: March 21, 2010, 11:49:55 am »
FLV to AVI MPEG WMV 3GP MP4 iPod Converter is a professional FLV converter software which can convert Flash Video FLV to AVI, FLV to MPEG, FLV to WMV, FLV to MP4 format

It also works on other conversion ..  i have tested it

its built by Aone Technologies .

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Larger .ogg files not being played
« Reply #5 on: March 21, 2010, 11:57:26 am »
Do you have any message on the standard error output?

Can you send me one of the files that you converted and that doesn't work? I changed the ogg/vorbis library in SFML 2 (the official one) and I want to see if it makes a difference.
Laurent Gomila - SFML developer

rahul8590

  • Newbie
  • *
  • Posts: 25
    • View Profile
Larger .ogg files not being played
« Reply #6 on: March 21, 2010, 05:09:58 pm »
Well .. the file kinda worked when i ran the exe version of my program directly , but in the end the program crashed .. i mean while exiting i got an error saying this program has encountered with a problem .

http://  http://www.box.net/shared/rmgphb42xi


The above link has the program in exe and the sound file .

In case u need the code i will post it to.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Larger .ogg files not being played
« Reply #7 on: March 21, 2010, 05:16:37 pm »
Quote
The above link has the program in exe

I'd prefer a source code ;)
If yours is too big, you can provide a minimal example (if it's just about playing the music, it can fit in ten lines of code). This will also make sure that the bug is not caused by the rest of your code.
Laurent Gomila - SFML developer

rahul8590

  • Newbie
  • *
  • Posts: 25
    • View Profile
Larger .ogg files not being played
« Reply #8 on: March 21, 2010, 05:30:00 pm »
not a problem at all .. the below is the code ..


Code: [Select]


#include <SFML/Graphics.hpp>
#include<SFML/Audio.hpp>
#include<iostream>

 int main()
 {
     // Create the main window
     sf::RenderWindow App(sf::VideoMode(640, 480), "Rahul.Reincarnated ");

     // Load a sprite to display
     sf::Image Image;
     if (!Image.LoadFromFile("image2.png"))
         return EXIT_FAILURE;
     sf::Sprite Sprite(Image);


    // Adding some music to program
    sf::Music Music;
    if (!Music.OpenFromFile("hydrate.ogg"))
        return EXIT_FAILURE;


     // Create a graphical string to display
     sf::Font Arial;
     if (!Arial.LoadFromFile("arial.ttf"))
         return EXIT_FAILURE;
     sf::String Text("\t \t \t \t \t \t \t \t \t \t OpenGL Project \n \t \t \t \t \t \t \t \t By Rahul & Pooja ", Arial, 50);

    // Play it
    Music.Play();





    const int SCROLL_SPEED = 20;    // rendering 20 pixesl per second
    Text.SetY(40);  // text positions is above the screen

//    std::cout<< Text.GetPosition();

    while (App.IsOpened())
     {
         // Process events
         sf::Event Event;
         while (App.GetEvent(Event))
         {
             // Close window : exit
             if (Event.Type == sf::Event::Closed)
                 App.Close();

            if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
                App.Close();


         }




         // Clear screen
         App.Clear();

         // Draw the sprite
         App.Draw(Sprite);

         // Draw the string
         App.Draw(Text);


         // Increase Y Axis to move down
        Text.Move( 0 ,App.GetFrameTime() * SCROLL_SPEED) ;
        //Text.Move ( 10,100);

        if( Text.GetPosition().y > 400 )
    Text.SetPosition( 0.f, 10 );

         // Update the window
         App.Display();


        // Loop while the music is playing



     }

    std::cout<<" thank you for using the program ";
    getchar();

     return EXIT_SUCCESS;
 }



Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Larger .ogg files not being played
« Reply #9 on: March 21, 2010, 06:39:14 pm »
Thanks :)

The song doesn't work with SFML 1.x (it crashes after starting it, with a NULL pointer exception) but works perfectly in SFML 2.
Laurent Gomila - SFML developer

rahul8590

  • Newbie
  • *
  • Posts: 25
    • View Profile
Larger .ogg files not being played
« Reply #10 on: March 21, 2010, 06:45:50 pm »
Anything .. i can do to specifically fix this one ...
I mean i will have to later on attach my opengl code in here and do a lot of stuff . since my i have told my team members to built it using 1.5 platform only so .. i cant change it as of now .

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Larger .ogg files not being played
« Reply #11 on: March 21, 2010, 06:51:22 pm »
Maybe try using another converter. You're the first one to report this kind of issue, so it should be easy to find a converter which is 100% compatible with SFML 1.5 ;)
Laurent Gomila - SFML developer

model76

  • Full Member
  • ***
  • Posts: 231
    • View Profile
Larger .ogg files not being played
« Reply #12 on: March 22, 2010, 12:43:34 am »
My all time favorite ogg encoder is OggDropXPD. It does anything I ever needed, and it couldn't be easier to use!

Get it here: http://www.rarewares.org/ogg-oggdropxpd.php

Unfortunately, it doesn't read mp3 files, but if your converter can convert to wav, then you are all set.
Anyway, it is not optimal to convert between non-loss less compressed formats, as you will get the downsides of both compressions. If you can, you should get the original file in a pcm format, such as wav or aiff, and only compress it once, at the last stage.

 

anything