mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 16:13:28 +02:00
perform a test reverb effect
This commit is contained in:
parent
188abd8d44
commit
bb201dfd8e
1 changed files with 16 additions and 0 deletions
|
@ -22,6 +22,8 @@
|
|||
#include <AgentTypes.h>
|
||||
#include <SharedUtil.h>
|
||||
#include <StdDev.h>
|
||||
#include <Stk.h>
|
||||
#include <FreeVerb.h>
|
||||
|
||||
#include "AudioRingBuffer.h"
|
||||
#include "PacketHeaders.h"
|
||||
|
@ -104,6 +106,13 @@ int main(int argc, const char* argv[]) {
|
|||
|
||||
int16_t clientSamples[BUFFER_LENGTH_SAMPLES_PER_CHANNEL * 2] = {};
|
||||
|
||||
// setup STK for the reverb effect
|
||||
stk::FreeVerb freeVerb;
|
||||
freeVerb.setDamping(0.5f);
|
||||
freeVerb.setRoomSize(0.5f);
|
||||
freeVerb.setDamping(0.5f);
|
||||
freeVerb.setWidth(0.5f);
|
||||
|
||||
gettimeofday(&startTime, NULL);
|
||||
|
||||
while (true) {
|
||||
|
@ -255,6 +264,13 @@ int main(int argc, const char* argv[]) {
|
|||
}
|
||||
}
|
||||
|
||||
// apply the FreeVerb to the clientSamples array
|
||||
for (int s = 0; s < BUFFER_LENGTH_SAMPLES_PER_CHANNEL; s++) {
|
||||
clientSamples[s] = freeVerb.tick(clientSamples[s],
|
||||
clientSamples[s + BUFFER_LENGTH_SAMPLES_PER_CHANNEL]);
|
||||
clientSamples[s + BUFFER_LENGTH_SAMPLES_PER_CHANNEL] = freeVerb.lastOut(1);
|
||||
}
|
||||
|
||||
memcpy(clientPacket + 1, clientSamples, sizeof(clientSamples));
|
||||
agentList->getAgentSocket()->send(agent->getPublicSocket(), clientPacket, BUFFER_LENGTH_BYTES + 1);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue