HowTo wav mono, 8000Hz sample rate, 64 kbs with Audacity ?

This section is now closed.
Forum rules
Audacity 1.2.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.
Locked
darius2
Posts: 30
Joined: Wed Jun 30, 2010 2:43 pm
Operating System: Please select

HowTo wav mono, 8000Hz sample rate, 64 kbs with Audacity ?

Post by darius2 » Wed Jun 30, 2010 4:30 pm

Hi,

I was told to record audio stream and save to

wav file mono, 8000Hz, 64 kbs to be played by Asterisk MusicOnHold

"
Basically the wav files are a mono, 8000Hz sample rate, 64 kbs.
"
Does Audacity support this file save format ?

If so, what option should be selected.

==
Having wav file opened with Audacity I can select selecting DTMF0 menu
to get submenu options

Set Rate - set rate to 8000 Hz
Set sample rate - set rate to 16 bit
selected mono

But how to save opened wav file as mono, 8000Hz, 64 kbs on output, not in a viewer ?


Another my question is how to use Audacity audio filters to discover what distortion come with
sound from Asterisk, playing audio files to a sound card via Celliax audio channel .


thanks


Darius

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

Re: HowTo wav mono, 8000Hz sample rate, 64 kbs with Audacity

Post by steve » Wed Jun 30, 2010 6:17 pm

WAV format specifies the sample rate (Hz), bit depth (usually 8, 16, 24 or 32 bit) and the number of channels (usually "1 channel mono" or "2 channel stereo").
"64 kbps" is a measure of "data rate" and is usually quoted with reference to compressed audio formats such as MP3.
The data rate for a non-compressed audio format is calculated by multiplying the sample rate x bit depth x number of channels.
For a data rate of 64 kbps the audio must be 8 kHz, 8 bit mono (8000 x 8 x 1 = 64000)

In Audacity 1.2.6, go to "Edit menu > Preferences > File Formats" and set the "Uncompressed Export Format" to 8 bit.
(The problem at this point is that you have not said if it needs to be 8 bit PCM or some other format.)
The set the "Project Rate" (box in lower left corner of the main Audacity window) to 8000.
Obviously the audio in your project must be mono.
The File menu > Export as WAV
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

darius2
Posts: 30
Joined: Wed Jun 30, 2010 2:43 pm
Operating System: Please select

Re: HowTo wav mono, 8000Hz sample rate, 64 kbs with Audacity

Post by darius2 » Wed Jun 30, 2010 6:58 pm

stevethefiddle wrote:WAV format specifies the sample rate (Hz), bit depth (usually 8, 16, 24 or 32 bit) and the number of channels (usually "1 channel mono" or "2 channel stereo").
"64 kbps" is a measure of "data rate" and is usually quoted with reference to compressed audio formats such as MP3.
The data rate for a non-compressed audio format is calculated by multiplying the sample rate x bit depth x number of channels.
For a data rate of 64 kbps the audio must be 8 kHz, 8 bit mono (8000 x 8 x 1 = 64000)

In Audacity 1.2.6, go to "Edit menu > Preferences > File Formats" and set the "Uncompressed Export Format" to 8 bit.
(The problem at this point is that you have not said if it needs to be 8 bit PCM or some other format.)
The set the "Project Rate" (box in lower left corner of the main Audacity window) to 8000.
Obviously the audio in your project must be mono.
The File menu > Export as WAV
Thanks Steve,

exactly the case, already trained before.
I export wav file as uncompressed 8 bit PCM (wav), mono, 64 kbps bitrate
and opening it back by Audacity
as 16 bit, 11025 Hz, mono

Ok. I can change and set rate to 8000 Hz
but no way to set 8 bit ( as 16 bit is set by default and 8-bit is not a valid option in submenu).

and bitrate transfer spead is 88kb/s not 64 kbps, as set in export preferences.

another test and this time exported wav file is 705kb/s (windows file info / details)

And get it back opened by Audacity as
stereo, 16 bit, 44100 Hz

So file export settings for wav file simply didn't work for me

Audio preferences / Quality / Defalt sample format : 8 bit is not a valid option


Darius

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

Re: HowTo wav mono, 8000Hz sample rate, 64 kbs with Audacity

Post by steve » Wed Jun 30, 2010 7:34 pm

