LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Inquiry:How to convert .wav sound files to .gsm format with sox utility (https://www.linuxquestions.org/questions/linux-newbie-8/inquiry-how-to-convert-wav-sound-files-to-gsm-format-with-sox-utility-751687/)

hadimotamedi 09-01-2009 01:27 AM

Inquiry:How to convert .wav sound files to .gsm format with sox utility
 
Dear All
Can you please do me favor and let me know how can I convert .wav sound files to .gsm format as I have an application for this usage ? Please be informed that I have made use of the sox utility for this purpose , as the followings , but it didn't get through :
#sox FR00003.wav -r 8000 -c 1 FR0003.gsm resample -ql
Can you please let me know what is the problem in my case ?
Regards
H.Motamedi

colucix 09-01-2009 03:42 AM

Did you get an error message using the command above or is it just the quality of the output file not good? What if you try without any option?
Code:

sox FR00003.wav FR0003.gsm
Please, can you post the output of the following command (to see the sampling rate of the original wave file)?
Code:

file FR00003.wav

hadimotamedi 09-01-2009 03:51 AM

Quote:

Originally Posted by colucix (Post 3665041)
Did you get an error message using the command above or is it just the quality of the output file not good? What if you try without any option?
Code:

sox FR00003.wav FR0003.gsm
Please, can you post the output of the following command (to see the sampling rate of the original wave file)?
Code:

file FR00003.wav

Thank you for your reply . Please find below the reuested info :
"[root@statsvr zaptel-1.4.12.1]# file /usr/local/src/FR00003.wav
/usr/local/src/FR00003.wav: RIFF (little-endian) data, WAVE audio, ITU G.711 A-law, mono 8000 Hz"

colucix 09-01-2009 04:01 AM

Quote:

Originally Posted by hadimotamedi (Post 3665046)
Thank you for your reply . Please find below the reuested info :
"[root@statsvr zaptel-1.4.12.1]# file /usr/local/src/FR00003.wav
/usr/local/src/FR00003.wav: RIFF (little-endian) data, WAVE audio, ITU G.711 A-law, mono 8000 Hz"

The wave file already is mono and 8kHZ, so that you don't need the -c1 and -r8000 options respectively. Have you tried without any option? What is the quality of the output file? Another question: which Linux OS are you running the sox command on?

hadimotamedi 09-01-2009 04:16 AM

Quote:

Originally Posted by colucix (Post 3665051)
The wave file already is mono and 8kHZ, so that you don't need the -c1 and -r8000 options respectively. Have you tried without any option? What is the quality of the output file? Another question: which Linux OS are you running the sox command on?

Thank you very much for your reply . Please be informed that I run the command without any option and it seems that it gets through . The sizes of the *.gsm converted files are as :
sizes : 4752 bytes & 5841 bytes
Can you please confirm if they are correctly converted ?
Please be informed that my client Linux OS is of CentOS 5 .

colucix 09-01-2009 04:27 AM

Quote:

Originally Posted by hadimotamedi (Post 3665060)
Thank you very much for your reply . Please be informed that I run the command without any option and it seems that it gets through . The sizes of the *.gsm converted files are as :
sizes : 4752 bytes & 5841 bytes
Can you please confirm if they are correctly converted ?

Well... it's difficult to tell just knowing the size of the output file. If the sox command didn't throw any error message, most likely the conversion succeeded. You can test the quality of the result using the play command provided by the sox package:
Code:

play FR0003.gsm

clinoob 04-17-2015 06:34 PM

Sox wav to gsm issue
 
Machine: virtualbox vm

Installation: uname -a: Linux ubuntu2 3.16.0-23-generic #31-Ubuntu SMP Tue Oct 21 18:00:35 UTC 2014 i686 i686 i686 GNU/Linux

sox --version:
sox: SoX v14.4.1

file type: (asterisk call recording)

file 1428510900.3473-out.wav
1428510900.3473-out.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 8000 Hz
soxi 1428510900.3473-out.wav

Input File : '1428510900.3473-out.wav'
Channels : 1
Sample Rate : 8000
Precision : 16-bit
Sample Encoding: 16-bit Signed Integer PCM

Trying to convert to gsm.

Tried every single command available on google to convert to gsm:

412 sox 1428510900.3473-out.wav -r 8000 1428510900.3473-out.gsm resample -ql
414 sox 1428510900.3473-out.wav 1428510900.3473-out.gsm
418 sox 1428510900.3473-out.wav -r 8000 -c 1 1428510900.3473-out.gsm -q
424 sox 1428510900.3473-out.wav -r 8000 -c 1 1428510900.3473-out.gsm -q
432 sox -r 8000 1428510900.3473-out.wav 1428510900.3473-out.gsm
441 sox -r 8000 1428510900.3473-out.wav 1428510900.3473-out.gsm
445 sox 1428510900.3473-out.wav 1428510900.3473-out.gsm
447 sox 1428510900.3473-out.wav ../1428510900.3473-out.gsm
457 sox 1428510900.3473-out.wav -r 8000 -c1 1428510900.3473-out.gsm lowpass 4000 compand 0.02,0.05 -60,-60,-30,-10,-20,-8,-5,-8,-2,-8 -8 -7 0.05
466 sox 1428510900.3473-out.wav ../1428510900.3473-out.gsm
505 sox 1428510900.3473-out.wav 1428510900.3473-out.gsm
508 sox 1428510900.3473-out.wav -r 8000 -c1 1428510900.3473-out.gsm lowpass 4000 compand 0.02,0.05 -60,-60,-30,-10,-20,-8,-5,-8,-2,-8 -8 -7 0.05
512 soxi 1428510900.3473-out.gsm
514 sox 1428510900.3473-out.wav -r 8000 -c1 1428510900.3473-out.gsm lowpass 4000 compand 0.02,0.05 -60,-60,-30,-10,-20,-8,-5,-8,-2,-8 -8 -7 0.05
515 soxi 1428510900.3473-out.gsm
521 sox -V 1428510900.3473-out.wav 1428510900.3473-out.gsm
525 sox -V 1428510900.3473-out.wav 1428510900.3473-out.gsm
574 rm 1428510900.3473-out.gsm
576 sox 1428510900.3473-out.wav 1428510900.3473-out.gsm
580 sox 1428510900.3473-out.wav -t wavpcm -e signed-integer 1428510900.3473-out.gsm
584 soxi 1428510900.3473-out.gsm
587 file 1428510900.3473-out.gsm
590 sox 1428510900.3473-out.wav 1428510900.3473-out.gsm resample
598 sox -t wav 1428510900.3473-out.wav -r 8000 -c1 -t gsm 1428510900.3473-out.gsm
601 sox -t wav 1428510900.3473-out.wav -r 8000 -c1 -t gsm 1428510900.3473-out.gsm resample
603 sox -t wav 1428510900.3473-out.wav -r 8000 -c1 -t gsm 1428510900.3473-out.gsm resample -ql
604 sox -t wav 1428510900.3473-out.wav -r 8000 -c1 -t gsm 1428510900.3473-out.gsm resample -l
605 sox -t wav 1428510900.3473-out.wav -r 8000 -c1 -t gsm 1428510900.3473-out.gsm resample -q
607 sox -t pcm 1428510900.3473-out.wav -r 8000 -c1 -t gsm 1428510900.3473-out.gsm
608 sox -t wavpcm 1428510900.3473-out.wav -r 8000 -c1 -t gsm 1428510900.3473-out.gsm
612 sox -t wavpcm 1428510900.3473-out.wav -t gsm 1428510900.3473-out.gsm
614 sox -t wavpcm -e signed 1428510900.3473-out.wav -t gsm 1428510900.3473-out.gsm
649 sox 1428510900.3473-out.wav 1428510900.3473-out.gsm


Output is a 0 byte gsm file or errors out because options are deprecated.

Any help to convert the above file type to gsm would be greatly appreciated.

Thanks.


All times are GMT -5. The time now is 11:45 AM.