获取原始语音系统图
使用matlab生成一个测试用的单频信号,1KHz,1Vrms
clc
clear all;
close all;f = 1000; % 定义信号频率
t = [0:0.00005:10];
signal = 1*sin(2*pi*f*t);
audiowrite('testSignal.wav',signal,16000);sound(signal,20000);plot(t,signal)
生成文件效果如下
将文件通过adb推送到安卓系统中
C:\adb>adb push C:\temp\testSignal.wav storage/emulated/0/MyVoiceForder/Record
C:\temp\testSignal.wav: 1 file pushed. 4.6 MB/s (400046 bytes in 0.083s)
C:\adb>
进入目标文件夹确认文件已经推送成功
C:\adb>adb shell
root@avl7420:/ # cd storage/emulated/0/MyVoiceForder/Record
root@avl7420:/storage/emulated/0/MyVoiceForder/Record # ls
testSignal.wav
root@avl7420:/storage/emulated/0/MyVoiceForder/Record #
在安卓系统中,测试文件是否可以正常播放。
按照科大讯飞《XFM-EVB-01_XFM10X2调试音频操作说明》内容,将讯飞的核心板固件烧成输出原始数据,并测试分析结果数据。(其实我自己根据操作说明什么玩意儿都没搞出来)
以下是我自己乱搞的方法,不知对错,权当参考。
1】连接科大讯飞板与pc,通过adb进入科大讯飞板系统
C:\adb>adb shell
* daemon not running. starting it now at tcp:5037 *
* daemon started successfully *BusyBox v1.22.1 (2017-05-16 11:15:11 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands._____ _ __ _
|_ _||_| ___ _ _ | | |_| ___ _ _ _ _| | _ | || | | |__ | || || | ||_'_|| | | || | ||^_^| |_____||_||_|_||___||_,_||_| |_||_|_||_|_| Based on OpenWrt 14.07!----------------------------------------------Tina Linux V1 (Barrier Breaker, unknown)----------------------------------------------
2】进入mnt文件夹,查看是否start.sh文件以及cae_app_save文件存在,捎带着可以看看固件的版本
root@sun8i:/# cd mnt
root@sun8i:/mnt# ls
cae_app libIvw60.so record.pcm start.sh
cae_app_save libcae.so recordtest.pcm version
ivw_resource.jet lingxi.pcm sdcard vibrationtest.pcm
root@sun8i:/mnt# cat version
name:1.0.2.1009_os&2.0.5.1022_libcae&1.0.7.1016_cae_app&1.0.7.1016_cae_app_save
ver:XFM10621_1.0.8.1017
date:2018/01/09
3】查看进程,并关闭./cae_app,方法同《操作说明》,下面是已经关闭了的结果
root&#64;sun8i:/mnt# psPID USER VSZ STAT COMMAND1 root 1056 S /sbin/procd2 root 0 SW [kthreadd]3 root 0 SW [ksoftirqd/0]5 root 0 SW [kworker/u:0]6 root 0 SW [migration/0]7 root 0 SW [migration/1]8 root 0 SW [kworker/1:0]9 root 0 SW [ksoftirqd/1]10 root 0 SW [migration/2]12 root 0 SW [ksoftirqd/2]13 root 0 SW [migration/3]14 root 0 SW [kworker/3:0]15 root 0 SW [ksoftirqd/3]16 root 0 SW<[khelper]17 root 0 SW [kdevtmpfs]18 root 0 SW<[suspend]19 root 0 SW<[sync_system_wor]20 root 0 SW [kworker/0:1]21 root 0 SW [kworker/2:1]23 root 0 SW [kworker/1:1]24 root 0 SW [sync_supers]25 root 0 SW [bdi-default]26 root 0 SW<[kblockd]27 root 0 SW [sytem]28 root 0 SW [khubd]29 root 0 SW<[cfg80211]30 root 0 SW [kdsm]31 root 0 SW<[rpciod]32 root 0 SW [kswapd0]33 root 0 SW [fsnotify_mark]34 root 0 SW<[nfsiod]35 root 0 SW<[cifsiod]36 root 0 SW<[crypto]52 root 0 SW [kapmd]53 root 0 SW [nand]54 root 0 SW [nftld]55 root 0 SW [nand_rcd]63 root 0 SW<[f_mtp]64 root 0 SW [file-storage]65 root 0 SW [cfinteractive]66 root 0 SW [auto_cpu_hotplu]67 root 0 SW<[binder]68 root 0 SW [kworker/u:2]69 root 0 SW<[switch_resume]70 root 0 SW<[codec_init]72 root 0 SW<[krfcommd]73 root 0 SW<[deferwq]74 root 0 SW<[devfreq_wq]75 root 0 SW<[ext4-dio-unwrit]241 root 672 S /sbin/ubusd242 root 592 S /sbin/askfirst ttyS0 /bin/ash --login243 root 592 S /sbin/askfirst tty1 /bin/ash --login411 root 1080 S /sbin/netifd429 root 880 S /usr/sbin/odhcpd457 root 1136 S /usr/sbin/telnetd -F -l /bin/login.sh476 root 1140 S /usr/sbin/ntpd -n -p 0.openwrt.pool.ntp.org -p 1.ope489 root 9112 S /bin/adbd -D619 root 0 SW [kworker/3:2]633 root 0 SW [kworker/2:2]635 root 0 SW [kworker/0:2]794 root 1140 S {adb_shell} /bin/sh /bin/adb_shell -796 root 1144 S /bin/sh803 root 0 SW [flush-93:0]804 root 0 SW [kworker/0:0]805 root 1140 R ps
4】运行./start.sh开始录音&#xff0c;ctrl &#43; c 结束录音
root&#64;sun8i:/mnt# ./start.sh
: No such file or directory
get ver IFger version -1uart_init(13874,eec0,1cb7c)[in]
uart_init()0[out]
CAENew(ivw_resource.jet, ff20, feb4)[in]
ivw_resource.jet : nResSize &#61; 1101272pEngineFace->IvwSetInstParam IVW_PARAM_CM_LEVEL successpEngineFace->IvwSetInstParam IVW_PARAM_CM_LEVEL successpEngineFace->IvwSetInstParam IVW_PARAM_CM_LEVEL successCAENew [out] 0, b6383008
open device : default
frames is 256
audio play return 0
open device : plughw:1,0
frames is 256
audio play return 0
pthread_create nr_ctrl_looper ret &#61; 0
record_start record :e87040
nr_ctrl_looper enter
frames&#61;1536,record->buff_size&#61;12288
RecordThread record:e87040
record start out 0
QueueReadThread record :e87040
sched_setaffinity return &#61; -1
first data get 7
first data get 8
^C
5】此时可以查看mnt中新生成的录音文件record.pcm&#xff0c;将这个文件pull到PC上
root&#64;sun8i:/mnt# ls
cae_app libIvw60.so record.pcm start.sh
cae_app_save libcae.so recordtest.pcm version
ivw_resource.jet lingxi.pcm sdcard vibrationtest.pcm
root&#64;sun8i:/mnt# exit
C:\adb>adb pull mnt/record.pcm C:\temp
mnt/record.pcm: 1 file pulled. 8.1 MB/s (9936896 bytes in 1.172s)
6】通过《操作说明》中的步骤切割文件&#xff0c;或者是导入到audacity中查看文件&#xff0c;根据数据的结果推测第一路跟第五路数据应该是回放参考&#xff0c;剩余五路是MIC输入&#xff0c;还有一路是第八路不知道是做什么的&#xff0c;会不会是唤醒的那一路呢&#xff1f;为什么只有五路呢&#xff1f;暂时没找到答案&#xff08;然而这样的操作是错误的&#xff0c;得到的只能是个错误的结果&#xff09;。
6】应该是将文件切割后&#xff0c;然后将切割出来的pcm文件一个一个导入到audacity中&#xff0c;否则顺序就是乱的&#xff0c;正确的显示结果应该是下面这个样子的&#xff0c;我这个结果是因为硬件连接有问题MIC3跟MIC4的信号串了&#xff0c;里面还有问题就要查一下MIC1是否连接上了。
对应官方给出的通道与MIC对应顺序
7】我固件烧的是10621_1017这一版的&#xff0c;烧录时候注意要先按住 load 键&#xff0c;再连接数据线