Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac client example #123

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ online.init() # refresh if you're going to re-use the object for the next audio

`whisper_online_server.py` has the same model options as `whisper_online.py`, plus `--host` and `--port` of the TCP connection and the `--warmup-file`. See the help message (`-h` option).

Client example:
#### Client example on the Linux system:

```
arecord -f S16_LE -c1 -r 16000 -t raw -D default | nc localhost 43001
Expand All @@ -208,6 +208,28 @@ arecord -f S16_LE -c1 -r 16000 -t raw -D default | nc localhost 43001

- nc is netcat with server's host and port

#### Client example on the Mac system:

List of sounddevices:
SlavikCA marked this conversation as resolved.
Show resolved Hide resolved
```
ffmpeg -hide_banner -f avfoundation -list_devices true -i ""
```
This command will produce a list of audio devices with their corresponding IDs.
SlavikCA marked this conversation as resolved.
Show resolved Hide resolved
The output would look something like this:
```bash
...
[AVFoundation indev @ 0x123e05b20] AVFoundation audio devices:
[AVFoundation indev @ 0x123e05b20] [0] MacBook Air Microphone
[AVFoundation indev @ 0x123e05b20] [1] Device 1
[AVFoundation indev @ 0x123e05b20] [2] Device 2
...
```
Use the ID in the next command with the -i option. In this example I'm using a `MacBook Air` and the microphone is the device number `0`.

Live stream raw audio:
```
ffmpeg -hide_banner -f avfoundation -i ":0" -ac 1 -ar 16000 -f s16le -loglevel error - | nc localhost 43001
```

## Background

Expand Down