Project

General

Profile

Support for asterisk audio-formats please ?

Added by Pieter Knoop almost 10 years ago

Hi,

I googled but I cannot find any GUI player (on Linux or Windows) which support both GSM and SLN audio-formats of asterisk.
It would be great if there was an Audacious plugin for it.

I work a lot with asterisk and have to convert lot of audio, it would be much easier to listen to them in a GUI player
instead in a terminal or via the asterisk.


Replies (6)

RE: Support for asterisk audio-formats please ? - Added by Audacious User2 almost 10 years ago

I don't know about sln, but I was able to create a gsm with sox, and Audacious was able to play it (using ffmpeg plugin).
Make sure your ffmpeg is built with gsm support:

$ ffmpeg -codecs | grep -i gsm
DEA.L. gsm GSM (decoders: gsm libgsm ) (encoders: libgsm )
DEA.L. gsm_ms GSM Microsoft variant (decoders: gsm_ms libgsm_ms ) (encoders: libgsm_ms )

RE: Support for asterisk audio-formats please ? - Added by Michael Schwendt almost 10 years ago

Audacious SndFile input plugin is based on libsndfile, and libsndfile can be built and linked with libgsm, too.

Though, the plugin only advertises file name extensions .aiff, .au, .raw and .wav, so if it's a different extension that's used that could lead to problems (probing of content to determine the audio format).

RE: Support for asterisk audio-formats please ? - Added by Pieter Knoop almost 10 years ago

Thank you for both answers.

Strangely the gsm and sln format of asterisk doesn't differ that much.
The gsm is already implemented in the ffmpeg-plugin, so why not the sln format.

See what sox has to say:

825.gsm:

File Size: 6.76k     
Encoding: GSM
Channels: 1 @ 16-bit
Samplerate: 8000Hz
Replaygain: off
Duration: unknown
File Size: 65.6k     
Encoding: Signed PCM
Channels: 1 @ 16-bit
Samplerate: 8000Hz
Replaygain: off
Duration: unknown

I hope the developers of these 2 plugins want to add this sln.
Than Audacious can be one of the first players able to play sln files in Windows (and Linux of course).

RE: Support for asterisk audio-formats please ? - Added by John Lindgren almost 10 years ago

It would be best to add SLN support to libsndfile or FFmpeg (if they don't already have it). Have you checked whether sndfile-play or ffplay recognize the files?

RE: Support for asterisk audio-formats please ? - Added by Audacious User2 almost 10 years ago

I started with a file from alsa's sample sounds (/usr/share/sounds/alsa/noise.wav) and converted to sln. I can't get sndfile-info or ffplay to recognize it..

$ file noise.wav 
noise.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 48000 Hz
$ ffmpeg -i noise.wav -f s16le -acodec pcm_s16le noise.sln

Guessed Channel Layout for  Input Stream #0.0 : mono
Input #0, wav, from 'noise.wav':
  Duration: 00:00:01.41, bitrate: 768 kb/s
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, mono, s16, 768 kb/s
Output #0, s16le, to 'noise.sln':
  Metadata:
    encoder         : Lavf55.33.100
    Stream #0:0: Audio: pcm_s16le, 48000 Hz, mono, s16, 768 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16le -> pcm_s16le)
Press [q] to stop, [?] for help
size=     132kB time=00:00:01.40 bitrate= 768.0kbits/s    
video:0kB audio:132kB subtitle:0 data:0 global headers:0kB muxing overhead 0.000000%

$ file noise.sln 
noise.sln: data

$ sndfile-info noise.sln 

Version : libsndfile-1.0.25
Error : Not able to open input file noise.sln.
File : noise.sln
Length : 135158
File contains data in an unknown format.


$ ffplay noise.sln 

noise.sln: Invalid data found when processing inputq=    0B f=0/0   
    nan    :  0.000 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0

RE: Support for asterisk audio-formats please ? - Added by John Lindgren almost 10 years ago

That ffmpeg command will give you raw PCM data. It doesn't matter what you call it, raw data cannot be played back without additional information, which is normally stored in the WAV header. According to various sources ([1] for example), Asterisk supports a subset of WAV files, so you should use that format for portability.

[1] http://support.rhinoequipment.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=39

    (1-6/6)