public void storeMd5() throws IOException { if (this.getRcRiffMd5Chunk() == null) { this.setRcRiffMd5Chunk(new RcRiffMd5Chunk()); } this.getRcRiffDataChunk().calculateMd5Checksum(); this.getRcRiffMd5Chunk().setStoredMd5( this.getRcRiffDataChunk().getCalculatedMd5()); } }
@Override public long read(RandomAccessFile in, long ptr, long chunkSize) throws IOException { this.setPtr(ptr); this.setChunkSize(chunkSize); long bytesRead = 0L; // Read RIFF format this.setFormat(RcRiffFile.readAscii(in, RcRiffHeaderChunk.FORMAT_LENGTH)); bytesRead += RcRiffHeaderChunk.FORMAT_LENGTH; //System.out.println("\tFormat: " + this.getFormat()); return bytesRead; }
@Override public long read(RandomAccessFile in, long ptr, long chunkSize) throws IOException { this.setPtr(ptr); this.setChunkSize(chunkSize); this.setAXml(RcRiffFile.readUtf8(in, this.getChunkSize())); return this.getChunkSize(); }
@Override public long write(RandomAccessFile out) throws IOException, RcBwfException { this.setChunkSize(320 * this.getMarkerEntries().size()); long bytesWritten = super.write(out); for (RcRiffMarkerEntry e : this.rcRiffMarkerEntryList) { bytesWritten += e.write(out); } return bytesWritten; }
public static void setExampleAXmlData(RcRiffBwf rcRiffBwf) throws DatatypeConfigurationException, TransformerException, ParserConfigurationException, IOException, RcAudioMdException { // Create example audioMD RcAudioMd rcAudioMd = RcBwfWriteExample.getRcAudioMd(rcRiffBwf); boolean prefixed = true; String audioMdXml = rcAudioMd.marshalToString(prefixed); // Create and set axml chunk RcRiffAXmlChunk rcRiffAXmlChunk = new RcRiffAXmlChunk(); rcRiffAXmlChunk.setAXml(audioMdXml); rcRiffBwf.setRcRiffAXmlChunk(rcRiffAXmlChunk); }
/** * Opens the BWF file in read-only mode. * * @throws IOException */ public void open() throws IOException { this.open(true); }
@Override public long write(RandomAccessFile out) throws IOException, RcBwfException { if (this.getStoredMd5() == null || this.getStoredMd5().length == 0) { return 0L; } this.setChunkSize(this.getStoredMd5().length); long bytesWritten = super.write(out); out.write(this.reverse(this.getStoredMd5())); bytesWritten += this.getStoredMd5().length; return bytesWritten; }
private long writeStringChunk(RandomAccessFile out, String id, String value) throws UnsupportedEncodingException, IOException { long bytesWritten = 0L; bytesWritten += RcRiffFile.writeAscii(out, id); bytesWritten += RcRiffFile.writeUnsignedInt(out, value.length() + 1); bytesWritten += RcRiffFile.writeAscii(out, value); bytesWritten += RcRiffFile.writeNullBytes(out, 1); bytesWritten += this.align(out, bytesWritten); return bytesWritten; }
public long getDataSize() { return this.rcRiffDataChunk.getChunkSize(); }
public RcRiffHeaderChunk() { super(); this.setChunkId(RcRiffBwf.RC_RIFF_HEADER_CHUNK_ID); this.setFormat(RcRiffHeaderChunk.RC_RIFF_FORMAT_WAVE); }
public void setUmid(byte[] umid) throws RcBwfException { if (umid.length != 32 && umid.length != 64) { throw new RcBwfException("BEXT SMPT UMID must be 32 or 64 bytes in length."); } this.umid = umid; }
public RcRiffAXmlChunk() { super(); this.setChunkId(RcRiffBwf.RC_RIFF_AXML_CHUNK_ID); }
public RcRiffDataChunk() { super(); this.setChunkId(RcRiffBwf.RC_RIFF_DATA_CHUNK_ID); }
public RcRiffMarkerChunk() { super(); this.setChunkId(RcRiffBwf.RC_RIFF_MARKER_CHUNK_ID); }
public RcRiffBextChunk() { super(); this.setChunkId(RcRiffBwf.RC_RIFF_BEXT_CHUNK_ID); }
public RcRiffInfoListChunk() { super(); this.setListType(RcRiffListChunk.RC_RIFF_INFO_LIST_TYPE); }
public RcRiffFmtChunk() { super(); this.setChunkId(RcRiffBwf.RC_RIFF_FMT_CHUNK_ID); }
public RcRiffListChunk() { super(); this.setChunkId(RcRiffBwf.RC_RIFF_LIST_CHUNK_ID); }
public void setReserved(byte[] reserved) throws RcBwfException { if (reserved.length != RcRiffBextChunk.RESERVED_LENGTH) { throw new RcBwfException("BEXT reserved must be " + RcRiffBextChunk.RESERVED_LENGTH + " bytes in length."); } this.reserved = reserved; }
public void setVersion(int version) throws RcBwfException { if (version < 0 || version > 0xFFFF) { throw new RcBwfException("Invalid BEXT version, value must be 0 - 65535"); } this.version = version; }