setGenre method

void setGenre(
  1. String? genre
)

Implementation

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