Question about AudioMixer

51 views
Skip to first unread message

jcbo...@gmail.com

unread,
Jun 1, 2015, 8:44:55 PM6/1/15
to android...@googlegroups.com
Hi.
 
I'm Android Developer.
 
I have some questions about AudioMixer of Android AudioFramework.

 

When Mixing audio frames sample by sample,

 

In theory, Overflow can be occurred.

 

Because size of sample is 16bit size , so 32bit outTemp buffer is used in AudioMixer.cpp

 

But, Tracks can be max 32 tracks, so It can be the range of

 

-32*4096*32767 ~ 32(max number of tracks)*4096(volume max value)*32767(sample max valume).

 

But 32bit signed pcm can be ranged of -16*4096*32767 ~ 16*4096*32767.

 

So 16*4096*32767 ~ 32(max number of tracks)*4096(volume max value)*32767(sample max valume) or -32*4096*32767~ -16*4096*32767 range occur overflow.

 

I want know the reason that how come the outTemp buffer size is 32bit, and

 

When the integer volume range is 0~ 2048 ,or outTemp buffer size is 64bit, the overflow does not occur.

 

Please reply the question.

 

Thanks,

Glenn Kasten

unread,
Jun 2, 2015, 4:52:41 PM6/2/15
to android...@googlegroups.com, jcbo...@gmail.com
You are correct, it is possible to overflow / clip if there are too many active tracks at a high volume.
Reply all
Reply to author
Forward
0 new messages