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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - treez

Pages: [1]
1
Audio / Re: New audio file 2 time longer than original.
« on: March 03, 2016, 04:41:55 pm »
I downloaded Audacity and converted an mp3 file to wav. I tested it and the bug is still there.

I am passing a c string because of the purposes of my program.

2
Audio / Re: New audio file 2 time longer than original.
« on: March 01, 2016, 06:12:54 pm »
I used an online YT to wav converter to get a wav file.

I think that SFML still has a bug. I tried this two lines of code:

buffer.loadFromFile(path.c_str());
buffer.saveToFile("test.wav");
 

And test.wav still is still produced like before. (the duration is 2 times longer).
I guess I leave it like this. If someone knows what could be the issue please let me know.

EDIT: if someone has a link to download a free .wav file plase let me know. But I believe that the file is not the issue here.

3
Audio / Re: New audio file 2 time longer than original.
« on: February 29, 2016, 07:30:39 pm »
I was not sure before but now when you asked I downloaded latest version once again and the file is still not correct.

4
Audio / Re: New audio file 2 time longer than original.
« on: February 29, 2016, 11:01:58 am »
My sound file is 5:07 mins long.

By 2 times longer I mean that when I play it, it plays normal for 5:07 mins and then from 5:08 to 10:14 is just pure silence.

I'm not really sure what do you mean by : "Do you get this effect with all samples or just one?"

Basically I want to get all the samples, change them a little bit and then make a new file.

My code is identical to the code that I posted. Those calculations that I am making in my program (changing the samples) are not included on purpose, for simplicity sake.

5
Audio / Re: New audio file 2 time longer than original.
« on: February 28, 2016, 11:18:48 pm »
I checked if the sound has 2 channels and it does. When I play the original file everything works fine.

6
Audio / Re: New audio file 2 time longer than original.
« on: February 28, 2016, 06:07:39 pm »
It believe it is latest version for Visual Studio.

7
Audio / New audio file 2 time longer than original.
« on: February 28, 2016, 05:03:12 pm »
            

                cout << "Enter the name of the audio\n>";
                                cin >> path;

                                sf::SoundBuffer buffer;
                                buffer.loadFromFile(path.c_str());

                                sf::Int16 * samples = new sf::Int16[buffer.getSampleCount()];

                                int ind = 0, progress = 0, last = 0;
                                float running = 1.0f;
                                string bin_code = "";

                                for (int i = 0; i < buffer.getSampleCount(); i++)
                                {
                                        samples[i] = buffer.getSamples()[i];
                                }
                                sf::SoundBuffer buff;

                                buff.loadFromSamples(samples, buffer.getSampleCount(), buffer.getChannelCount(), buffer.getSampleRate());
                                buff.saveToFile("test.wav");

                                delete[] samples;

 

The file that is created is two times longer then original. Its not bigger (in size) but it has duration 2 times longer than original. Also, when i try to play it with SFML it doest play but when I try to play it with Windows media player it does play (when it exceeds the duration of the song the music is still "playing" but there's no sound).

8
Graphics / Re: getting pixels from sf::Image
« on: February 10, 2016, 03:08:15 pm »
I was using .bmp format. I checked if it supports transparency and Google says it does.


EDIT: well.. I ended up checking all the types of images that SFML supports and the format that works is indeed .png.

Still not sure why the others arent working, guess Google is a liar or SFML has some buggs.

9
Graphics / getting pixels from sf::Image
« on: February 10, 2016, 12:28:16 am »
I am currently trying to change the values of pixels of an Image.

When I change r g b values of an image and then I save it to a file it works propery.

Then I tried to change the alpha value also (I assing 253 or 245) and save the image. And my program does save it.

And then one weird thing happens when I open that changed image. The r g and b values are changed the way I changed them before, but alpha is ALWAYS 255 and I am wondering why if I saved the image.

As you might know, I am using setPixel function to change the pixels.

Pages: [1]
anything