• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java AsfTag类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.jaudiotagger.tag.asf.AsfTag的典型用法代码示例。如果您正苦于以下问题:Java AsfTag类的具体用法?Java AsfTag怎么用?Java AsfTag使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AsfTag类属于org.jaudiotagger.tag.asf包,在下文中一共展示了AsfTag类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getTag

import org.jaudiotagger.tag.asf.AsfTag; //导入依赖的package包/类
@Override
protected AsfTag getTag(final RandomAccessFile raf) throws CannotReadException, IOException {
    raf.seek(0);
    AsfTag tag;
    try {
        final AsfHeader header = AsfHeaderReader.readTagHeader(raf);
        if (header == null) {
            throw new CannotReadException("Some values must have been " + "incorrect for interpretation as asf with wma content.");
        }

        tag = TagConverter.createTagOf(header);

    } catch (final Exception e) {
        logger.severe(e.getMessage());
        if (e instanceof IOException) {
            throw (IOException) e;
        } else if (e instanceof CannotReadException) {
            throw (CannotReadException) e;
        } else {
            throw new CannotReadException("Failed to read. Cause: " + e.getMessage());
        }
    }
    return tag;
}
 
开发者ID:Old-Geek,项目名称:Musique,代码行数:25,代码来源:AsfFileReader.java


示例2: getTag

import org.jaudiotagger.tag.asf.AsfTag; //导入依赖的package包/类
/**
 * (overridden)
 *
 * @see org.jaudiotagger.audio.generic.AudioFileReader#getTag(java.io.RandomAccessFile)
 */
@Override
protected AsfTag getTag(final RandomAccessFile raf) throws CannotReadException, IOException
{
    raf.seek(0);
    AsfTag tag;
    try
    {
        final AsfHeader header = AsfHeaderReader.readTagHeader(raf);
        if (header == null)
        {
            throw new CannotReadException("Some values must have been " + "incorrect for interpretation as asf with wma content.");
        }

        tag = TagConverter.createTagOf(header);

    }
    catch (final Exception e)
    {
        logger.severe(e.getMessage());
        if (e instanceof IOException)
        {
            throw (IOException) e;
        }
        else if (e instanceof CannotReadException)
        {
            throw (CannotReadException) e;
        }
        else
        {
            throw new CannotReadException("Failed to read. Cause: " + e.getMessage());
        }
    }
    return tag;
}
 
开发者ID:GlennioTech,项目名称:MetadataEditor,代码行数:40,代码来源:AsfFileReader.java


示例3: getTag

import org.jaudiotagger.tag.asf.AsfTag; //导入依赖的package包/类
/**
 * (overridden)
 *
 * @see org.jaudiotagger.audio.generic.AudioFileReader#getTag(java.io.RandomAccessFile)
 */
@Override
protected AsfTag getTag(final RandomAccessFile raf)
        throws CannotReadException, IOException {
    raf.seek(0);
    AsfTag tag;
    try {
        final AsfHeader header = AsfHeaderReader.readTagHeader(raf);
        if (header == null) {
            throw new CannotReadException(
                    "Some values must have been "
                            + "incorrect for interpretation as asf with wma content.");
        }

        tag = TagConverter.createTagOf(header);

    } catch (final Exception e) {
        logger.severe(e.getMessage());
        if (e instanceof IOException) {
            throw (IOException) e;
        } else if (e instanceof CannotReadException) {
            throw (CannotReadException) e;
        } else {
            throw new CannotReadException("Failed to read. Cause: "
                    + e.getMessage());
        }
    }
    return tag;
}
 
开发者ID:openaudible,项目名称:openaudible,代码行数:34,代码来源:AsfFileReader.java


示例4: deleteTag

import org.jaudiotagger.tag.asf.AsfTag; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void deleteTag(final RandomAccessFile raf,
                         final RandomAccessFile tempRaf) throws CannotWriteException,
        IOException {
    writeTag(new AsfTag(true), raf, tempRaf);
}
 
开发者ID:openaudible,项目名称:openaudible,代码行数:10,代码来源:AsfFileWriter.java


示例5: createDefaultTag

import org.jaudiotagger.tag.asf.AsfTag; //导入依赖的package包/类
/**
 * Create Default Tag
 *
 * @return
 */
