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

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

问题描述

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

以下是我使用的 AT 命令:

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

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

 modem.executeCommand('AT+FSCREATE=t​​ts2.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参数,因此您可以拥有读取的数据.但是写操作没有这样的东西,所以我很困惑.

解决方案

我认为 post 你提到的是对的.在 应用说明,第 13 页,还有一个例子.

因此,在您的程序中,假设您有一个大小为 5030 字节的本地文件 ~/tts0.amr,(tts2.amr是modem里面的文件名)

  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天全站免登陆