Converting from G.729 to regular ADPCM

Help for Audacity on Windows.
Forum rules
ImageThis forum is for Audacity on Windows.
Please state which version of Windows you are using,
and the exact three-section version number of Audacity from "Help menu > About Audacity".


Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade at https://www.audacityteam.org/download/.
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Converting from G.729 to regular ADPCM

Post by Gale Andrews » Fri Jun 02, 2017 6:27 pm

steve wrote:
Gale Andrews wrote:I am unclear whether Steve's attempt at importing "80088.wav" into Audacity on Linux is actually comprehensible
It would be comprehensible if I understood the language.
It's only like poor telephone quality, but it is clearly a man and woman talking in a non-English language.
That sounds like what I hear from the online-converted PCM file.
john3voltas wrote: I was simply using ffmpeg from the CLI with a "ffmpeg -f g729 -i source.g729 dest.wav"
That is where you are going wrong. That makes FFmpeg think it's a native G.729 file not wrapped in WAV. The output sounds exactly like the output I get from running your 80088.wav through my G.729 decoder, then importing its PCM raw output into Audacity using Import Raw Data.

Use this command instead in FFmpeg 3.x.x:

Code: Select all

ffmpeg -i source.g729 dest.wav

Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

john3voltas
Posts: 18
Joined: Wed May 31, 2017 2:28 pm
Operating System: Windows 7

Re: Converting from G.729 to regular ADPCM

Post by john3voltas » Sat Jun 03, 2017 2:42 am

Gale Andrews wrote:Use this command instead in FFmpeg 3.x.x:

Code: Select all

ffmpeg -i source.g729 dest.wav
Now I'll be damned. That works!
I still can't quite understand how but it actually works!
It's not exactly how I wanted it to work (just load the file into audacity and be fine with it) but having it run on ffmpeg prior to editing under audacity is perfectly acceptable, given the singularities of these files.
Now...why does it work this way? I am basically telling ffmpeg that it's a WAV file but in fact it is a G.729 file.
Here's the output of ffmpeg 3.3.1:

Code: Select all

C:\Users\rcorreia\Downloads>d:\users\rcorreia\downloads\ffmpeg-3.3.1-win64-share
d\bin\ffmpeg.exe -i 80088.wav 80088_2.wav
ffmpeg version 3.3.1 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.3.0 (GCC)
  configuration: --disable-static --enable-shared --enable-gpl --enable-version3
 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --
enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0
r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-lib
bs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --ena
ble-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb -
-enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-lib
opus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --en
able-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc -
-enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-
libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --en
able-lzma --enable-zlib
  libavutil      55. 58.100 / 55. 58.100
  libavcodec     57. 89.100 / 57. 89.100
  libavformat    57. 71.100 / 57. 71.100
  libavdevice    57.  6.100 / 57.  6.100
  libavfilter     6. 82.100 /  6. 82.100
  libswscale      4.  6.100 /  4.  6.100
  libswresample   2.  7.100 /  2.  7.100
  libpostproc    54.  5.100 / 54.  5.100
Guessed Channel Layout for Input Stream #0.0 : mono
Input #0, wav, from '80088.wav':
  Duration: 00:11:10.08, bitrate: 8 kb/s
    Stream #0:0: Audio: g729 ([131][0][0][0] / 0x0083), 8000 Hz, mono, s16, 8 kb
/s
Stream mapping:
  Stream #0:0 -> #0:0 (g729 (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, wav, to '80088_2.wav':
  Metadata:
    ISFT            : Lavf57.71.100
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 8000 Hz, mono, s16, 1
28 kb/s
    Metadata:
      encoder         : Lavc57.89.100 pcm_s16le
size=   10470kB time=00:11:10.08 bitrate= 128.0kbits/s speed= 305x
video:0kB audio:10470kB subtitle:0kB other streams:0kB global headers:0kB muxing
 overhead: 0.000728%

C:\Users\rcorreia\Downloads>
Now, ffmpeg clearly states that this is a G.729 stream.
My ffmpeg doesn't say it is compliant with G.729, so how come this works?
TIA
Cheers

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Converting from G.729 to regular ADPCM

Post by Gale Andrews » Sat Jun 03, 2017 1:27 pm

"-i 80088.wav" just gives FFmpeg the input file name. It does not tell FFmpeg anything about what audio format is in the WAV. Later FFmpeg can figure that out for G.729 wrapped in WAV. Older FFmpeg can't, even though it supports decoding of proper G.729 files.

As we have said, you can run Audacity on Linux in a virtual machine. If you get for example Ubuntu 16.04 you may not have to compile Audacity - the Ubuntu-supplied version of Audacity may have a late enough version of FFmpeg built in so that it recognises your G.729 embedded in a WAV file.

Alternatively you can put your files in a directory and run FFmpeg as a batch command.

Can we close this topic now? Steve and I have spent hours supporting you on this. Would you like to make a donation to Audacity http://www.audacityteam.org/donate/?


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

steve
Site Admin
Posts: 80752
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Converting from G.729 to regular ADPCM

Post by steve » Sat Jun 03, 2017 3:40 pm

Just to confirm, on Windows 10, FFmpeg 2.2.2 cannot read the file. The most recent nightly, ffmpeg-20170601, from the command line, can convert the file.
The command I used, from the location of ffmpeg.exe

Code: Select all

./ffmpeg.exe -i "input file" "output file"
Where "input file" and "output file" were fully qualified file names and "output file" had a file extension ".wav"
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply