]> git.sesse.net Git - nageru/blobdiff - nageru/audio_mixer.h
Support delaying audio sources selectively.
[nageru] / nageru / audio_mixer.h
index 1cf4da349e71d4cc28d7c2ad5b4689f56fd7586d..de6ff5414032a7f414d82b7195156c2921400a7c 100644 (file)
@@ -37,6 +37,10 @@ namespace bmusb {
 struct AudioFormat;
 }  // namespace bmusb
 
+// Convert the given audio from {16,24,32}-bit M-channel to 32-bit N-channel PCM.
+// Assumes little-endian and chunky, signed PCM throughout.
+std::vector<int32_t> convert_audio_to_fixed32(const uint8_t *data, unsigned num_samples, bmusb::AudioFormat audio_format, unsigned num_destination_channels);
+
 enum EQBand {
        EQ_BAND_BASS = 0,
        EQ_BAND_MID,
@@ -320,6 +324,10 @@ private:
                // Which channels we consider interesting (ie., are part of some input_mapping).
                std::set<unsigned> interesting_channels;
                bool silenced = false;
+
+               // Positive means the audio is delayed, negative means we try to have it earlier
+               // (although we can't time-travel!). Stored together with the input mapping.
+               double extra_delay_ms = 0.0;
        };
 
        const AudioDevice *find_audio_device(DeviceSpec device_spec) const