public Tag createDefaultTag() {
    if (SupportedFileFormat.FLAC.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.')))) {
        return new FlacTag(VorbisCommentTag.createNewTag(), new ArrayList<MetadataBlockDataPicture>());
    } else if (SupportedFileFormat.OGG.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.')))) {
        return VorbisCommentTag.createNewTag();
    } else if (SupportedFileFormat.MP4.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.')))) {
        return new Mp4Tag();
    } else if (SupportedFileFormat.M4A.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.')))) {
        return new Mp4Tag();
    } else if (SupportedFileFormat.M4P.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.')))) {
        return new Mp4Tag();
    } else if (SupportedFileFormat.WMA.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.')))) {
        return new AsfTag();
    } else if (SupportedFileFormat.WAV.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.')))) {
        return new WavTag();
    } else if (SupportedFileFormat.RA.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.')))) {
        return new RealTag();
    } else if (SupportedFileFormat.RM.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.')))) {
        return new RealTag();
    } else if (SupportedFileFormat.AIF.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.')))) {
        return new AiffTag();
    } else {
        throw new RuntimeException("Unable to create default tag for this file format");
    }

}
 
开发者ID:openaudible,项目名称:openaudible,代码行数:32,代码来源:AudioFile.java


示例6: createDefaultTag

import org.jaudiotagger.tag.asf.AsfTag; //导入依赖的package包/类
public Tag createDefaultTag() {
    if (SupportedFileFormat.FLAC.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.')))) {
        return new FlacTag(VorbisCommentTag.createNewTag(), new ArrayList<>());
    } else if (SupportedFileFormat.OGG.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.')))) {
        return VorbisCommentTag.createNewTag();
    } else if (SupportedFileFormat.MP4.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.')))) {
        return new Mp4Tag();
    } else if (SupportedFileFormat.M4A.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.')))) {
        return new Mp4Tag();
    } else if (SupportedFileFormat.M4P.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.')))) {
        return new Mp4Tag();
    } else if (SupportedFileFormat.WMA.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.')))) {
        return new AsfTag();
    } else if (SupportedFileFormat.WAV.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.')))) {
        return new WavTag(TagOptionSingleton.getInstance().getWavOptions());
    } else if (SupportedFileFormat.RA.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.')))) {
        return new RealTag();
    } else if (SupportedFileFormat.RM.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.')))) {
        return new RealTag();
    } else if (SupportedFileFormat.AIF.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.')))) {
        return new AiffTag();
    } else if (SupportedFileFormat.AIFC.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.')))) {
        return new AiffTag();
    } else if (SupportedFileFormat.AIFF.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.')))) {
        return new AiffTag();
    } else {
        throw new RuntimeException("Unable to create default tag for this file format");
    }

}
 
开发者ID:Old-Geek,项目名称:Musique,代码行数:31,代码来源:AudioFile.java


示例7: getTag

import org.jaudiotagger.tag.asf.AsfTag; //导入依赖的package包/类
/**
 * (overridden)
 * 
 * @see org.jaudiotagger.audio.generic.AudioFileReader#getTag(java.io.RandomAccessFile)
 */
@Override
protected AsfTag getTag(final RandomAccessFile raf)
        throws CannotReadException, IOException {
    raf.seek(0);
    AsfTag tag;
    try {
        final AsfHeader header = AsfHeaderReader.readTagHeader(raf);
        if (header == null) {
            throw new CannotReadException(
                    "Some values must have been "
                            + "incorrect for interpretation as asf with wma content.");
        }

        tag = TagConverter.createTagOf(header);

    } catch (final Exception e) {
        logger.severe(e.getMessage());
        if (e instanceof IOException) {
            throw (IOException) e;
        } else if (e instanceof CannotReadException) {
            throw (CannotReadException) e;
        } else {
            throw new CannotReadException("Failed to read. Cause: "
                    + e.getMessage());
        }
    }
    return tag;
}
 
开发者ID:Dynious,项目名称:SoundsCool,代码行数:34,代码来源:AsfFileReader.java


示例8: deleteTag

import org.jaudiotagger.tag.asf.AsfTag; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void deleteTag(final RandomAccessFile raf,
        final RandomAccessFile tempRaf) throws CannotWriteException,
        IOException {
    writeTag(new AsfTag(true), raf, tempRaf);
}
 
开发者ID:Dynious,项目名称:SoundsCool,代码行数:10,代码来源:AsfFileWriter.java


示例9: deleteTag

