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.


Topics - ClaudioVC

Pages: [1]
1
Audio / Attaching SoundBuffers
« on: February 17, 2017, 06:33:15 am »
Hi all,
Well, like the title says,is there any way to attach 2 soundbuffer? like:

Quote
sf::SoundBuffer buffer1;
sf::SoundBuffer buffer2;
sf::SoundBuffer buffer3;
----then i record 2 times for buffer1 and buffer2 and now i want to attach them-----
buffer3 = buffer1 + buffer2;

or other way, is there any way to attach 2 sounds?

Thanks all.

2
Audio / Delay Between Record and Play
« on: February 17, 2017, 01:45:53 am »
Hi all!,
I was writing a little about it in General Section, but i think the main theme of the topic is not the same.

Well, i'm working in a Software for a Loop Pedal. I'm starting with the code, so i'm just trying to do one loop works. So, the idea is record the loop and when i stop record then play the sound recorded. i made this code:

Quote
                if(Event.key.code == sf::Keyboard::R){
                    recorder.start();
                    std::cout<<"> Recording Loop"<<std::endl;
                }
                else if(Event.key.code == sf::Keyboard::S){
                    recorder.stop();
                    clock.restart();
                    std::cout<<"> Playing Loop"<<std::endl;
                    buffer = recorder.getBuffer();
                    sound.setBuffer(buffer);
                    std::cout<<"> Delay Between Record and Play: "<<clock.getElapsedTime().asMicroseconds()<<std::endl;
                    sound.play();
                }

But i need those both actions start at the same time, i mean RECORD.STOP and SOUND.PLAY start together, because later i need to record another sound while im listening the first one and it doesnt have to exist delay. I print the delay between Record.stop and sound.play as MicroSeconds and i got this:



So i have 1570 microseconds between record.stop  and sound play. What can i do to get 0 second of Delay (or close)?.

I think if i put sound.play straight after record.stop it would works, but it couldnt be possible cause there are buffer = recorder.getbuffer() and sound.setbuffer() functions :/. Is there any way to avoid it?


Thanks to all!.

3
General / Using Threads with Sound Functions
« on: February 16, 2017, 06:46:17 am »
Hi all,
Well, im working in a software to a Loop Pedal, so i need to play sounds (recorded in the moment) at the same time that im recording other sounds. example:

Quote
> blah blah
> sound.play();
> recorder.start();
> blah blah

and i need those function start at the same time. i was thinking use this but it didnt work :

Quote
> blah blah
> sf::Thread thread(sound.play());
> thread.launch();
> recorder.start();
> blah blah

Im new using the SFML library, and i really dont know how use SFML threads and the tutorials just talk about how use it with c++ void function, but nothing about sfml functions (or i didnt realize) so any help will help.
Sorry for any english mistake.

I have Windows 10, and im working with CodeForce.

Thanks!

Pages: [1]