GNOME Bugzilla – Bug 588218
Siren in .wav support
Last modified: 2009-07-13 16:29:57 UTC
MSN's audio clips (not AV calls and such) come in as the Siren(7?) codec contained in a WAV. It'd be nice to just use a 'playbin' to play these, but it doesn't work because the RIFF parser doesn't support the Siren codec ID. I've attached a patch that adds the siren codec ID (0x28E) and hopefully the remaining parameters with the correct settings.
Created attachment 138171 [details] [review] Add Siren to RIFF parser
The patch looks good but can you provide a sample file? Also sirendec from gst-plugins-bad seems to need a dct-length parameter in the caps (and requires it to be 320)
A sample file can be found here: http://developer.pidgin.im/attachment/ticket/393/voice_clip.wav It appears to play fine without setting dct-length in the caps. I can only find the dct mentioned in siren_rmlt_decode/encode_samples and siren_dct4 (called from the previous two), but it doesn't appear to be called with the dct-length parameter from the caps. (Perhaps that's a bug, too?)
Created attachment 138225 [details] Siren sample Here's a sample of an encoded siren wav file. It only contain garbage noise (scratching the microphone), but it's a good example. I have other examples, as well as encoded/decoded samples if you need. Tell me if you want me to upload them too.
The dct-lenght is always fixed at 320 in the decoder/encoder anyway afaik, so no need to provide it from wavparse (unless you can read it from the .wav file header).
yes, it is part of the optional WAV header. The extra header size is 2 bytes and the dct length is 320 as an unsigned short. You can see it in : http://amsn.svn.sourceforge.net/viewvc/amsn/trunk/amsn/utils/tcl_siren/src/common.h?revision=9715&view=markup and in the init function of the encoder where the WAV header is initialized : http://amsn.svn.sourceforge.net/viewvc/amsn/trunk/amsn/utils/tcl_siren/src/encoder.c?revision=9710&view=markup
wav sets the dct length in the codec_data and can't really generically create the dct-length caps property without hardcoding siren codec_data parsing. Two options: - implement codec_data parsing in wavparse and set the dct-length property on the caps. - remove the dct-length property from sirendec and implement codec_data parsing when we need it. I would vote for 2, for now. If we need to make autoplugging more granular (a decoder that only accepts certain dct-lengths?) we can add parsing and put dct-length on the caps.
commit 132fb5c050039c6778e5d80e3f0df3a3f539c515 Author: Elliott Sales de Andrade <quantum.analyst at gmail.com> Date: Mon Jul 13 18:21:49 2009 +0200 riff: add siren to the RIFF parser Add siren7 caps to the RIFF parser.
Shouldn't it parse the dct-lenght from the header ?