请教一个OHAudio音频播放1CH-8KHZ-16BIT中参数配置问题?

OH_AudioStreamBuilder_SetFrameSizeInCallback(builder, 320); // 设置320,实际是640

设置320,实际回调640,设置640,实际回调1280。


/*
* Set the data frame size for each callback, use this function if the application requires a specific number
* of frames for processing.
* The frame size should be at least the size device process at one time, and less than half the internal
* buffer capacity.
*
* @since 11
*
* @param builder Reference provided by OH_AudioStreamBuilder_Create()
* @param frameSize The data frame size for each callback.
* @return {@link #AUDIOSTREAM_SUCCESS} or an undesired error.
*/
OH_AudioStream_Result OH_AudioStreamBuilder_SetFrameSizeInCallback(OH_AudioStreamBuilder* builder,
int32_t frameSize);

frameSize是采样数还是字节数?

阅读 559
1 个回答

是字节数,一般都会返回字节数直接对返回数组进行处理

logo
HarmonyOS
子站问答
访问
宣传栏