import org.jaudiotagger.tag.asf.AsfTag; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void deleteTag(Tag tag, final RandomAccessFile raf, final RandomAccessFile tempRaf) throws CannotWriteException, IOException
{
    writeTag(null, new AsfTag(true), raf, tempRaf);
}
 
开发者ID:GlennioTech,项目名称:MetadataEditor,代码行数:9,代码来源:AsfFileWriter.java


示例10: writeTag

import org.jaudiotagger.tag.asf.AsfTag; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void writeTag(AudioFile audioFile, final Tag tag, final RandomAccessFile raf, final RandomAccessFile rafTemp) throws CannotWriteException, IOException
{
    /*
     * Since this implementation should not change the structure of the ASF
     * file (locations of content description chunks), we need to read the
     * content description chunk and the extended content description chunk
     * from the source file. In the second step we need to determine which
     * modifier (asf header or asf extended header) gets the appropriate
     * modifiers. The following policies are applied: if the source does not
     * contain any descriptor, the necessary descriptors are appended to the
     * header object.
     * 
     * if the source contains only one descriptor in the header extension
     * object, and the other type is needed as well, the other one will be
     * put into the header extension object.
     * 
     * for each descriptor type, if an object is found, an updater will be
     * configured.
     */
    final AsfHeader sourceHeader = AsfHeaderReader.readTagHeader(raf);
    raf.seek(0); // Reset for the streamer
    /*
     * Now createField modifiers for metadata descriptor and extended content
     * descriptor as implied by the given Tag.
     */
    // TODO not convinced that we need to copy fields here
    final AsfTag copy = new AsfTag(tag, true);
    final MetadataContainer[] distribution = TagConverter.distributeMetadata(copy);
    final boolean[] existHeader = searchExistence(sourceHeader, distribution);
    final boolean[] existExtHeader = searchExistence(sourceHeader.getExtendedHeader(), distribution);
    // Modifiers for the asf header object
    final List<ChunkModifier> headerModifier = new ArrayList<ChunkModifier>();
    // Modifiers for the asf header extension object
    final List<ChunkModifier> extHeaderModifier = new ArrayList<ChunkModifier>();
    for (int i = 0; i < distribution.length; i++)
    {
        final WriteableChunkModifer modifier = new WriteableChunkModifer(distribution[i]);
        if (existHeader[i])
        {
            // Will remove or modify chunks in ASF header
            headerModifier.add(modifier);
        }
        else if (existExtHeader[i])
        {
            // Will remove or modify chunks in extended header
            extHeaderModifier.add(modifier);
        }
        else
        {
            // Objects (chunks) will be added here.
            if (i == 0 || i == 2 || i == 1)
            {
                // Add content description and extended content description
                // at header for maximum compatibility
                headerModifier.add(modifier);
            }
            else
            {
                // For now, the rest should be created at extended header
                // since other positions aren't known.
                extHeaderModifier.add(modifier);
            }
        }
    }
    // only addField an AsfExtHeaderModifier, if there is actually something to
    // change (performance)
    if (!extHeaderModifier.isEmpty())
    {
        headerModifier.add(new AsfExtHeaderModifier(extHeaderModifier));
    }
    new AsfStreamer().createModifiedCopy(new RandomAccessFileInputstream(raf), new RandomAccessFileOutputStream(rafTemp), headerModifier);
}
 
开发者ID:GlennioTech,项目名称:MetadataEditor,代码行数:77,代码来源:AsfFileWriter.java


示例11: createDefaultTag

import org.jaudiotagger.tag.asf.AsfTag; //导入依赖的package包/类
/** Create Default Tag
 *
 * @return
 */
