Custom data source format #901
-
|
We are trying to implement a custom data source for playback using ma_engine.
How can we use a format different from ma_format_f32? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
It's because you've configured your device to use If you change |
Beta Was this translation helpful? Give feedback.
It's because you've configured your device to use
ma_format_s16, butma_engine_read_pcm_frames()only returns samples inma_format_f32format. An individual data source can be s16 in which case the engine will convert it automatically, but the backing device must bema_format_f32, or you need to manually convert the data returned fromma_engine_read_pcm_frames()from f32 to s16.If you change
deviceConfig.playback.format = ma_format_s16;todeviceConfig.playback.format = ma_format_f32;it should work fine. You can leavestream_dsasma_format_s16.