Return-Path: Message-ID: <20050501122209.63346.qmail@web8309.mail.in.yahoo.com> From: Mayank Batra To: BLUEZ DEVELOPERS LIST MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Subject: [Bluez-devel] What endian type is supported by audio device ? Sender: bluez-devel-admin@lists.sourceforge.net Errors-To: bluez-devel-admin@lists.sourceforge.net Reply-To: bluez-devel@lists.sourceforge.net List-Unsubscribe: , List-Id: BlueZ development List-Post: List-Help: List-Subscribe: , List-Archive: Date: Sun, 1 May 2005 13:22:09 +0100 (BST) Marcel, Don't you think that we should first find out which endian type the user's audio device supports ? I mean, in the file sbc.c in the following lines for (i = 0; i < samples; i++) { for (ch = 0; ch < priv->frame.channels; ch++) { int16_t s = (int16_t)(priv->frame.pcm_sample[ch][i]); *ptr++ = (s & 0xff00) >> 8; *ptr++ = (s & 0x00ff); } } Shouldn't we first check out whether the user's audio device supports little endian or big endian type ? It should be something like below... for (i = 0; i < samples; i++) { for (ch = 0; ch < priv->frame.channels; ch++) { int16_t s = (int16_t)(priv->frame.pcm_sample[ch][i]); if(BIG_ENDIAN) { *ptr++ = (s & 0xff00) >> 8; *ptr++ = (s & 0x00ff); } else { *ptr++ = (s & 0x00ff); *ptr++ = (s & 0xff00) >> 8; } } } Ofcourse BIG_ENDIAN will be replaced by a function or macro which returns the endian type. Do you have knowledge of such a function or macro ? If yes, please patch sbc.c file for us. It will be great for people like me who have spent weeks in figuring out why the sound quality is so poor while using sbcdec.c I use an Intel based machine, which follows little-endian format. But sbc.c was using big endian format. Thanks and Regards Mayank ________________________________________________________________________ Yahoo! India Matrimony: Find your life partner online Go to: http://yahoo.shaadi.com/india-matrimony ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel