jack-server


Namejack-server JSON
Version 0.2.0 PyPI version JSON
download
home_page
SummaryControl JACK server with Python
upload_time2024-01-31 17:53:51
maintainer
docs_urlNone
authorLev Vereshchagin
requires_python>=3.8,<4.0
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Test](https://github.com/vrslev/jack_server/actions/workflows/test.yml/badge.svg)](https://github.com/vrslev/jack_server/actions/workflows/test.yml)

Control [JACK](https://jackaudio.org/) audio server with Python.
Can be used as replacement for [jackd](https://manpages.debian.org/buster/jackd2/jackd.1.en.html) for more robust configuration, for example, when using [`jack`](https://github.com/spatialaudio/jackclient-python) package.

## Installation

`pip install jack_server`

Also you need to have `jackserver` library on your machine, it comes with [JACK2](https://github.com/jackaudio/jack2). I had problems with apt-package on Ubuntu (`jackd2`), if you do too, compile jack yourself.

## Usage

### 🎛 `jack_server.Server`

On server creation you _can_ specify some parameters:

```python
import jack_server

server = jack_server.Server(
    name="myfancyserver",
    sync=True,
    realtime=False,
    driver="coreaudio",
    device="BuiltInSpeakerDevice",
    rate=48000,
    period=1024,
    # nperiods=2  # Work only with `alsa` driver
)
server.start()

input()
```

They are actually an equivalent of `jackd` flags:

- `-n`, `--name` to `name`,
- `-S`, `--sync` to `sync`,
- `-R`, `--realtime`, `-r`, `--no-realtime` to `realtime`,
- `-d` to `driver`,

And driver arguments:

- `-d`, `--device` to `device`,
- `-r`, `--rate` to `rate`,
- `-p`, `--period` to `period`,

#### `start(self) -> None`

_Open_ and _start_ the server. All state controlling methods are idempotent.

#### `stop(self) -> None`

Stop and close server.

#### `driver: jack_server.Driver`

Selected driver.

#### `name: str`

Actual server name. It is property that calls C code, so you can actually set the name.

#### `sync: bool`

Whether JACK runs in sync mode. Useful when you`re trying to send and receive multichannel audio.

#### `realtime: bool`

Whether JACK should start in realtime mode.

#### `params: dict[str, jack_server.Parameter]`

Server parameters mapped by name.

### 💼 `jack_server.Driver`

Driver (JACK backend), can be safely changed before server is started. Not supposed to be created by user code.

#### `name: str`

Driver name, read-only.

#### `device: str`

Selected device.

#### `rate: jack_server.SampleRate`

Sampling rate.

#### `period: int`

Buffer size.

#### `nperiods: int`

Number of periods. 2 is right for motherboard, PCI, PCI-X, etc.; 3 for USB ([source](https://wiki.archlinux.org/title/JACK_Audio_Connection_Kit)).

Can be helpful when tailoring performance on jittery systems.

#### `params: dict[str, jack_server.Parameter]`

Driver parameters mapped by name.

### 📻 `jack_server.SampleRate`

Valid sampling rate, `44100` or `48000`.

### 🔻 `jack_server.Parameter`

Not supposed to be created by user code.

#### `name: str`

Read-only verbose name of parameter.

#### `value: int | str | bytes | bool`

Value of the parameter, can be changed.

### ❗️ `jack_server.set_info_function(callback: Callable[[str], None] | None) -> None`

Set info output handler. By default JACK does is itself, i. e. output is being printed in stdout.

### ‼️ `jack_server.set_error_function(callback: Callable[[str], None] | None) -> None`

Set error output handler. By default JACK does is itself, i. e. output is being printed in stderr.


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "jack-server",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Lev Vereshchagin",
    "author_email": "mail@vrslev.com",
    "download_url": "https://files.pythonhosted.org/packages/47/c2/55f6b52c7fdfbbf06f84c13c23f0d0ae9bb56e23749fca27b807a0c3909c/jack_server-0.2.0.tar.gz",
    "platform": null,
    "description": "[![Test](https://github.com/vrslev/jack_server/actions/workflows/test.yml/badge.svg)](https://github.com/vrslev/jack_server/actions/workflows/test.yml)\n\nControl [JACK](https://jackaudio.org/) audio server with Python.\nCan be used as replacement for [jackd](https://manpages.debian.org/buster/jackd2/jackd.1.en.html) for more robust configuration, for example, when using [`jack`](https://github.com/spatialaudio/jackclient-python) package.\n\n## Installation\n\n`pip install jack_server`\n\nAlso you need to have `jackserver` library on your machine, it comes with [JACK2](https://github.com/jackaudio/jack2). I had problems with apt-package on Ubuntu (`jackd2`), if you do too, compile jack yourself.\n\n## Usage\n\n### \ud83c\udf9b `jack_server.Server`\n\nOn server creation you _can_ specify some parameters:\n\n```python\nimport jack_server\n\nserver = jack_server.Server(\n    name=\"myfancyserver\",\n    sync=True,\n    realtime=False,\n    driver=\"coreaudio\",\n    device=\"BuiltInSpeakerDevice\",\n    rate=48000,\n    period=1024,\n    # nperiods=2  # Work only with `alsa` driver\n)\nserver.start()\n\ninput()\n```\n\nThey are actually an equivalent of `jackd` flags:\n\n- `-n`, `--name` to `name`,\n- `-S`, `--sync` to `sync`,\n- `-R`, `--realtime`, `-r`, `--no-realtime` to `realtime`,\n- `-d` to `driver`,\n\nAnd driver arguments:\n\n- `-d`, `--device` to `device`,\n- `-r`, `--rate` to `rate`,\n- `-p`, `--period` to `period`,\n\n#### `start(self) -> None`\n\n_Open_ and _start_ the server. All state controlling methods are idempotent.\n\n#### `stop(self) -> None`\n\nStop and close server.\n\n#### `driver: jack_server.Driver`\n\nSelected driver.\n\n#### `name: str`\n\nActual server name. It is property that calls C code, so you can actually set the name.\n\n#### `sync: bool`\n\nWhether JACK runs in sync mode. Useful when you`re trying to send and receive multichannel audio.\n\n#### `realtime: bool`\n\nWhether JACK should start in realtime mode.\n\n#### `params: dict[str, jack_server.Parameter]`\n\nServer parameters mapped by name.\n\n### \ud83d\udcbc `jack_server.Driver`\n\nDriver (JACK backend), can be safely changed before server is started. Not supposed to be created by user code.\n\n#### `name: str`\n\nDriver name, read-only.\n\n#### `device: str`\n\nSelected device.\n\n#### `rate: jack_server.SampleRate`\n\nSampling rate.\n\n#### `period: int`\n\nBuffer size.\n\n#### `nperiods: int`\n\nNumber of periods. 2 is right for motherboard, PCI, PCI-X, etc.; 3 for USB ([source](https://wiki.archlinux.org/title/JACK_Audio_Connection_Kit)).\n\nCan be helpful when tailoring performance on jittery systems.\n\n#### `params: dict[str, jack_server.Parameter]`\n\nDriver parameters mapped by name.\n\n### \ud83d\udcfb `jack_server.SampleRate`\n\nValid sampling rate, `44100` or `48000`.\n\n### \ud83d\udd3b `jack_server.Parameter`\n\nNot supposed to be created by user code.\n\n#### `name: str`\n\nRead-only verbose name of parameter.\n\n#### `value: int | str | bytes | bool`\n\nValue of the parameter, can be changed.\n\n### \u2757\ufe0f `jack_server.set_info_function(callback: Callable[[str], None] | None) -> None`\n\nSet info output handler. By default JACK does is itself, i. e. output is being printed in stdout.\n\n### \u203c\ufe0f `jack_server.set_error_function(callback: Callable[[str], None] | None) -> None`\n\nSet error output handler. By default JACK does is itself, i. e. output is being printed in stderr.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Control JACK server with Python",
    "version": "0.2.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6a11804a6a2e5a2ef0890d19f00a4e709942e1f1ff7494ff9d38241f528a4ede",
                "md5": "41beffd5bd04a6bea30f4bd7032c4878",
                "sha256": "bc7e263c714377f58b4b75bc7546e75c916e07c1dc3a9e9175657b54b84a5bc2"
            },
            "downloads": -1,
            "filename": "jack_server-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "41beffd5bd04a6bea30f4bd7032c4878",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 8864,
            "upload_time": "2024-01-31T17:53:50",
            "upload_time_iso_8601": "2024-01-31T17:53:50.246209Z",
            "url": "https://files.pythonhosted.org/packages/6a/11/804a6a2e5a2ef0890d19f00a4e709942e1f1ff7494ff9d38241f528a4ede/jack_server-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "47c255f6b52c7fdfbbf06f84c13c23f0d0ae9bb56e23749fca27b807a0c3909c",
                "md5": "fab63aff92a320bb5661b8bcefb2c0d1",
                "sha256": "cd1838510cef2275110bf39c85faecbd24462c80b8c119c8d24b701e8285ad61"
            },
            "downloads": -1,
            "filename": "jack_server-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "fab63aff92a320bb5661b8bcefb2c0d1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 7920,
            "upload_time": "2024-01-31T17:53:51",
            "upload_time_iso_8601": "2024-01-31T17:53:51.836818Z",
            "url": "https://files.pythonhosted.org/packages/47/c2/55f6b52c7fdfbbf06f84c13c23f0d0ae9bb56e23749fca27b807a0c3909c/jack_server-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-31 17:53:51",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "jack-server"
}
        
Elapsed time: 1.79493s