Skip to content

Conversation

@z-khan
Copy link
Contributor

@z-khan z-khan commented Jan 29, 2025

This PR relates to #702 and #816
This enhancement lets user to specify any PCM audio codec to be used instead of relying on FFMPEG default (PCM_S16LE) when opening an audio device. Other than user preference, this is needed because some audio devices will not open with the default 16-bit codec e.g. some Focusrite Scarlett audio devices.

Usage:

import av
av.open(file="alsa_device_name", format="alsa:pcm_s32le")

Credits to @Kazhuu, @WyattBlue

enable use of non-default audio codec to open an audio device with a certain host API.
e.g. use av.open(file="device_id",format="ALSA:pcm_s32le) to open with 32bit PCM in ffmpeg (default is pcm_s16le if not provided).
Some audio devices fail to open with the default codec, hence this is a useful addition.
add PCM audio codec IDs
change Enum access syntax
@Kazhuu
Copy link

Kazhuu commented Jan 29, 2025

Nice to see this getting in. I'm still in need for this feature actually 👍

@WyattBlue WyattBlue merged commit dd2d71a into PyAV-Org:main Jan 29, 2025
8 checks passed
@z-khan z-khan deleted the acodec branch July 31, 2025 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants