Converting from G.729 to regular ADPCM

Greetings.
I’m using Audicity 2.1.3 on a laptop running Windows 7.
Also, I have downloaded the FFmpeg 2.2.2 library and configured Audacity to use it.
I’d like to convert some G.729 files to ADPCM and do some editing on them but apparently Audacity is unable to load the audio file.
Am I doing something wrong?
Is this even possible using Audacity? Taking into account that Audacity is using FFmpeg libraries in order to load the audio files, I would expect this to be possible.
Cheers

15:36:28: Audacity 2.1.3
15:36:28: Trying to load FFmpeg libraries...
15:36:28: mLibAVFormatPath ('D:\users\blablah\downloads\ffmpeg_audacity\avformat-55.dll') is not empty. Loading from it.
15:36:28: Looking up PATH environment variable...
15:36:28: PATH = 'C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Program Files\Broadcom\Broadcom 802.11;;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Common Files\Autodesk Shared\;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\10.0\DLLShared\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\WinSCP\;C:\Program Files (x86)\Avaya\Playback\'
15:36:28: Checking that 'D:\users\blablah\downloads\ffmpeg_audacity' is in PATH...
15:36:28: Warning: FFmpeg directory 'D:\users\blablah\downloads\ffmpeg_audacity' is not in PATH.
15:36:28: Temporarily prepending ';D:\users\blablah\downloads\ffmpeg_audacity' to PATH...
15:36:28: Checking for monolithic avformat from 'D:\users\blablah\downloads\ffmpeg_audacity\avformat-55.dll'.
15:36:28: Error: Couldn't find symbol 'avutil_version' in a dynamic library (error 127: the specified procedure could not be found.)
15:36:28: Error: Couldn't find symbol 'avcodec_version' in a dynamic library (error 127: the specified procedure could not be found.)
15:36:28: avformat not monolithic
15:36:28: Loading avutil from 'avutil-52.dll'.
15:36:28: Loading avcodec from 'avcodec-55.dll'.
15:36:28: Loading avformat from 'D:\users\blablah\downloads\ffmpeg_audacity\avformat-55.dll'.
15:36:28: Returning PATH to previous setting...
15:36:28: Actual avutil path D:\users\blablah\downloads\ffmpeg_audacity\avutil-52.dll
15:36:28: Actual avcodec path D:\users\blablah\downloads\ffmpeg_audacity\avcodec-55.dll
15:36:28: Actual avformat path D:\users\blablah\downloads\ffmpeg_audacity\avformat-55.dll
15:36:28: Importing symbols...
15:36:28: All symbols loaded successfully. Initializing the library.
15:36:28: Retrieving FFmpeg library version numbers:
15:36:28:    AVCodec version 0x373466 - 55.52.102 (built against 0x373466 - 55.52.102)
15:36:28:    AVFormat version 0x372164 - 55.33.100 (built against 0x372164 - 55.33.100)
15:36:28:    AVUtil version 0x344264 - 52.66.100 (built against 0x344264 - 52.66.100)
15:36:28: FFmpeg libraries loaded successfully.
15:36:38: File name is C:\Users\blablah\Downloads\80088.wav
15:36:38: Mime type is *
15:36:38: Opening with libav
15:36:38: Error: FFmpeg: avformat_find_stream_info() failed for file C:\Users\blablah\Downloads\80088.wav
15:36:38: Opening with libsndfile
15:36:38: Opening with liboggvorbis
15:36:38: Opening with libflac
15:36:38: Opening with libmad
15:36:38: Open(C:\Users\blablah\Downloads\80088.wav) succeeded
15:36:38: Opening with lof
15:36:38: Error: Importer::Import: Opening failed.

Are you sure that they are valid g729 files? How do you know?

Errrr…I’m not 100% sure they’re valid. In fact, all I know is that Audacity couldn’t do anything with them.
Then I loaded them on a website called http://audio.online-convert.com/convert-to-wav and it worked perfectly.
Apart from that, MediaInfo says it’s G.729.

