exporting wav to ulaw

This section is now closed.

Audacity 1.3.x is now obsolete. Please use the current Audacity 2.1.x version.

The final version of Audacity for Windows 98/ME is the legacy 2.0.0 version.

Re: exporting wav to ulaw

Permanent link to this post Posted by Gale Andrews » Tue Aug 10, 2010 12:28 am

Thanks. Could you do one last test - does the attached produced by libsndfile itself play in your app?



Gale
Attachments
ulaw libsndfile.wav
U-Law file produced by libsndfile itself
(631.03 KiB) Downloaded 289 times
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
Gale Andrews
Quality Assurance
 
Posts: 26089
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: exporting wav to ulaw

Permanent link to this post Posted by jlr » Fri Sep 10, 2010 3:30 pm

I guess I need to read a little closer. I kept checking for your reply and did not see it; I expected posts to keep scrolling on the same page; just noticed page 2. No the last file you sent will not play in the app.
jlr
 
Posts: 7
Joined: Wed Jul 21, 2010 3:11 pm
Operating System: Please select

Re: exporting wav to ulaw

Permanent link to this post Posted by Martijn » Tue Dec 28, 2010 2:27 pm

If this happens to be the same application I am using, which I shall refer to only as VC, then the problem is probably that it needs to be in 8 bit which audacity doesn't seem to support. When I use audacity for sound files, I use a second pass with windows sound recorder to convert to the proper format.
Martijn
 
Posts: 1
Joined: Tue Dec 28, 2010 2:24 pm
Operating System: Please select

Re: exporting wav to ulaw

Permanent link to this post Posted by Remy Lebeau » Thu Jan 20, 2011 4:32 am

Sorry about the thread resurrect, but I'm also having this issue, and am wondering if it was resolved?

I'm having pretty much exactly the same problem. The autoattendant recordings for our phone system need to be in that CCIT u-law format. When I export into u-law direct from audacity (trying it with audacity 1.3.12), the system won't accept the file (it just times out when trying to import it). If I export from audacity as a normal wav, then convert it to u-law using sound recorder, the system accepts it fine, however the quality is much worse than the audacity exported version...

Comparing the two different "u-law" files (one exported from audacity (1) , and the other run through sound recorder (2)) I noticed the following. If I right click on (2), and go to "summary" it then shows me the audio info (bit rate, compression, etc). However if I do the same thing for (1), it does not show me any of this info, which would appear to suggest that windows can't see it properly either.

Help ?
Remy Lebeau
 
Posts: 2
Joined: Thu Jan 20, 2011 4:26 am
Operating System: Please select

Re: exporting wav to ulaw

Permanent link to this post Posted by steve » Fri Jan 21, 2011 3:26 am

u-law is not a format: http://en.wikipedia.org/wiki/%CE%9C-law_algorithm

To create a file that is compatible with your phone system you need to create a file that is the correct format. It needs to be the correct sample rate, sample format, with the correct header. Just being "u-law" is not enough - that's only one part of the description.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 45943
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: exporting wav to ulaw

Permanent link to this post Posted by Gale Andrews » Fri Jan 21, 2011 2:18 pm

Remy Lebeau wrote:Sorry about the thread resurrect, but I'm also having this issue, and am wondering if it was resolved?

I'm having pretty much exactly the same problem. The autoattendant recordings for our phone system need to be in that CCIT u-law format. When I export into u-law direct from audacity (trying it with audacity 1.3.12), the system won't accept the file (it just times out when trying to import it). If I export from audacity as a normal wav, then convert it to u-law using sound recorder, the system accepts it fine, however the quality is much worse than the audacity exported version...

Comparing the two different "u-law" files (one exported from audacity (1) , and the other run through sound recorder (2)) I noticed the following. If I right click on (2), and go to "summary" it then shows me the audio info (bit rate, compression, etc). However if I do the same thing for (1), it does not show me any of this info, which would appear to suggest that windows can't see it properly either.

If the Audacity file sounds better that possibly suggests you did not change the Audacity project rate bottom left of the screen from the default 44100 Hz. Most telephony applications will want the CCITT u-Law file to be 64 kbps (8000 Hz and 8-bit). You can get the 8-bit by choosing "Other uncompressed files" in the Audacity export window, clicking "Options", then choosing (for example) "WAV (Microsoft)" for "Header" and "U-Law" for "Encoding" (this latter defines 8-bit depth).

You could also choose "RAW (header-less)" for "Header". It's not uncommon for U-Law files to be actually raw headerless data, and they often carry the .ULAW extension in that case. In that very limited sense, they could be regarded as a "format" in common usage. Have any of the complainants seen if their apps accept such a file exported from Audacity? I've attached an example of this.

