setLyric method

void setLyric(
  1. String? lyric
)

Implementation

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