Symbian
Symbian OS Library

FAQ-0858 How are Audio PCM samples organized in memory within Symbian OS?

[Index][spacer] [Previous] [Next]



 

Classification: C++ Category: Development
Created: 03/25/2003 Modified: 04/22/2003
Number: FAQ-0858
Platform: Not Applicable

Question:
Audio samples are either 8 or 16 bit, and are either Mono or Stereo.
How these samples are organized in 32 bit memory for 8 bit mono, 8 bit stereo, 16 bit mono and 16 bit stereo -> by organization, I mean interlaced or separate buffer for stereo, and byte / 16bit word order in 32bit word?


Answer:

Samples are interlaced, little endian, left channel first.

e.g.
8 bit mono:
31-24 23-16 15-8 7-0
N+3 N+2 N+1 N
(N is sample number)

8 bit stereo:
31-24 23-16 15-8 7-0
R+1 L+1 R L
(R is right channel sample number, L is left)

16 bit mono:
31-24 23-16 15-8 7-0
Nh+1 Nl+1Nh Nl
(Nh is high byte of sample, Nl is low byte)

16 bit stereo:
31-24 23-16 15-8 7-0
Rh Rl Lh Ll
(Rh is high byte of right channel sample, etc)