public Tag createDefaultTag()
{
    String extension = getExt();
    if(extension == null)
    {
        String fileName = file.getName();
        extension = fileName.substring(fileName.lastIndexOf('.') + 1);
        setExt(extension);
    }
    if(SupportedFileFormat.FLAC.getFilesuffix().equals(extension))
    {
        return new FlacTag(VorbisCommentTag.createNewTag(), new ArrayList< MetadataBlockDataPicture >());
    }
    else if(SupportedFileFormat.OGG.getFilesuffix().equals(extension))
    {
        return VorbisCommentTag.createNewTag();
    }
    else if(SupportedFileFormat.MP4.getFilesuffix().equals(extension))
    {
        return new Mp4Tag();
    }
    else if(SupportedFileFormat.M4A.getFilesuffix().equals(extension))
    {
        return new Mp4Tag();
    }
    else if(SupportedFileFormat.M4P.getFilesuffix().equals(extension))
    {
        return new Mp4Tag();
    }
    else if(SupportedFileFormat.WMA.getFilesuffix().equals(extension))
    {
        return new AsfTag();
    }
    else if(SupportedFileFormat.WAV.getFilesuffix().equals(extension))
    {
        return new WavTag(TagOptionSingleton.getInstance().getWavOptions());
    }
    else if(SupportedFileFormat.RA.getFilesuffix().equals(extension))
    {
        return new RealTag();
    }
    else if(SupportedFileFormat.RM.getFilesuffix().equals(extension))
    {
        return new RealTag();
    }
    else if(SupportedFileFormat.AIF.getFilesuffix().equals(extension))
    {
        return new AiffTag();
    }
    else if(SupportedFileFormat.AIFC.getFilesuffix().equals(extension))
    {
        return new AiffTag();
    }
    else if(SupportedFileFormat.AIFF.getFilesuffix().equals(extension))
    {
        return new AiffTag();
    }
    else if(SupportedFileFormat.DSF.getFilesuffix().equals(extension))
    {
        return Dsf.createDefaultTag();
    }
    else
    {
        throw new RuntimeException("Unable to create default tag for this file format");
    }

}
 
开发者ID:GlennioTech,项目名称:MetadataEditor,代码行数:72,代码来源:AudioFile.java


示例12: writeTag

import org.jaudiotagger.tag.asf.AsfTag; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void writeTag(final Tag tag, final RandomAccessFile raf,
                        final RandomAccessFile rafTemp) throws CannotWriteException,
        IOException {
    /*
     * Since this implementation should not change the structure of the ASF
     * file (locations of content description chunks), we need to read the
     * content description chunk and the extended content description chunk
     * from the source file. In the second step we need to determine which
     * modifier (asf header or asf extended header) gets the appropriate
     * modifiers. The following policies are applied: if the source does not
     * contain any descriptor, the necessary descriptors are appended to the
     * header object.
     * 
     * if the source contains only one descriptor in the header extension
     * object, and the other type is needed as well, the other one will be
     * put into the header extension object.
     * 
     * for each descriptor type, if an object is found, an updater will be
     * configured.
     */
    final AsfHeader sourceHeader = AsfHeaderReader.readTagHeader(raf);
    raf.seek(0); // Reset for the streamer
    /*
     * Now createField modifiers for metadata descriptor and extended content
     * descriptor as implied by the given Tag.
     */
    // TODO not convinced that we need to copy fields here
    final AsfTag copy = new AsfTag(tag, true);
    final MetadataContainer[] distribution = TagConverter
            .distributeMetadata(copy);
    final boolean[] existHeader = searchExistence(sourceHeader,
            distribution);
    final boolean[] existExtHeader = searchExistence(sourceHeader
            .getExtendedHeader(), distribution);
    // Modifiers for the asf header object
    final List<ChunkModifier> headerModifier = new ArrayList<ChunkModifier>();
    // Modifiers for the asf header extension object
    final List<ChunkModifier> extHeaderModifier = new ArrayList<ChunkModifier>();
    for (int i = 0; i < distribution.length; i++) {
        final WriteableChunkModifer modifier = new WriteableChunkModifer(
                distribution[i]);
        if (existHeader[i]) {
            // Will remove or modify chunks in ASF header
            headerModifier.add(modifier);
        } else if (existExtHeader[i]) {
            // Will remove or modify chunks in extended header
            extHeaderModifier.add(modifier);
        } else {
            // Objects (chunks) will be added here.
            if (i == 0 || i == 2 || i == 1) {
                // Add content description and extended content description
                // at header for maximum compatibility
                headerModifier.add(modifier);
            } else {
                // For now, the rest should be created at extended header
                // since other positions aren't known.
                extHeaderModifier.add(modifier);
            }
        }
    }
    // only addField an AsfExtHeaderModifier, if there is actually something to
    // change (performance)
    if (!extHeaderModifier.isEmpty()) {
        headerModifier.add(new AsfExtHeaderModifier(extHeaderModifier));
    }
    new AsfStreamer()
            .createModifiedCopy(new RandomAccessFileInputstream(raf),
                    new RandomAccessFileOutputStream(rafTemp),
                    headerModifier);
}
 
开发者ID:openaudible,项目名称:openaudible,代码行数:75,代码来源:AsfFileWriter.java