Complete name                            : C:\Users\blablah\Downloads\80088.wav
Format                                   : Wave
File size                                : 654 KiB
Duration                                 : 11 min 10 s
Overall bit rate                         : 8 001 b/s

Audio
Format                                   : G.729a
Codec ID                                 : 83
Codec ID/Hint                            : AT&T
Duration                                 : 11 min 10 s
Bit rate                                 : 8 000 b/s
Channel(s)                               : 1 channel
Sampling rate                            : 8 000 Hz
Bit depth                                : 1 bit
Stream size                              : 654 KiB (100%)

Do you have a small sample file that we could test?
I tried a g729 on my machine and Audacity imported it fine, but I’m on Linux (so a different FFmpeg build) and I’m not 100% sure that it was g729a.
I would have expected g729 import to work.

Hi steve,
First of all, thank you very much for your support.
You see, this audio file is a corporate call recording and the company says I am not allowed to disclose this to the general public.
But since you’ve been so helpful this far, I think you might not mind if I gave you the recording as long as you agree not to publish it here/elsewhere.
Is that ok with you? I will start uploading the recording to a google drive and will have a link ready in case you agree.
Thanks in advance.
Cheers

Yes I can agree to that.

FFmpeg 2.2.2 on Windows can import G.729 files, but john3voltas has G.729 wrapped in a WAV container, which FFmpeg might not like. I don’t think there is a Microsoft standard for doing that as there is with for example G.723.

A real G.729 file would have .g729 or some non-WAV extension and MediaInfo would not be able to give information about it. I have an official G.729 decoder and encoder so I can verify that FFmpeg does import a “real” G.729 file.

According to http://www.cisco.com/c/en/us/support/docs/voice/h323/14069-codec-complexity.html#g_723:

G.729 is a high complexity algorithm, and G.729A (also known as G.729 Annex-A) is a medium complexity variant of G.729 with slightly lower voice quality. All platforms that support G.729 also support G.729A.

I don’t really “expect” FFmpeg will be able to open G.729 wrapped in WAV, but Steve can try it.


Gale

Hmmm, how can I PM you a link to the google drive file? I can’t find a PM button around here…

Try it now. Do you see a PM button under Steve’s name? But as per my previous post you don’t have standard G.729 files and I somewhat doubt FFmpeg will open G.729 wrapped in WAV.


Gale

That file opens fine on my machine.
I can’t test on Windows right now, but will probably be able to do so tomorrow, so I’ll get back to you when I’ve tried that.

Hmmm, how intriguing, because in my case (as you can see on my 1st post Audacity log) it simply won’t open.
Can you actually hear people talking in a foreign language? Because ffmpeg would error out on this file but still would output a converted file that had noone talking in a perceivable language.

Now, the truth is, I am working on a PortableApps.com latest version of Audacity because my company IT staff doesn’t allow us to install software without their consent. Still waiting for them to approve, I thought I could have a go at a portable version. Might it have anything to do with this?
Cheers

Thanks Gale.

Well, in fact ffmpeg did open G.729A wrapped in a WAV but the output of it’s conversion was corrupted. So maybe it thought it was opening the G.729 fine while it actually wasn’t, right?
BTW, how would I unwrap the G.729 out of the WAV?
Cheers

I would guess using the “PortableApps” version of Audacity does not make any difference compared to official Audacity, but we don’t know because “PortableApps Audacity” is not our project and we don’t provide support for it on this Forum.

If your IT policy allows running applications extracted from ZIP files, you could try official Audacity https://www.fosshub.com/Audacity.html/audacity-win-2.1.3.zip.

That isn’t exactly what you said the first time. You said “unable to load”.

You might be able to do it with FFmpeg at the command-line (-acodec copy) if it can sufficiently understand the file to accept that command, but the problem in any case is that FFmpeg 2.2.2 can’t encode G.729. So if you intend to edit these files in Audacity, format conversion will be needed anyway.

I guess Steve has a later version of FFmpeg which may or may not support G.729 in WAV.


