|
| 1 | +# lambda-audio |
| 2 | + |
| 3 | +`lambda-audio` is a small CLI tool for inspecting and playing sound files using |
| 4 | +the `lambda` audio APIs. |
| 5 | + |
| 6 | +Scope |
| 7 | +- Load sound files into `lambda::audio::SoundBuffer`. |
| 8 | +- Print decoded metadata (sample rate, channels, duration). |
| 9 | +- Render a small ASCII waveform preview. |
| 10 | +- Play the decoded audio via the default output device. |
| 11 | + |
| 12 | +## Usage |
| 13 | + |
| 14 | +From the repository root: |
| 15 | + |
| 16 | +```bash |
| 17 | +cargo run -p lambda-audio-tool -- <command> [path] |
| 18 | +``` |
| 19 | + |
| 20 | +Commands |
| 21 | +- `info <path>`: decode and print metadata. |
| 22 | +- `view <path>`: decode, print metadata, and show an ASCII waveform preview. |
| 23 | +- `play <path>`: decode, print metadata, and play through the default output |
| 24 | + device. |
| 25 | +- `list-devices`: list available output devices (platform-dependent). |
| 26 | + |
| 27 | +Supported file types |
| 28 | +- `.wav` |
| 29 | +- `.ogg` / `.oga` (Vorbis) |
| 30 | + |
| 31 | +## Examples (slash fixture) |
| 32 | + |
| 33 | +The repository includes an OGG Vorbis fixture at: |
| 34 | +`crates/lambda-rs-platform/assets/audio/slash_vorbis_stereo_48000.ogg`. |
| 35 | + |
| 36 | +### `info` |
| 37 | + |
| 38 | +```bash |
| 39 | +cargo run -p lambda-audio-tool -- info \ |
| 40 | + crates/lambda-rs-platform/assets/audio/slash_vorbis_stereo_48000.ogg |
| 41 | +``` |
| 42 | + |
| 43 | +Example output: |
| 44 | + |
| 45 | +```text |
| 46 | +path: crates/lambda-rs-platform/assets/audio/slash_vorbis_stereo_48000.ogg |
| 47 | +sample_rate: 48000 |
| 48 | +channels: 2 |
| 49 | +frames: 53824 |
| 50 | +samples: 107648 |
| 51 | +duration_seconds: 1.121 |
| 52 | +``` |
| 53 | + |
| 54 | +### `view` |
| 55 | + |
| 56 | +```bash |
| 57 | +cargo run -p lambda-audio-tool -- view \ |
| 58 | + crates/lambda-rs-platform/assets/audio/slash_vorbis_stereo_48000.ogg |
| 59 | +``` |
| 60 | + |
| 61 | +Example output: |
| 62 | + |
| 63 | +```text |
| 64 | +path: crates/lambda-rs-platform/assets/audio/slash_vorbis_stereo_48000.ogg |
| 65 | +sample_rate: 48000 |
| 66 | +channels: 2 |
| 67 | +frames: 53824 |
| 68 | +samples: 107648 |
| 69 | +duration_seconds: 1.121 |
| 70 | +
|
| 71 | + ### |
| 72 | + ##### |
| 73 | + ###### |
| 74 | + ###### |
| 75 | + ###### |
| 76 | + ######## # |
| 77 | + ############# |
| 78 | + ################# |
| 79 | + ########################### |
| 80 | +``` |
| 81 | + |
| 82 | +### `play` |
| 83 | + |
| 84 | +```bash |
| 85 | +cargo run -p lambda-audio-tool -- play \ |
| 86 | + crates/lambda-rs-platform/assets/audio/slash_vorbis_stereo_48000.ogg |
| 87 | +``` |
| 88 | + |
| 89 | +Example output (audio plays, then the process exits): |
| 90 | + |
| 91 | +```text |
| 92 | +path: crates/lambda-rs-platform/assets/audio/slash_vorbis_stereo_48000.ogg |
| 93 | +sample_rate: 48000 |
| 94 | +channels: 2 |
| 95 | +frames: 53824 |
| 96 | +samples: 107648 |
| 97 | +duration_seconds: 1.121 |
| 98 | +``` |
| 99 | + |
| 100 | +### `list-devices` |
| 101 | + |
| 102 | +```bash |
| 103 | +cargo run -p lambda-audio-tool -- list-devices |
| 104 | +``` |
| 105 | + |
| 106 | +Example output (varies by machine and environment): |
| 107 | + |
| 108 | +```text |
| 109 | +no output devices found |
| 110 | +``` |
0 commit comments