summaryrefslogtreecommitdiff
path: root/servers/audio
diff options
context:
space:
mode:
Diffstat (limited to 'servers/audio')
-rw-r--r--servers/audio/SCsub2
-rw-r--r--servers/audio/audio_rb_resampler.cpp13
-rw-r--r--servers/audio/audio_stream.h2
-rw-r--r--servers/audio/effects/SCsub2
-rw-r--r--servers/audio/effects/audio_effect_record.h5
-rw-r--r--servers/audio/reverb_sw.cpp22
-rw-r--r--servers/audio/reverb_sw.h2
7 files changed, 23 insertions, 25 deletions
diff --git a/servers/audio/SCsub b/servers/audio/SCsub
index afaffcfe93..3c18c18043 100644
--- a/servers/audio/SCsub
+++ b/servers/audio/SCsub
@@ -4,6 +4,4 @@ Import('env')
env.add_source_files(env.servers_sources, "*.cpp")
-Export('env')
-
SConscript("effects/SCsub")
diff --git a/servers/audio/audio_rb_resampler.cpp b/servers/audio/audio_rb_resampler.cpp
index 3ae897c299..84a87de2e2 100644
--- a/servers/audio/audio_rb_resampler.cpp
+++ b/servers/audio/audio_rb_resampler.cpp
@@ -82,19 +82,28 @@ uint32_t AudioRBResampler::_resample(AudioFrame *p_dest, int p_todo, int32_t p_i
// For now, channels higher than stereo are almost ignored
if (C == 4) {
+ // FIXME: v2 and v3 are not being used (thus were commented out to prevent
+ // compilation warnings, but they should likely be uncommented *and* used).
+ // See also C == 6 with similar issues.
float v0 = rb[(pos << 2) + 0];
float v1 = rb[(pos << 2) + 1];
+ /*
float v2 = rb[(pos << 2) + 2];
float v3 = rb[(pos << 2) + 3];
+ */
float v0n = rb[(pos_next << 2) + 0];
float v1n = rb[(pos_next << 2) + 1];
+ /*
float v2n = rb[(pos_next << 2) + 2];
float v3n = rb[(pos_next << 2) + 3];
+ */
v0 += (v0n - v0) * frac;
v1 += (v1n - v1) * frac;
+ /*
v2 += (v2n - v2) * frac;
v3 += (v3n - v3) * frac;
+ */
p_dest[i] = AudioFrame(v0, v1);
}
@@ -104,6 +113,7 @@ uint32_t AudioRBResampler::_resample(AudioFrame *p_dest, int p_todo, int32_t p_i
// should be done as for C == 2 (C == 4 also has some unused assignments).
float v0 = rb[(pos * 6) + 0];
float v1 = rb[(pos * 6) + 1];
+ /*
float v2 = rb[(pos * 6) + 2];
float v3 = rb[(pos * 6) + 3];
float v4 = rb[(pos * 6) + 4];
@@ -114,6 +124,7 @@ uint32_t AudioRBResampler::_resample(AudioFrame *p_dest, int p_todo, int32_t p_i
float v3n = rb[(pos_next * 6) + 3];
float v4n = rb[(pos_next * 6) + 4];
float v5n = rb[(pos_next * 6) + 5];
+ */
p_dest[i] = AudioFrame(v0, v1);
}
@@ -153,7 +164,7 @@ bool AudioRBResampler::mix(AudioFrame *p_dest, int p_frames) {
}
// Fill zeros (silence) for the rest of frames
- for (uint32_t i = target_todo; i < p_frames; i++) {
+ for (int i = target_todo; i < p_frames; i++) {
p_dest[i] = AudioFrame(0, 0);
}
}
diff --git a/servers/audio/audio_stream.h b/servers/audio/audio_stream.h
index c7763890fc..2740f86d55 100644
--- a/servers/audio/audio_stream.h
+++ b/servers/audio/audio_stream.h
@@ -122,7 +122,7 @@ class AudioStreamPlaybackMicrophone : public AudioStreamPlaybackResampled {
GDCLASS(AudioStreamPlaybackMicrophone, AudioStreamPlayback)
friend class AudioStreamMicrophone;
- const int MICROPHONE_PLAYBACK_DELAY = 256;
+ static const int MICROPHONE_PLAYBACK_DELAY = 256;
bool active;
unsigned int input_ofs;
diff --git a/servers/audio/effects/SCsub b/servers/audio/effects/SCsub
index ccc76e823f..d730144861 100644
--- a/servers/audio/effects/SCsub
+++ b/servers/audio/effects/SCsub
@@ -3,5 +3,3 @@
Import('env')
env.add_source_files(env.servers_sources, "*.cpp")
-
-Export('env')
diff --git a/servers/audio/effects/audio_effect_record.h b/servers/audio/effects/audio_effect_record.h
index 5f5c7802b4..edf8565c06 100644
--- a/servers/audio/effects/audio_effect_record.h
+++ b/servers/audio/effects/audio_effect_record.h
@@ -49,7 +49,7 @@ class AudioEffectRecordInstance : public AudioEffectInstance {
bool is_recording;
Thread *io_thread;
- bool thread_active = false;
+ bool thread_active;
Vector<AudioFrame> ring_buffer;
Vector<float> recording_data;
@@ -67,6 +67,9 @@ public:
void init();
virtual void process(const AudioFrame *p_src_frames, AudioFrame *p_dst_frames, int p_frame_count);
virtual bool process_silence();
+
+ AudioEffectRecordInstance() :
+ thread_active(false) {}
};
class AudioEffectRecord : public AudioEffect {
diff --git a/servers/audio/reverb_sw.cpp b/servers/audio/reverb_sw.cpp
index 13742d5db5..d078da38b4 100644
--- a/servers/audio/reverb_sw.cpp
+++ b/servers/audio/reverb_sw.cpp
@@ -29,33 +29,21 @@
/*************************************************************************/
#include "reverb_sw.h"
+
#include "core/print_string.h"
-#include "stdlib.h"
+
+#include <stdlib.h>
+
#define SETMIN(x, y) (x) = MIN((x), (y))
+
#define rangeloop(c, min, max) \
for ((c) = (min); (c) < (max); (c)++)
#define ABSDIFF(x, y) \
(((x) < (y)) ? ((y) - (x)) : ((x) - (y)))
-#ifdef bleh_MSC_VER
-
-#if _MSC_VER >= 1400
-_FORCE_INLINE_ int32_tMULSHIFT_S32(
- int32_t Factor1,
- int32_t Factor2,
- uint8_t Bits) {
-
- return __ll_rshift(
- __emul(Factor1, Factor2),
- Bits);
-}
-#endif
-
-#else
#define MULSHIFT_S32(Factor1, Factor2, Bits) \
((int)(((int64_t)(Factor1) * (Factor2)) >> (Bits)))
-#endif
struct ReverbParamsSW {
unsigned int BufferSize; // Required buffer size
diff --git a/servers/audio/reverb_sw.h b/servers/audio/reverb_sw.h
index 26b3fa5166..01977d1f61 100644
--- a/servers/audio/reverb_sw.h
+++ b/servers/audio/reverb_sw.h
@@ -34,7 +34,7 @@
#include "core/os/memory.h"
#include "core/typedefs.h"
-class ReverbParamsSW;
+struct ReverbParamsSW;
class ReverbSW {
public: