MCPcopy Create free account
hub / github.com/Gagravarr/VorbisJava / write

Method write

core/src/main/java/org/gagravarr/opus/OpusInfo.java:75–100  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73 }
74
75 @Override
76 public OggPacket write() {
77 int length = 19;
78 if (channelMappingFamily != 0) {
79 length += 2;
80 length += channels;
81 }
82 byte[] data = new byte[length];
83 System.arraycopy(MAGIC_HEADER_BYTES, 0, data, 0, 8);
84
85 data[8] = version;
86 data[9] = (byte)channels;
87 IOUtils.putInt2(data, 10, preSkip);
88 IOUtils.putInt4(data, 12, rate);
89 IOUtils.putInt2(data, 16, outputGain);
90
91 data[18] = channelMappingFamily;
92 if (channelMappingFamily != 0) {
93 data[19] = streamCount;
94 data[20] = twoChannelStreamCount;
95 System.arraycopy(channelMapping, 0, data, 21, channels);
96 }
97
98 setData(data);
99 return super.write();
100 }
101
102 private void parseVersion() {
103 minorVersion = version & 0xf;

Callers

nothing calls this directly

Calls 4

putInt2Method · 0.95
putInt4Method · 0.95
setDataMethod · 0.65
writeMethod · 0.65

Tested by

no test coverage detected