Skip to content

Custom data source format #901

Answered by mackron
SmartFoxServer asked this question in Q&A
Discussion options

You must be logged in to vote

It's because you've configured your device to use ma_format_s16, but ma_engine_read_pcm_frames() only returns samples in ma_format_f32 format. An individual data source can be s16 in which case the engine will convert it automatically, but the backing device must be ma_format_f32, or you need to manually convert the data returned from ma_engine_read_pcm_frames() from f32 to s16.

If you change deviceConfig.playback.format = ma_format_s16; to deviceConfig.playback.format = ma_format_f32; it should work fine. You can leave stream_ds as ma_format_s16.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by SmartFoxServer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants