'How to manage audio in and out from and to file of Huawei GSM modems?
I've got a Huawei E173 USB dongle connected to a Raspberry PI. I'm trying to use the device to make and receive calls.
For my purpose, it is needed (i) to save audio of the call to file and (ii) to send audio to the telephony call from an input file.
As far as I understood (I can't find any official guide), the E173 dongle sets up three new devices (please correct me if I'm wrong):
/dev/ttyUSB0
for commands/dev/ttyUSB1
for voice data/dev/ttyUSB2
for notifications
In order to enable phone calls, I run the following commands: AT+CLIP=1
, AT+CRC=1
, AT+CNMI=1,2
on /dev/ttyUSB0
.
Also, if I run AT^CVOICE?
I get ^CVOICE:0,8000,16,20
.
Finally, when I make/receive calls, I run AT^DDSETEX=2
on /dev/ttyUSB0
to enable audio forward to the /dev/ttyUSB1
port.
At this point, I'm stuck.
I know there are other similar posts trying to redirect microphone input and speakers output to the dongle, but my aim is to save the conversation to file (during a call, I tried to run cat /dev/ttyUSB1 > filename.raw
, but the file can't be opened with standard software, hence, how can I convert it?) and, simultaneously, to send voice from file (which format? I tried to send back the filename.raw
to /dev/ttyUSB1
with cat filename.raw > /dev/ttyUSB1
, but the entire system gets freezed).
How can I save audio to file and send back audio from file?
I found some resources on the Internet trying to explain, for similar devices, that audio has to be sent in mono, in digital frequency of 8000 Hz, and digitalized to 16 bit. By looking at the result of the AT^CVOICE?
command, such parameters should be applied also in my case.
Also, the same resource tells that "audio data should be fed to the modem audio port in batches of 320 bytes every 0.02 seconds".
I've tried to apply even such approach, with no luck.
Solution 1:[1]
I'm also stuck trying to get audio from a huawei E153.. if I use the 'Huawei Mobile Partner' software. I can use the pc sound to hear and talk during a voice call, so I know it is possible for sure. I read that someone could manage to get the sound form a Huawei Mobile modem in ubuntu, take a look here:
https://askubuntu.com/questions/464661/way-to-call-through-huawei-modem-in-14-04-e303
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Omar Castillo |