alsa的snd_pcm_readi()函数和snd_pcm_writei()
来源:互联网 发布:网络刷手是可靠吗 编辑:程序博客网 时间:2024/06/07 19:12
snd_pcm_readi ()
snd_pcm_sframes_t snd_pcm_readi ( snd_pcm_t *pcm,
void* buffer,
snd_pcm_uframes_t size
)
Read interleaved frames from a PCM.
Parameters:
- pcmPCM handle bufferframes containing buffer sizeframes to be read
- Returns:
- a positive number of frames actually read otherwise a negative error code
- Return values:
- -EBADFDPCM is not in the right state (SND_PCM_STATE_PREPARED orSND_PCM_STATE_RUNNING) -EPIPEan overrun occurred -ESTRPIPEa suspend event occurred (stream is suspended and waiting for an application recovery)
If the blocking behaviour was selected and it is running, then routine waits until all requested frames are filled. The returned number of frames can be less only if a signal or underrun occurred.
If the non-blocking behaviour is selected, then routine doesn't wait at all.
/////////////////////////////////////////////////////////////
snd_pcm_writei()
snd_pcm_sframes_t snd_pcm_writei (snd_pcm_t *pcm,
const void *buffer,
snd_pcm_uframes_tsize
)
Write interleaved frames to a PCM.
- Parameters:
- pcmPCM handle bufferframes containing buffer sizeframes to be written
- Returns:
- a positive number of frames actually written otherwise a negative error code
- Return values:
- -EBADFDPCM is not in the right state (SND_PCM_STATE_PREPARED orSND_PCM_STATE_RUNNING) -EPIPEan underrun occurred -ESTRPIPEa suspend event occurred (stream is suspended and waiting for an application recovery)
If the non-blocking behaviour is selected, then routine doesn't wait at all.
我对ALSA录音和播音的理解,当我们通过麦克风讲话的声音搜集到声卡里之后,内存从声卡里读取声音数据的过程就是录音过程,即snd_pcm_readi()函数的执行,把内存中的声音数据写入到声卡的过程就是播音过程,即snd_pcm_writei()函数的执行。
http://blog.csdn.net/woxiaozhi/article/details/6284099
- alsa的snd_pcm_readi()函数和snd_pcm_writei()
- alsa的snd_pcm_readi()函数和snd_pcm_writei()
- alsa的 snd_pcm_readi 和 snd_pcm_writei
- alsa的 snd_pcm_readi 和 snd_pcm_writei
- alsa的 snd_pcm_readi 和 snd_pcm_writei
- alsa的 snd_pcm_readi 和 snd_pcm_writei
- alsa-lib和alsa-util在TQ2416上的移植
- alsa驱动的函数调用过程
- 理解和使用Alsa的配置文件
- 理解和使用Alsa的配置文件
- 理解和使用Alsa的配置文件
- 理解和使用ALSA的配置文件
- 理解和使用Alsa的配置文件
- 理解和使用Alsa的配置文件
- 理解和使用Alsa的配置文件
- ALSA的WAV播放和录音程序
- 理解和使用Alsa的配置文件
- 【ALSA】关于alsa的总结
- java中源代码和lib库中有包名和类名都相同的类
- 下拉框spinner:获取选中值的几种方法 .
- Android应用在不同版本间兼容性处理 .
- Maven仓库管理-Nexus
- 利用折半查找,寻找元素在数组中合适恰当的位置
- alsa的snd_pcm_readi()函数和snd_pcm_writei()
- linux io分析
- 简易画图板的升级版本1.2
- 他人的近期目标
- ArrayList对动态数组进行排序数组由Scanner后台动态接收数组元素
- 选择排序实例
- 犀牛书第3章 数据类型和值(下篇):传值与传址
- Android Thread.UncaughtExceptionHandler捕获 .
- 冒泡排序实例