Dump libasound 音频数据

QNX有如下两种方法dump pcm数据,可以录声卡之前的数据

1,

QNX自带的pcm_logger工具

工具位置:

qnx\qnx-sdp\target\qnx7\aarch64le\usr\bin\pcm_logger

//打开pcm dump

pcm_logger -l1

//关闭 pcm dump

pcm_logger -l0

数据保存到/dev/shmem

2,
This is how it has been tested:

-- To enable logging use the PLAYBACK_LOGGING and CAPTURE_LOGGING environment variables.
-- To log PCM data before it runs through the libasound conversion plugins assign a value of 'unprocessed' to the environment variable.
-- To log PCM data after it has run through the libasound conversion plugins assign a value of 'processed' to the environment variables.

Examples:
PLAYBACK_LOGGING=processed wave /myfile.wav
PLAYBACK_LOGGING=unprocessed wave /myfile.wav
CAPTURE_LOGGING=processed waverec -t5 /tmp/myfile.wav
CAPTURE_LOGGING=unprocessed waverec -t5 /tmp/myfile.wav


-- Logged PCM data files will be created under /dev/shmem with the following filename convention: direction_pid_processed/unprocessed_YYYYMMDD-HHmmssUTC.wav

Example: /dev/shmem/playback_1928374_processed_20120613-093433UTC.wav

Note that the length fields in the wave header are filled in when the client calls snd_pcm_close(), so if the client terminates without calling close those lengths will not be filled in and the logged file may not be playable by some media applications. In other words, please wait for the playback/capture to complete and do not terminate in between. Otherwise the PCM data captured file may not be playable on some media players.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值