Closed hendrihendri closed 1 year ago
Hi! It expects PCM with 2 byte signed integers.
The batches of samples provided via the write_samples and read_samples callbacks (included in AudioBus class during the init callback) have the following example format:
F1C1 F1C2
F2C1 F2C2
...
FnC1 FnC2
Each of these FxCy is a signed 2-byte short with the value for frame x and channel y (this is of course for a stereo sequence with two channels. A mono sequence would only include the values for FxC1 and a dolby with 6 channels would include samples from FxC1 to FxC6). So a frame includes a sample for each channel. And for the read_samples/write_samples callbacks we need to provide the complete number of frames, which for example, for a 10ms batch of 48Khz audio stream, would be 480, independently of the number of channels.
Please, let me know if I wasn't too clear on the explanation.
Thanks, @sergioturgil-vonage! @hendrihendri, any other issues, please let us know. Thanks!
Hi, I am trying to implement custom audio renderer/capturer using
IAudioDevice
andSetCustomAudioDevice
API. I noticed that the interface were only asked to provideSamplingRate
andChannels
as the renderer/capturer settings viaGetAudioCapturerSettings
/GetAudioRendererSettings
. What is the expected wave format and bits per sample that theAudioBus
is expecting (e.g. PCM, IEEE)?Thanks!