# nu_plugin_audio_hook
A [nushell](https://www.nushell.sh/) plugin to make and play sounds
## Usage
* sound beep - play a beep sound
* sound make - creates a noise with given frequency and duration
* sound meta - get duration and meta data of an audio file
* sound meta set - set id3 frame on the audio file (more about [id3 frames](https://docs.puddletag.net/source/id3.html))
* sound play - play an audio file, by default supports flac,Wav,mp3 and ogg files, install plugin with `all-decoders` feature to include aac and mp4 (audio)
## Examples
* to create a simple noise:
```bash
~> sound make 1000 200ms
```
* create a simple noise sequence
```bash
```bash
~> sound meta audio.mp4
╭──────────────┬────────────────────────────╮
│ duration │ 4min 5sec 551ms 20µs 408ns │
│ artist │ SINGER │
│ title │ TITLE │
│ album │ ALBUM │
│ album_artist │ SINGER │
│ track_no │ 1 │
│ total_tracks │ 1 │
╰──────────────┴────────────────────────────╯
```
* to change an id3 frame you can use this command (more about [id3 frames](https://docs.puddletag.net/source/id3.html))
```bash
~> sound meta set audio.mp3 -k TPE1 -v new-artist
╭──────────────┬────────────────────────────╮
│ duration │ 4min 5sec 551ms 20µs 408ns │
│ artist │ new-artist │
│ title │ TITLE │
│ album │ ALBUM │
│ album_artist │ SINGER │
│ track_no │ 1 │
│ total_tracks │ 1 │
╰──────────────┴────────────────────────────╯
```
* to correctly play a mp3 audio file you need to first load its metadata and then use its duration to play it
```bash
```bash
cargo install nu_plugin_audio_hook --features=all-decoders
register ~/.cargo/bin/nu_plugin_audio_hook
```