Skip to content

Commit

Permalink
[Docs]
Browse files Browse the repository at this point in the history
  • Loading branch information
FMotalleb committed Nov 7, 2023
1 parent ec115b7 commit 54c26cc
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,54 @@

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 play - play an audio file, by default supports flac,Wav,mp3 and ogg files, install plugin with `all-decoders` feature to include aac and mp* (audio)

## Examples

* to create a simple noise:

```bash
~> sound make 1000 200ms
```

* create a simple noise sequence

```bash
~> [ 300.0, 500.0, 1000.0, 400.0, 600.0 ] | each { |it| sound make $it 150ms }
```
* play first 3seconds of an audio
```bash
~> sound play audio.mp3 -d 3sec
```
* load metadata of an audio file
```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 correctly play a mp3 audio file you need to first load its metadata and then use its duration to play it
```bash
~> sound meta audio.mp4 | sound play audio.mp3 -d $in.duration
```
## Installing
* supported features:
Expand Down

0 comments on commit 54c26cc

Please sign in to comment.