public static void setExampleWaveInfoData(RcRiffBwf rcRiffBwf) { RcRiffInfoListChunk rcRiffInfoListChunk = new RcRiffInfoListChunk(); rcRiffBwf.setRcRiffInfoListChunk(rcRiffInfoListChunk); rcRiffInfoListChunk.setArchiveLocation("Example archive location"); rcRiffInfoListChunk.setArtist("Example artist"); rcRiffInfoListChunk.setCommissioned("Example commissioned"); rcRiffInfoListChunk.setComments("Example comments"); rcRiffInfoListChunk.setCopyright("Example copyright"); rcRiffInfoListChunk.setCreationDate("Example creation date"); rcRiffInfoListChunk.setEngineer("Example engineer"); rcRiffInfoListChunk.setGenre("Example genre"); rcRiffInfoListChunk.setKeywords("Example keywords"); rcRiffInfoListChunk.setMedium("Example medium"); rcRiffInfoListChunk.setName("Example name"); rcRiffInfoListChunk.setProduct("Example product"); rcRiffInfoListChunk.setSubject("Example subject"); rcRiffInfoListChunk.setSoftware("Example software"); rcRiffInfoListChunk.setSource("Example source"); rcRiffInfoListChunk.setSourceForm("Example source form"); }
this.setChunkSize(0L); if (this.getArchiveLocation() != null && this.getArchiveLocation().trim().length() > 0) { bytesWritten += this.writeStringChunk( out, RcRiffInfoListChunk.RC_RIFF_ARCHIVE_LOCATION_CHUNK_ID, this.getArchiveLocation().trim()); if (this.getArtist() != null && this.getArtist().trim().length() > 0) { bytesWritten += this.writeStringChunk( out, RcRiffInfoListChunk.RC_RIFF_ARTIST_CHUNK_ID, this.getArtist().trim()); if (this.getCommissioned() != null && this.getCommissioned().trim().length() > 0) { bytesWritten += this.writeStringChunk( out, RcRiffInfoListChunk.RC_RIFF_COMMISSIONED_CHUNK_ID, this.getCommissioned().trim()); if (this.getComments() != null && this.getComments().trim().length() > 0) {
RcRiffInfoListChunk rcRiffInfoListChunk = new RcRiffInfoListChunk(); rcRiffBwf.setRcRiffInfoListChunk(rcRiffInfoListChunk); rcRiffInfoListChunk.setArchiveLocation(rcRiffBextChunk.getOriginator()); rcRiffInfoListChunk.setComments(rcRiffBextChunk.getDescription()); rcRiffInfoListChunk.setCreationDate(rcRiffBextChunk.getOriginationDate()); rcRiffInfoListChunk.setName(rcAudioRecMd.getTitle().trim());
public static RcRiffListChunk read(RandomAccessFile in, long ptr, String chunkId, long chunkSize) throws IOException { // Assume chunk id and chunk size have already been read long bytesRead = 0; String listType = RcRiffBwf.readAscii(in, 4); bytesRead += 4; //System.out.println("\tType: " + listType); if (listType.equals(RcRiffListChunk.RC_RIFF_INFO_LIST_TYPE)) { RcRiffListChunk rcRiffListChunk = new RcRiffInfoListChunk(); rcRiffListChunk.setListType(listType); rcRiffListChunk.setChunkId(chunkId); rcRiffListChunk.read(in, ptr, chunkSize); return rcRiffListChunk; } else { // Skip unknown list types in.skipBytes((int) (chunkSize - bytesRead)); return null; } }
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; }
this.setPtr(ptr); this.setChunkSize(chunkSize); long bytesLeft = this.getChunkSize(); this.setArchiveLocation(subChunkData); this.setArtist(subChunkData); this.setCommissioned(subChunkData); this.setComments(subChunkData); this.setCopyright(subChunkData); this.setCreationDate(subChunkData); this.setEngineer(subChunkData); this.setGenre(subChunkData); this.setKeywords(subChunkData); this.setMedium(subChunkData); this.setName(subChunkData); this.setProduct(subChunkData);
System.out.println("\tArchive location: " + rcRiffInfoListChunk.getArchiveLocation()); System.out.println("\tArtist: " + rcRiffInfoListChunk.getArtist()); System.out.println("\tCommissioned: " + rcRiffInfoListChunk.getCommissioned()); System.out.println("\tComments: " + rcRiffInfoListChunk.getComments()); System.out.println("\tCopyright: " + rcRiffInfoListChunk.getCopyright()); System.out.println("\tCreation date: " + rcRiffInfoListChunk.getCreationDate()); System.out.println("\tEngineer: " + rcRiffInfoListChunk.getEngineer()); System.out.println("\tGenre: " + rcRiffInfoListChunk.getGenre()); System.out.println("\tKeywords: " + rcRiffInfoListChunk.getKeywords()); System.out.println("\tMedium: " + rcRiffInfoListChunk.getMedium()); System.out.println("\tName: " + rcRiffInfoListChunk.getMedium()); System.out.println("\tProduct: " + rcRiffInfoListChunk.getProduct()); System.out.println("\tSubject: " + rcRiffInfoListChunk.getSubject()); System.out.println("\tSoftware: " + rcRiffInfoListChunk.getSoftware()); System.out.println("\tSource: " + rcRiffInfoListChunk.getSource()); System.out.println("\tSource form: " + rcRiffInfoListChunk.getSourceForm());