setComment method

void setComment(
  1. String? comment
)

Implementation

void setComment(String? comment) {
  if (comment != null) {
    for (final comment_ in _comments) {
      if (comment_.name == 'DESCRIPTION') {
        comment_.data = utf8.encode(comment);
        return;
      }
      if (comment_.name == 'COMMENT') {
        comment_.data = utf8.encode(comment);
        return;
      }
    }
    _comments.add(VorbisComment('DESCRIPTION', utf8.encode(comment)));
  } else {
    for (final comment_ in _comments) {
      if (comment_.name == 'DESCRIPTION') {
        _comments.remove(comment_);
        return;
      }
      if (comment_.name == 'COMMENT') {
        _comments.remove(comment_);
        return;
      }
    }
  }
}