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 - eyadof

Pages: [1]
1
Audio / Re: Applying echo effect using sfml audio
« on: February 17, 2014, 11:14:54 pm »
Haha  :D , I didn't forget the buffer of course but there was a mess in declarations of those three objects.

In my real situation I'm actually using a class to wrap up the working with sound functionality which is used by other objects and I made some scope errors  :-X, This code is just a demo (an awful one  :-\), maybe I'm looking like a totally rookie programmers but it's the "deadlines pressure" which make the impossible possible :D.

Thank you about the sf:Clock clue that is how it's done but as the doc said about sleep:
 
Quote
Make the current thread sleep for a given duration.

I don't mind if the echo sound thread blocked less than a second.

2
Audio / Re: Applying echo effect using sfml audio
« on: February 17, 2014, 09:48:49 am »
i'm sorry for annoying everybody my mistake was really dump  :-[ , I declared the new Sound object in the wrong scope, and now it is working fine and this how I make it:

#include <SFML/Audio.hpp>
void Echo();
//That what I missed
sf::SoundBuffer buffer;
sf::Sound sound;
sf::Sound echo;

int main ()
{
    buffer.loadFromFile("simple.wav");
    sound.setBuffer(buffer);
    echo.setBuffer(buffer);
    sound.play();
    sf::sleep(sf::seconds(8)); //just for start the echo after 8 sec
    Echo();
    while(sound.Playing);
    return 0;
}

void Echo(){
    echo.setPlayingOffset(sound.getPlayingOffset());
    sf::sleep(sf::seconds(0.2f));
    echo.play();
}
 

3
Audio / Applying echo effect using sfml audio
« on: February 17, 2014, 01:47:53 am »
hi  :)

i'm pretty new with sfml but it was really simple to use, but now I'm having some problems with sfml-audio, I'm trying to apply echo effect on sound by replaying the same sf::SoundBuffer in another sf::Sound object with small latency but I still fail in every way i try.

is it possible to make an echo using sfml ?or there is another way ?

Thanks.

Pages: [1]
anything