Asterisk and audio formats

Gosh I sure know how to derail myself! Today, I spent a good chunk of my time investigating what is the best format and codec to use for my audio files, which are part of the voiceXML application. This was not meant to be a time-consuming exercise since Asterisk technically supports many formats and codecs. However, I was keen on finding something with a low bandwidth footprint and reasonable quality. To be precise I was thinking of something along the lines of 8 bits sampling size and sampling rate of 8 KHz.

Why? Well because I am bandwidth sensitive but also because ordinary voice doesn’t necessarily benefit much from high sample rates (or at least this is what you get if you follow debates related to podcasting for developing worlds). Ok back to the point 😉 ! In my adventure I came across speex and I must say, I am so in love with it. It truly seems to be something that one must consider just check out how it compares with other codecs by following this link http://www.speex.org/comparison/. What is also very interesting is the modesty attached to the comparison as captured by a disclaimer which basically says the results should be taken with a grain of salt!

The only issue I have at the moment is that speex is not supported by audacity. Thus after file creation one has to encode the files to .ogg files at the command line. This all translates to not being able to kill two birds with one stone which is not good because I certainly believe in killing two birds with one stone (just as a side issue I have been provided this link by Richard as part of dissuading me into such a believe). But when it comes down to it, I suppose my issue is not even an issue because at one point or the other one might need to convert files for Asterisk using command line utilities like SoX, “the Swiss Army knife of sound processing programs”. So when all has been said and done, I think I shall be a speex fan and not fanatic 😉

Asterisk Sound Problem

I have spent nearly two hours trying to figure why I get no sound when I do a console dial on Asterisk. I was getting the error ‘Unable to re-open DSP device /dev/dsp: Device or resource busy‘. As far as I was concerned my sound card was not being utilised by any application so I figured Asterisk was acting up on me.

Well I guess I was wrong. The soft phone (Egika) which loads immediately after booting was in fact the culprit. I quit the application. It is should be noted that there is a vast difference between quit and close in the context of the application, so using the cross (X) on the Egika window is not what one wants to do. After quitting I loaded Asterisk followed by Egika and both worked as expected.

I am satisfied with finding the cause of the problem but I am still curious about why Egika acts so possesively. The application uses an ALSA plugin and I thought the whole point of this sound architecture was to promote selfless and not possessive behaviour from applications using it! May be I am just annoyed orthere is something I am missing!!