Gale

As you can see, there’s some distortion, but yes I can hear a conversation.
firsttrack004.png

Yes, I’ve got FFmpeg 2.8.11

According to https://en.wikipedia.org/wiki/G.729#Licensing G.729 is recently free of patents or royalty-free, and https://ffmpeg.org/general.html#File-Formats claims that FFmpeg could encode G.729 “BIT” (whatever that means) but not G.729 raw.

So that does raise the “possibility” that you could download the latest FFmpeg static library from http://ffmpeg.zeranoe.com/builds/ and point Audacity’s Command-line encoder to the FFmpeg.exe in the download to export as G.729. I have not tried it.

For imports, you are still tied to FFmpeg 2.2.2.


Gale

Yep, our IT policy just states that we cannot install software without previous consent, for which we would need to login with a higher privileged user. In the case of a zip file, I am not installing anything, so I’m not breaking any rules and don’t need higher privileges to do so.
So I just downloaded and extracted audacity 2.1.3 from the zip, set it up to English and to use ffmpeg 2.2.2.
Tried to open the G.729 but I get the same error. So I guess it’s got nothing to do with the portable version.

Wait, I made i unclear with that statement. On the 1st post when we said that I was “unable to load” I meant using Audacity. So, I had Audacity setup to use ffmpeg and it was unable to load the G.729.
On the other hand, my latest sentence says that “in fact ffmpeg did open” whereas in this case I was not using Audacity, I was simply using ffmpeg from the CLI with a “ffmpeg -f g729 -i source.g729 dest.wav”. It opened the file, actually did a conversion but the output cannot be cataloged as human speech.
Sorry for having mislead you here.

But can I set Audacity to a later ffmpeg library? I tried to point Audacity to ffmpeg 3.3.1 and I couldn’t…

Which FFmpeg version is that? Did you get the latest from http://ffmpeg.zeranoe.com/builds/?

What does this code typed into FFmpeg CLI return?

ffmpeg -encoders | grep -i "g\."

In any case I just noticed your aim is to convert to ADPCM so the objective of FFmepg writing G.729 is just if it could remove the WAV packaging which seems to be the stumbling block importing with older FFmpeg.

As I said in my post before this, you can point Audacity to other FFmpeg versions (EXE file) for exporting, but for importing you are tied to FFmpeg 2.2.2 on Windows.

Did the file you converted to PCM online sound OK? If so that is one solution. With what application are you playing these files now, so you know what they sound like?

I don’t mind if you also want to PM your sample file to me, under the same terms, but I can’t guarantee I’ll be able to do any more than Steve can when he gets to Windows.


Gale

I tried both with this one http://ffmpeg.zeranoe.com/builds/win32/shared/ffmpeg-3.3.1-win32-shared.zip
and also this one too http://ffmpeg.zeranoe.com/builds/win64/shared/ffmpeg-3.3.1-win64-shared.zip

That’s a bash script. As said I’m on Windows, but since I always have cygwin installed I was able to run it.
Here’s the result with a zeranoe 3.3.1 for win32:

$ ./ffmpeg -encoders | grep -i "g\."
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-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-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 --enable-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
 A..... g722                 G.722 ADPCM (codec adpcm_g722)
 A..... g726                 G.726 ADPCM (codec adpcm_g726)
 A..... g723_1               G.723.1
 A..... pcm_alaw             PCM A-law / G.711 A-law
 A..... pcm_mulaw            PCM mu-law / G.711 mu-law

And this is the result for the ffmpeg 2.2.2 that’s linked on Audacity’s help page:

