Skip to content

Commit

Permalink
5 bits for the object type / 4 bits for the sampling rate / 4 bits for
Browse files Browse the repository at this point in the history
the channel / padding
  • Loading branch information
pnemonic78 authored and pnemonic78 committed Jun 2, 2014
1 parent 2e62cbc commit b369ce8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/net/majorkernelpanic/streaming/audio/AACStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public synchronized void configure() throws IllegalStateException, IOException {

mProfile = 2; // AAC LC
mChannel = 1;
mConfig = mProfile<<11 | mSamplingRateIndex<<7 | mChannel<<3;
mConfig = (mProfile & 0x1F) << 11 | (mSamplingRateIndex & 0x0F) << 7 | (mChannel & 0x0F) << 3;

mSessionDescription = "m=audio "+String.valueOf(getDestinationPorts()[0])+" RTP/AVP 96\r\n" +
"a=rtpmap:96 mpeg4-generic/"+mQuality.samplingRate+"\r\n"+
Expand Down Expand Up @@ -354,7 +354,7 @@ private void testADTS() throws IllegalStateException, IOException {
mQuality.samplingRate = AUDIO_SAMPLING_RATES[mSamplingRateIndex];

// 5 bits for the object type / 4 bits for the sampling rate / 4 bits for the channel / padding
mConfig = mProfile<<11 | mSamplingRateIndex<<7 | mChannel<<3;
mConfig = (mProfile & 0x1F) << 11 | (mSamplingRateIndex & 0x0F) << 7 | (mChannel & 0x0F) << 3;

Log.i(TAG,"MPEG VERSION: " + ( (buffer[0]&0x08) >> 3 ) );
Log.i(TAG,"PROTECTION: " + (buffer[0]&0x01) );
Expand Down

0 comments on commit b369ce8

Please sign in to comment.