Unfortunately, Audacity relies on a third party library (libsndfile) to encode U-Law. The Audacity U-Law files always play on Windows in my experience and they *do* use the correct codec ID (7). The issue is I think with the size of the "fmt" chunk being smaller in the Audacity-produced files than the Sound Recorder files, and possibly also with the WAV headers in the Audacity files being "Wave format PCM" rather than "Wave format extended". The only tool that shows me this "PCM/Extended" difference is dbPowerAmp, and I'm not sure of its relevance or whether the difference simply arises from the difference in the size of the "fmt" chunk. Just to clarify this is nothing to do with "Wave Format Extensible" (WAVEX) headers which are a separate header choice in the Audacity "Options" for "Other Uncompressed Files".

I think this libsndfile FAQ is relevant - i.e. rightly or wrongly, libsndfile chooses to use a smaller fmt chunk than the Microsoft specification because some old players (even old versions of Windows Media Player) had trouble with the larger fmt chunk. Perhaps it may be time to question if the decision made there is still the correct one?

Also attached is a 64 kbps U-Law file I encoded with SOX at the command line using -e u-law -r 8000 options. DBPowerAmp reports the header as "Wave format Extended". I would expect it to play in your app - do you want to try it? The point is that (probably) Audacity 1.3.12 could use SOX for exporting a WAV with U-Law encoding, by choosing (external program) when you export. I don't think using FFmpeg to export the files from Audacity will help - the fmt chunk is the same size as that in the libsndfile files.

Otherwise, I think I've gone as far as I can with investigations and possible workarounds, unless someone with more technical knowledge than I have can contribute - it would be a question of making a case to libsndfile.



Gale
Attachments
ulaw8000_sox.wav
Wav file with U-Law encoding produced by Sox
(23.49 KiB) Downloaded 273 times
aud.ulaw
raw file with U-Law data encoded by Audacity
(23.44 KiB) Downloaded 279 times
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
Gale Andrews
Quality Assurance
 
Posts: 26089
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: exporting wav to ulaw

Permanent link to this post Posted by Remy Lebeau » Sun Jan 23, 2011 11:28 pm

steve wrote:u-law is not a format: http://en.wikipedia.org/wiki/%CE%9C-law_algorithm

To create a file that is compatible with your phone system you need to create a file that is the correct format. It needs to be the correct sample rate, sample format, with the correct header. Just being "u-law" is not enough - that's only one part of the description.


Sorry I used the incorrect terminology. I'm aware that u-law isn't a format, rather a compression algorithm (or a companding algorithm if you want to be really precise). I assumed that saying I had the exact same problem as the OP would suffice...
jlr wrote:Requirements for wav files are CCITT u-law, mono 8bit, 8khz.


Gale Andrews wrote:If the Audacity file sounds better that possibly suggests you did not change the Audacity project rate bottom left of the screen from the default 44100 Hz. Most telephony applications will want the CCITT u-Law file to be 64 kbps (8000 Hz and 8-bit). You can get the 8-bit by choosing "Other uncompressed files" in the Audacity export window, clicking "Options", then choosing (for example) "WAV (Microsoft)" for "Header" and "U-Law" for "Encoding" (this latter defines 8-bit depth).


Thanks for the suggestions. As far as I can tell, I'm doing exactly the same thing in both audacity and sound recorder - set the file to 8khz, and then save it using u-law (as a wav). I did exactly what you suggested for the audacity export. I've attached three files for you to see the difference, the original (at 44khz), and then the 2 versions, one from audacity and one from sound recorder. You spot the difference :P

Gale Andrews wrote:You could also choose "RAW (header-less)" for "Header". It's not uncommon for U-Law files to be actually raw headerless data, and they often carry the .ULAW extension in that case. In that very limited sense, they could be regarded as a "format" in common usage. Have any of the complainants seen if their apps accept such a file exported from Audacity? I've attached an example of this.


The example attached didn't work.


Gale Andrews wrote:Unfortunately, Audacity relies on a third party library (libsndfile) to encode U-Law. The Audacity U-Law files always play on Windows in my experience and they *do* use the correct codec ID (7). The issue is I think with the size of the "fmt" chunk being smaller in the Audacity-produced files than the Sound Recorder files, and possibly also with the WAV headers in the Audacity files being "Wave format PCM" rather than "Wave format extended". The only tool that shows me this "PCM/Extended" difference is dbPowerAmp, and I'm not sure of its relevance or whether the difference simply arises from the difference in the size of the "fmt" chunk. Just to clarify this is nothing to do with "Wave Format Extensible" (WAVEX) headers which are a separate header choice in the Audacity "Options" for "Other U