$ ./ffmpeg -encoders | grep -i "g\."
ffmpeg version 2.2.2 Copyright (c) 2000-2014 the FFmpeg developers
  built on May 22 2014 19:56:44 with gcc 4.8.2 (GCC)
  configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-decklink --enable-zlib
  libavutil      52. 66.100 / 52. 66.100
  libavcodec     55. 52.102 / 55. 52.102
  libavformat    55. 33.100 / 55. 33.100
  libavdevice    55. 10.100 / 55. 10.100
  libavfilter     4.  2.100 /  4.  2.100
  libswscale      2.  5.102 /  2.  5.102
  libswresample   0. 18.100 /  0. 18.100
  libpostproc    52.  3.100 / 52.  3.100
 A..... g722                 G.722 ADPCM (codec adpcm_g722)
 A..... g726                 G.726 ADPCM (codec adpcm_g726)
 A..... g723_1               G.723.1
 A..... pcm_alaw             PCM A-law / G.711 A-law
 A..... pcm_mulaw            PCM mu-law / G.711 mu-law



Exactly, my aim is to convert and edit some parts with Audacity.

Oh…Ok. That’s a real pity. Even because with the latest security issues, I’d really like to stick to maintained and up-to-date versions of software installed on my PC. I mean, 2.2.2 is really old and I checked FFmpeg’s changelog and you can really see some pretty nasty vulnerabilities in there, even in not that old releases.

Yea, the file I got from that website is just fine. The only real issue is a privacy one. I’m not a security freak but this is company’s calls and there’s nothing keeping that website from hearing these phone calls or simply posting them on their website. :astonished:

To be honest, I using windows media player because that’s what comes with this PC install.
Tried VLC (from PortableApps.com too) with these G.729 wrapped in WAV and it works fine too.
I guess this is working because for professional reasons I had to install some software that comes bundled with some G.729 decoder, probably the call recording software. Otherwise I think neither WMP not VLC would play it. Unless they work because it’s wrapped in WAV?

Sure, will do just that in a few minutes.

Thank you both for your support.
Cheers

I can run that command in cmd.exe on Windows. It’s probably because I have the GNU tools for Windows.

According to the FFmpeg documentation, G.729 “BIT” is supported natively via libav without need of building external libraries into FFmpeg. So, that result for FFmpeg 3.3.1 seems confusing.

If I run:

ffmpeg -decoders | grep -i "g\."

in FFmpeg 2.2.2 it shows that G.729 is supported thus:

 A....D g722                 G.722 ADPCM (codec adpcm_g722)
 A....D g726                 G.726 ADPCM (codec adpcm_g726)
 A....D g726le               G.726 ADPCM little-endian (codec adpcm_g726le)
 A....D g723_1               G.723.1
 A....D g729                 G.729
 A....D pcm_alaw             PCM A-law / G.711 A-law
 A....D pcm_mulaw            PCM mu-law / G.711 mu-law

It does not say G.729a but I am not yet convinced the G.729a variant is the problem. The G.729 annexes are “supposed” to be interoperable with G.729.

You can use later FFmpeg for Audacity import if you compile Audacity on Linux. You could do that on a virtual machine.

I am unclear whether Steve’s attempt at importing “80088.wav” into Audacity on Linux is actually comprehensible (that is, if you can hear it is a non-English language). The PCM output of the online encoder is comprehensible.

The G.729 decoder I have http://www.codecpro.com/LicenseG729.php wants G.729 not wrapped in WAV. It does convert your file to raw 16-bit PCM data which I can import raw into Audacity, but it sounds incomprehensible when played back.

The wrapping in WAV is very strange. They make it a dual mono file (that is, nominally “stereo”, but left and right are identical).

You can play the files in WMP and the other players because of the professional decoder you installed. On my machine I just get an error about missing ACM codec when I play 80088.wav.

Are you sure your call software has no conversion utility out of G.729 in WAV? That would be the best solution. I have not found any other Windows applications that can convert your 80088.wav on the computer. Most converters will rely on FFmpeg.

Mencoder has a second non-FFmpeg G.729 decoder but when I play your 80088.wav in mplayer it says “Requested audio codec family [g729dmo] (afm=dmo) not available. Enable it at compilation.”

If you compile mplayer with that support you will have to go through ridiculous hoops pretending to mencoder that your audio file is a video file so I don’t think that is a way forward.

Let us know if you find anything.


Gale

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.