Skip to content

Commit

Permalink
Add serializeAudioLevelIndication function
Browse files Browse the repository at this point in the history
  • Loading branch information
shinyoshiaki committed Dec 12, 2023
1 parent aa6031a commit 985cc21
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/rtp/src/rtp/headerExtension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ export function serializeAbsSendTime(ntpTime: bigint) {
return buf;
}

export function serializeAudioLevelIndication(level: number) {
const stream = new BitStream(Buffer.alloc(1));
stream.writeBits(1, 1);
stream.writeBits(level, 7);

return stream.uint8Array;
}

export function deserializeString(buf: Buffer) {
return buf.toString();
}
Expand Down

0 comments on commit 985cc21

Please sign in to comment.