I think this libsndfile FAQ is relevant - i.e. rightly or wrongly, libsndfile chooses to use a smaller fmt chunk than the Microsoft specification because some old players (even old versions of Windows Media Player) had trouble with the larger fmt chunk. Perhaps it may be time to question if the decision made there is still the correct one?

Also attached is a 64 kbps U-Law file I encoded with SOX at the command line using -e u-law -r 8000 options. DBPowerAmp reports the header as "Wave format Extended". I would expect it to play in your app - do you want to try it? The point is that (probably) Audacity 1.3.12 could use SOX for exporting a WAV with U-Law encoding, by choosing (external program) when you export. I don't think using FFmpeg to export the files from Audacity will help - the fmt chunk is the same size as that in the libsndfile files.

Otherwise, I think I've gone as far as I can with investigations and possible workarounds, unless someone with more technical knowledge than I have can contribute - it would be a question of making a case to libsndfile.

Gale


Thanks for the amazing help!

The second file you attached did indeed work (the one encoded using SOX). It would seem that your diagnosis about libsndfile is accurate, and that it would require a change there for this to export correctly. I'll give the SOX method a go, however I may just end up doing a 2 step process (export from Audacity at 8khz, and then use sound recorder to do the u-law compression). Who would we need to talk to about changing the way libsndfile works?

Thanks again for your insight and advice!
Attachments
FollowPrompts.wav
Original @ 44khz
(241.04 KiB) Downloaded 218 times
FollowPrompts_Audacity.wav
Audacity version, 8khz u-law
(21.92 KiB) Downloaded 238 times
FollowPrompts_soundrecorder.wav
Sound Recorder version, 8khz u-law
(21.91 KiB) Downloaded 232 times
Remy Lebeau
 
Posts: 2
Joined: Thu Jan 20, 2011 4:26 am
Operating System: Please select

Re: exporting wav to ulaw

Permanent link to this post Posted by steve » Sun Jan 23, 2011 11:48 pm

Remy Lebeau wrote:Who would we need to talk to about changing the way libsndfile works?

See here: http://www.mega-nerd.com/libsndfile/bugs.html
I'd guess that you would need to subscribe to the libsndfile-devel mailing list.
Ensure that you refer to this FAQ http://www.mega-nerd.com/libsndfile/FAQ.html#Q011 as part of your case for changes to how libsndfile handles u-law.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 45943
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: exporting wav to ulaw

Permanent link to this post Posted by 41142 » Wed Jan 26, 2011 1:28 am

All,

I am having a very similar but different issue.

I have been using winamp 2.8 to convert to CCITT 8k, 8bit mono format for a voicemail system. Due to that version of winamp being very old - and newer versions not correctly performing the conversion we are in need of another tool.

I have gotten Audacity to export a file - but have dead space at the end of it - it seems to always be identical to length of the original track itself. The two tracks are attached - along with a winamp conversion of the same track.

Any assistance in eliminating the dead space would be great - the users that are going to convert this are not as able or willing to have a two step process where they again open the file and remove the dead space.

I am doing this on the latest release (non beta) 1.2.6 and am using the default option for AU u-law (not the other option). The longer file shows up in winamp/media player and when i reimport it to Audacity itself...
Attachments
1005_WAV_CCITT_8bit8Sampling_mono_Winamp2_80.wav
Winamp 2.8 Converted file
(95.24 KiB) Downloaded 218 times
1005_WAV_CCITT_8bit8Sampling_mono_Audacity.wav
Converted Audacity file
(215.36 KiB) Downloaded 226 times
1005.zip
Original Wav - zipped to be under the 1MB limit
(783.96 KiB) Downloaded 196 times
41142
 
Posts: 3
Joined: Wed Jan 26, 2011 1:16 am
Operating System: Please select

Re: exporting wav to ulaw

Permanent link to this post Posted by steve » Wed Jan 26, 2011 2:30 pm

41142 wrote:I am doing this on the latest release (non beta) 1.2.6

The latest non-beta version is now ancient.
I'd suggest trying the 1.3.12 version (it is a very late beta release).
You can have both versions installed at the same time, so no need to uninstall the 1.2.6 version.
Audacity 1.2.6 cannot open projects that have been saved by Audacity 1.3.x

I can't guarantee that this will fix your problem, but it's certainly worth trying.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 45943
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

PreviousNext

Return to Windows



Who is online

Users browsing this forum: No registered users and 6 guests