Skip to content

Commit

Permalink
v2.0.5: Improve input device configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
GiviMAD committed Jul 22, 2023
1 parent 525063b commit b12bae8
Show file tree
Hide file tree
Showing 6 changed files with 166 additions and 76 deletions.
109 changes: 75 additions & 34 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rustpotter-cli"
version = "2.0.4"
version = "2.0.5"
edition = "2021"
license = "Apache-2.0"
description = "CLI for Rustpotter, an open source wakeword spotter forged in rust."
Expand All @@ -12,5 +12,6 @@ rustpotter = { version = "2.0.1", features = ["debug", "internals"] }
ctrlc = "3.2.2"
clap = { version = "4.1.6", features = ["derive"] }
hound = "3.4.0"
cpal = "0.15.0"
cpal = "0.15.2"
time = "0.3.20"
gag = "1.0.0"
28 changes: 15 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ For instance on debian it can be installed like:

```bash
# This command print your arch, just in case you don't remember it.
uname -m
$ uname -m
# Here I used the armv7l binary
curl -OL https://github.com/GiviMAD/rustpotter-cli/releases/download/v2.0.4/rustpotter-cli_debian_armv7l
$ curl -OL https://github.com/GiviMAD/rustpotter-cli/releases/download/v2.0.5/rustpotter-cli_debian_armv7l
# Make executable
chmod +x rustpotter-cli_debian_armv7l
$ chmod +x rustpotter-cli_debian_armv7l
# Check simple execution
./rustpotter-cli_debian_armv7l --version
# Rename it to ruspotter-cli and move it to a location on your PATH.
sudo mv ./rustpotter-cli_debian_armv7l /usr/local/bin/rustpotter-cli
$ ./rustpotter-cli_debian_armv7l --version
# Make available as ruspotter-cli
$ sudo mv ./rustpotter-cli_debian_armv7l /usr/local/bin/rustpotter-cli
```

# How to used it.
Expand All @@ -38,6 +38,8 @@ sudo mv ./rustpotter-cli_debian_armv7l /usr/local/bin/rustpotter-cli
Your can list the available audio sources with the `devices` command,
the `--configs` option can be added to display the default and available record formats for each source.

Host warnings are hidden by default, you can enable them by providing the `--host-warnings` option.

Every device and config has a numerical id to the left which is the one you can use on the other commands (`record` and `spot`)
to change its audio source and format.

Expand All @@ -46,20 +48,20 @@ In some systems to many configurations are displayed you can filter them by max
This is an example run on macOS:

```bash
$ rustpotter-cli devices -c
$ rustpotter-cli devices -c -m 1
Audio hosts:
- CoreAudio
Default input device:
- MacBook Pro Microphone
Available Devices:
0 - MacBook Pro Microphone
Default input stream config:
- Sample Rate: 48000, Channels: 1, Format: f32
- Sample Rate: 48000, Channels: 1, Format: f32, Supported: true
All supported input stream configs:
0 - Sample Rate: 44100, Channels: 1, Format: f32
1 - Sample Rate: 48000, Channels: 1, Format: f32
2 - Sample Rate: 88200, Channels: 1, Format: f32
3 - Sample Rate: 96000, Channels: 1, Format: f32
0 - Sample Rate: 44100, Channels: 1, Format: f32, Supported: true
1 - Sample Rate: 48000, Channels: 1, Format: f32, Supported: true
2 - Sample Rate: 88200, Channels: 1, Format: f32, Supported: true
3 - Sample Rate: 96000, Channels: 1, Format: f32, Supported: true
```

## Recording audio samples
Expand All @@ -74,7 +76,7 @@ This is an example run on macOS:
```bash
$ rustpotter-cli record good_morning.wav
Input device: MacBook Pro Microphone
Input device config: SupportedStreamConfig { channels: 1, sample_rate: SampleRate(48000), buffer_size: Range { min: 15, max: 4096 }, sample_format: F32 }
Input device config: Sample Rate: 48000, Channels: 1, Format: f32
Begin recording...
Press 'Ctrl + c' to stop.
^CRecording good_morning.wav complete!
Expand Down
Loading

0 comments on commit b12bae8

Please sign in to comment.