SIM800C GSM AT COMMAND如何以编程方式上传.amr音频文件 [英] SIM800C GSM AT COMMAND How to upload .amr audio file programmatically

查看:69
本文介绍了SIM800C GSM AT COMMAND如何以编程方式上传.amr音频文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我拼命尝试将一些音频文件上传到SIM800C的内部存储器,到目前为止,这是我已经能够做到的,但是上传的文件似乎无效,并且不会播放任何声音.但是使用 AT + FSLS = C:\\ ,我可以看到文件在那里.

这是我正在使用的AT命令:

  AT + FSCREATE = tts2.amrAT + FSWRITE = tts2.amr,0,5030,10AT + FSLS = C:\\ 

我制作了一个nodeJS程序来完成这项工作,但是我对适用于Linux的任何其他语言都持开放态度.

  modem.executeCommand('AT + FSCREATE = tts2.amr',(result)=> {log.debug(result);});modem.executeCommand('AT + FSWRITE = tts2.amr,0,5030,10',(result)=> {log.debug(result);});modem.executeCommand('AT + FSLS = C:\\',(result)=> {log.debug(result);}); 

如果您想知道我是否已经看过这个

这里他们提到了用于读取操作的 data 参数,因此您可以读取数据.但是对于写操作,没有这样的事情,所以我很困惑.

解决方案

我认为应用说明,第13页,还有一个示例.

因此,在您的程序中,假设您有一个本地文件〜/tts0.amr,大小为5030个字节,(tts2.amr是调制解调器内部的文件名)

  1. 将文件〜/tts0.amr 读取到内存变量中,例如 amr_data
  2. 发送 AT + FSWRITE = tts2.amr,0,5030,10 到调制解调器,等待> 而不是 OK ;
  3. amr_data 写入调制解调器,就像上面的步骤一样;
  4. 如果大小匹配,调制解调器将立即返回 OK .

I am desperatly trying to upload some audio file to the internal memory of a SIM800C, so far this is what I've been able to do, but the uploaded file seems void, and doesnt play any sound. But with AT+FSLS=C:\\ I can see the file is there.

Here are the AT commands I am using:

AT+FSCREATE=tts2.amr 
AT+FSWRITE=tts2.amr,0,5030,10 
AT+FSLS=C:\\

I made a nodeJS program to do the job, but I am openned to any other language that works on linux.

  modem.executeCommand('AT+FSCREATE=tts2.amr',(result) => { log.debug(result); });
        modem.executeCommand('AT+FSWRITE=tts2.amr,0,5030,10',(result) => { log.debug(result); });
        modem.executeCommand('AT+FSLS=C:\\',(result) => { log.debug(result); });

In case you were wondering I've already seen this post which helped neither the OP nor me.

I've also seen this post but it doesnt suit to me, because it uses a tool (AmrFile Download.exe) to do the job manually, I need to do it programmatically. I thought if that tool could do it so can I, there must be a way, but have not yet found...

What really bugs me is how is the file located from my computer, and its content read before even loading it. I've kept the audio file tts2.amr in the same directory than the nodejs script since the AT commands shows me no way to specify a path for the source file it only considers the destination, so I've no clue how to do it, and I feel it doesnt work like that.

UPDATE:


From the docs:

Here they have mentionned a data parameter for reading operation, so you can have the read data. But for write operation there is no such thing, so I'm pretty much confused.

解决方案

I think the post you mentioned is right. In App note, page 13, there is also an example.

So in your program, suppose you have a local file ~/tts0.amr with size 5030 bytes, (tts2.amr is the file name inside modem)

  1. read file ~/tts0.amr to memeory variable, like amr_data for example;
  2. send AT+FSWRITE=tts2.amr,0,5030,10 to modem, waiting for > instead of OK;
  3. write amr_data to modem, just like the step above;
  4. if the size matching, modem shall return OK now.

这篇关于SIM800C GSM AT COMMAND如何以编程方式上传.amr音频文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