You are using Audacity 1.2.6?
darius2 wrote:I export wav file as uncompressed 8 bit PCM (wav), mono, 64 kbps bitrate
and opening it back by Audacity
as 16 bit, 11025 Hz, mono
Audacity is designed for high quality audio production and does not "internally" support bit depths below 16 bit. If you import an 8 bit format file into Audacity it is automatically up-sampled to 16, 24 or 32 bit. This does not prevent you from Exporting as 8 bit WAV.
darius2 wrote:and bitrate transfer spead is 88kb/s not 64 kbps, as set in export preferences.
8 bit mono PCM 8 kHz = 64 kbps (I don't make the rules, it just is :) )
What says that it is 88 kbps ?

darius2 wrote:And get it back opened by Audacity as
stereo, 16 bit, 44100 Hz
If you import an 8 kHz file into an empty Audacity project, the file will be imported as it's original sample rate (ie 8 kHz)
If you import an 8 kHz file into a project that already has audio in it, the imported file will be resampled to the current project rate.

This can be a bit confusing at first, but it was a difficult (impossible) for the developers to find a strategy that would suit everyone and every task. The "rules" that were agreed on were made to suit most of the people most of the time.

The rules are as follows:
1) If you import a file into an empty Audacity project, the Project Rate will change to match the sample rate of the imported file.
2) If you import a file into a non-empty Audacity project, AND the imported file has a lower sample rate than the Project Rate, the imported file will by resampled to the Project rate. (the higher quality rate takes precedence)
3) If you import a file into a non-empty Audacity project, AND the imported file has a higher sample rate than the Project Rate, the imported file will be imported at it's original sample rate. (It will not be resampled - the higher quality rate takes precedence).
darius2 wrote:Audio preferences / Quality / Defalt sample format : 8 bit is not a valid option
No it's not, but that does not prevent you from exporting as 8 bit.
The "bit depth" part of the export format is set in "Edit menu > Preferences > File Formats > Uncompressed Export Format".
The "Sample Rate" part of the export format is set by the "Project Rate".
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

darius2
Posts: 30
Joined: Wed Jun 30, 2010 2:43 pm
Operating System: Please select

Re: HowTo wav mono, 8000Hz sample rate, 64 kbs with Audacity

Post by darius2 » Wed Jun 30, 2010 10:21 pm

Thanks,
looks to be a bit complicated to me

"
No it's not, but that does not prevent you from exporting as 8 bit.
The "bit depth" part of the export format is set in "Edit menu > Preferences > File Formats > Uncompressed Export Format".
The "Sample Rate" part of the export format is set by the "Project Rate".
"

All I can do in project is to set sample format to 16 bit (audio file already opened in Audacity).

Exporting it, as said before as mono, 8 bit, 64kbps I can't get it playable as Asterisk's MusicOnHold audio file.

Could you kindly export audio file to meet MOH Asterisk's standard (subject line) and upload it to web server, to let me download and test it in Asterisk ?

Darius

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

Re: HowTo wav mono, 8000Hz sample rate, 64 kbs with Audacity

Post by steve » Wed Jun 30, 2010 11:40 pm

From this web page it looks like you need to use 8 bit u-law format and not 8 bit PCM.
Other pages seem to suggest using MP3s rather that WAV files.
It also appears to depend on which version you are using.
Where's the documentation that says exactly what the format should be for the version that you are using?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

darius2
Posts: 30
Joined: Wed Jun 30, 2010 2:43 pm
Operating System: Please select

Re: HowTo wav mono, 8bit, 8000Hz rate, 64 kbs with Audacity

Post by darius2 » Thu Jul 01, 2010 9:28 am

Thanks Steve,

I have uploaded MusicOnHold Asterisk playable file, coming with .wav extension

http://www.filedropper.com/fpm-calm-river

Maybe the issue is I am mixing Linux and Windows OS
and u-law in Windows comes with .au extension
so I export audacity recording as wav ( 8 bit pcm, 8000 Hz, mono to get 64kbps)
selecting u-law in export preferences I get
*.au file

Only once I succeeded to get file info in Audacity or GoldWave to get Linux like file info.

Darius

darius2
Posts: 30
Joined: Wed Jun 30, 2010 2:43 pm
Operating System: Please select

Re: HowTo wav mono, 8000Hz sample rate, 64 kbs with Audacity

Post by darius2 » Thu Jul 01, 2010 12:06 pm

follow-up

finally got it
correct MOH playable audio format is
16bit, 8000Hz, mono, 128kbps, pcm wav

I am just generating a number of audio samples like sine, square, sawtooth
to let me diagnose sound quality problems in my system.

Please tell me what frequency range, amplitude, waveform to select for diagnostics of audio system in laptop , realtek , intel DC.

Next step is to build live audio stream generated by Audiocity, uploaded to a local web server (apache run on the same laptop)
and have Asterisk to play live audio stream in place of MOH
and record, monitor played ;live audio stream in another instance of audacity , goldwave or alike.

I am still working hard to diagnose sound quality problems in Asterisk.

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

Re: HowTo wav mono, 8000Hz sample rate, 64 kbs with Audacity

Post by steve » Thu Jul 01, 2010 4:42 pm

The theoretical maximum frequency that can be represented with a 8 kHz sample rate is < 4 kHz. http://en.wikipedia.org/wiki/Nyquist_frequency
The theoretical dynamic range of 16 bit audio is around 96 dB http://en.wikipedia.org/wiki/16_bit_audio#Dynamic_range

There are also other aspects to "sound quality", such as "distortion", "impulse response" and so on. http://en.wikipedia.org/wiki/Audio_quality_measurement
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

darius2
Posts: 30
Joined: Wed Jun 30, 2010 2:43 pm
Operating System: Please select

Re: HowTo wav mono, 8000Hz sample rate, 64 kbs with Audacity

Post by darius2 » Thu Jul 01, 2010 5:51 pm

Thanks Steve,

forget 8 khz, 16 khz is audio file format for Asterisk's MOH, as verified by me.

Locked