setArtist method

void setArtist(
  1. String? artist
)

Implementation

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