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.
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐


所有评论(0)