示例13: deleteTag

import org.jaudiotagger.tag.asf.AsfTag; //导入依赖的package包/类
@Override
protected void deleteTag(Tag tag, final RandomAccessFile raf, final RandomAccessFile tempRaf) throws CannotWriteException,
        IOException {
    writeTag(null, new AsfTag(true), raf, tempRaf);
}
 
开发者ID:Old-Geek,项目名称:Musique,代码行数:6,代码来源:AsfFileWriter.java


示例14: writeTag

import org.jaudiotagger.tag.asf.AsfTag; //导入依赖的package包/类
@Override
protected void writeTag(AudioFile audioFile, final Tag tag, final RandomAccessFile raf, final RandomAccessFile rafTemp) throws CannotWriteException,
        IOException {
    /*
     * Since this implementation should not change the structure of the ASF
     * file (locations of content description chunks), we need to read the
     * content description chunk and the extended content description chunk
     * from the source file. In the second step we need to determine which
     * modifier (asf header or asf extended header) gets the appropriate
     * modifiers. The following policies are applied: if the source does not
     * contain any descriptor, the necessary descriptors are appended to the
     * header object.
     * 
     * if the source contains only one descriptor in the header extension
     * object, and the other type is needed as well, the other one will be
     * put into the header extension object.
     * 
     * for each descriptor type, if an object is found, an updater will be
     * configured.
     */
    final AsfHeader sourceHeader = AsfHeaderReader.readTagHeader(raf);
    raf.seek(0); // Reset for the streamer
    /*
     * Now createField modifiers for metadata descriptor and extended content
     * descriptor as implied by the given Tag.
     */
    // TODO not convinced that we need to copy fields here
    final AsfTag copy = new AsfTag(tag, true);
    final MetadataContainer[] distribution = TagConverter.distributeMetadata(copy);
    final boolean[] existHeader = searchExistence(sourceHeader, distribution);
    final boolean[] existExtHeader = searchExistence(sourceHeader.getExtendedHeader(), distribution);
    // Modifiers for the asf header object
    final List<ChunkModifier> headerModifier = new ArrayList<>();
    // Modifiers for the asf header extension object
    final List<ChunkModifier> extHeaderModifier = new ArrayList<>();
    for (int i = 0; i < distribution.length; i++) {
        final WriteableChunkModifer modifier = new WriteableChunkModifer(distribution[i]);
        if (existHeader[i]) {
            // Will remove or modify chunks in ASF header
            headerModifier.add(modifier);
        } else if (existExtHeader[i]) {
            // Will remove or modify chunks in extended header
            extHeaderModifier.add(modifier);
        } else {
            // Objects (chunks) will be added here.
            if (i == 0 || i == 2 || i == 1) {
                // Add content description and extended content description
                // at header for maximum compatibility
                headerModifier.add(modifier);
            } else {
                // For now, the rest should be created at extended header
                // since other positions aren't known.
                extHeaderModifier.add(modifier);
            }
        }
    }
    // only addField an AsfExtHeaderModifier, if there is actually something to
    // change (performance)
    if (!extHeaderModifier.isEmpty()) {
        headerModifier.add(new AsfExtHeaderModifier(extHeaderModifier));
    }
    new AsfStreamer()
            .createModifiedCopy(new RandomAccessFileInputstream(raf),
                    new RandomAccessFileOutputStream(rafTemp),
                    headerModifier);
}
 
开发者ID:Old-Geek,项目名称:Musique,代码行数:67,代码来源:AsfFileWriter.java


示例15: isCommon

import org.jaudiotagger.tag.asf.AsfTag; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public boolean isCommon() {
    // HashSet is safe against null comparison
    return AsfTag.COMMON_FIELDS.contains(AsfFieldKey
            .getAsfFieldKey(getId()));
}
 
开发者ID:Dynious,项目名称:SoundsCool,代码行数:9,代码来源:AsfTagField.java


示例16: writeTag

