X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=nageru%2Faudio_mixer.h;h=14e7e85d098065aabc5cd39d70ed5b31a8713041;hb=efeea7571ab45c6a846208f0554153de549d1711;hp=e435b46280c0d28e549c2fb36ae3df40f810f640;hpb=b44bf7cfce6a5aaffbcd1e37df39068a163438ad;p=nageru diff --git a/nageru/audio_mixer.h b/nageru/audio_mixer.h index e435b46..14e7e85 100644 --- a/nageru/audio_mixer.h +++ b/nageru/audio_mixer.h @@ -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 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, @@ -54,9 +58,9 @@ public: // the lock wasn't successfully taken; if so, you should simply try again. // (This is to avoid a deadlock where a card hangs on the mutex in add_audio() // while we are trying to shut it down from another thread that also holds - // the mutex.) frame_length is in TIMEBASE units. - bool add_audio(DeviceSpec device_spec, const uint8_t *data, unsigned num_samples, bmusb::AudioFormat audio_format, int64_t frame_length, std::chrono::steady_clock::time_point frame_time); - bool add_silence(DeviceSpec device_spec, unsigned samples_per_frame, unsigned num_frames, int64_t frame_length); + // the mutex.) + bool add_audio(DeviceSpec device_spec, const uint8_t *data, unsigned num_samples, bmusb::AudioFormat audio_format, std::chrono::steady_clock::time_point frame_time); + bool add_silence(DeviceSpec device_spec, unsigned samples_per_frame, unsigned num_frames); // If a given device is offline for whatever reason and cannot deliver audio // (by means of add_audio() or add_silence()), you can call put it in silence mode,