Skip to content

Commit

Permalink
Update README.md to add instructions for updating custom tags
Browse files Browse the repository at this point in the history
  • Loading branch information
ewilan-riviere committed Oct 3, 2024
1 parent e01c977 commit 831bf67
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,24 @@ $audio->getCreationDate(); // `null` because `creationDate` is not supported by

Some properties are not supported by all formats, for example `MP3` can't handle some properties like `lyrics` or `stik`, if you try to update these properties, they will be ignored.

#### Update one custom tag

You can update one custom tag with `tag` method.

```php
use Kiwilan\Audio\Audio;

$audio = Audio::read('path/to/audio.mp3');
$audio->write()
->tag('custom-a', 'New Custom a Tag')
->tag('custom-b', 'New Custom b Tag')
->save();

$audio = Audio::read('path/to/audio.mp3');
$audio->getRawKey('custom-a'); // `New Custom a Tag`
$audio->getRawKey('custom-b'); // `New Custom b Tag`
```

#### Set tags manually

You can set tags manually with `tags` method, but you need to know the format of the tag, you could use `tagFormats` to set formats of tags (if you don't know the format, it will be automatically detected).
Expand Down

0 comments on commit 831bf67

Please sign in to comment.