import org.jaudiotagger.tag.asf.AsfTag; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void writeTag(final Tag tag, final RandomAccessFile raf,
        final RandomAccessFile rafTemp) throws CannotWriteException,
        IOException {
    /*
     * Since this implementation should not change the structure of the ASF
     * file (locations of content description chunks), we need to read the
     * content description chunk and the extended content description chunk
     * from the source file. In the second step we need to determine which
     * modifier (asf header or asf extended header) gets the appropriate
     * modifiers. The following policies are applied: if the source does not
     * contain any descriptor, the necessary descriptors are appended to the
     * header object.
     * 
     * if the source contains only one descriptor in the header extension
     * object, and the other type is needed as well, the other one will be
     * put into the header extension object.
     * 
     * for each descriptor type, if an object is found, an updater will be
     * configured.
     */
    final AsfHeader sourceHeader = AsfHeaderReader.readTagHeader(raf);
    raf.seek(0); // Reset for the streamer
    /*
     * Now createField modifiers for metadata descriptor and extended content
     * descriptor as implied by the given Tag.
     */
    // TODO not convinced that we need to copy fields here
    final AsfTag copy = new AsfTag(tag, true);
    final MetadataContainer[] distribution = TagConverter
            .distributeMetadata(copy);
    final boolean[] existHeader = searchExistence(sourceHeader,
            distribution);
    final boolean[] existExtHeader = searchExistence(sourceHeader
            .getExtendedHeader(), distribution);
    // Modifiers for the asf header object
    final List<ChunkModifier> headerModifier = new ArrayList<ChunkModifier>();
    // Modifiers for the asf header extension object
    final List<ChunkModifier> extHeaderModifier = new ArrayList<ChunkModifier>();
    for (int i = 0; i < distribution.length; i++) {
        final WriteableChunkModifer modifier = new WriteableChunkModifer(
                distribution[i]);
        if (existHeader[i]) {
            // Will remove or modify chunks in ASF header
            headerModifier.add(modifier);
        } else if (existExtHeader[i]) {
            // Will remove or modify chunks in extended header
            extHeaderModifier.add(modifier);
        } else {
            // Objects (chunks) will be added here.
            if (i == 0 || i == 2 || i == 1) {
                // Add content description and extended content description
                // at header for maximum compatibility
                headerModifier.add(modifier);
            } else {
                // For now, the rest should be created at extended header
                // since other positions aren't known.
                extHeaderModifier.add(modifier);
            }
        }
    }
    // only addField an AsfExtHeaderModifier, if there is actually something to
    // change (performance)
    if (!extHeaderModifier.isEmpty()) {
        headerModifier.add(new AsfExtHeaderModifier(extHeaderModifier));
    }
    new AsfStreamer()
            .createModifiedCopy(new RandomAccessFileInputstream(raf),
                    new RandomAccessFileOutputStream(rafTemp),
                    headerModifier);
}
 
开发者ID:Dynious,项目名称:SoundsCool,代码行数:75,代码来源:AsfFileWriter.java


示例17: createDefaultTag

import org.jaudiotagger.tag.asf.AsfTag; //导入依赖的package包/类
/** Create Default Tag
 *
 * @return
 */
public Tag createDefaultTag()
{
    if(SupportedFileFormat.FLAC.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.'))))
    {
        return new FlacTag(VorbisCommentTag.createNewTag(), new ArrayList< MetadataBlockDataPicture >());
    }
    else if(SupportedFileFormat.OGG.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.'))))
    {
        return VorbisCommentTag.createNewTag();
    }
    else if(SupportedFileFormat.MP4.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.'))))
    {
        return new Mp4Tag();
    }
    else if(SupportedFileFormat.M4A.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.'))))
    {
        return new Mp4Tag();
    }
    else if(SupportedFileFormat.M4P.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.'))))
    {
        return new Mp4Tag();
    }
    else if(SupportedFileFormat.WMA.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.'))))
    {
        return new AsfTag();
    }
    else if(SupportedFileFormat.WAV.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.'))))
    {
        return new WavTag();
    }
    else if(SupportedFileFormat.RA.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.'))))
    {
        return new RealTag();
    }
    else if(SupportedFileFormat.RM.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.'))))
    {
        return new RealTag();
    }
    else if(SupportedFileFormat.AIF.getFilesuffix().equals(file.getName().substring(file.getName().lastIndexOf('.'))))
    {
        return new AiffTag();
    }
    else
    {
        throw new RuntimeException("Unable to create default tag for this file format");
    }

}
 
开发者ID:Dynious,项目名称:SoundsCool,代码行数:53,代码来源:AudioFile.java



注:本文中的org.jaudiotagger.tag.asf.AsfTag类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FairSchedulerTestBase类代码示例发布时间:2022-05-15
下一篇:
Java ServiceQuestions类代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap