Skip to main content

python version developed based on AudioDeviceCmdlets.

Project description

Description

AudioDeviceCmdlets is a suite of PowerShell Cmdlets to control audio devices on Windows

Features

Get list of all audio devices
Get default audio device (playback/recording)
Get default communication audio device (playback/recording)
Get volume and mute state of default audio device (playback/recording)
Get volume and mute state of default communication audio device (playback/recording)
Set default audio device (playback/recording)
Set default communication audio device (playback/recording)
Set volume and mute state of default audio device (playback/recording)
Set volume and mute state of default communication audio device (playback/recording)

Installation

pip install pyaudiodevice

Usage

from your_module_name import DefaultPlayback

# Get the default playback device's mute state as <bool>
is_mute = default_playback.get_is_mute()

# Get the default playback device's volume level on 100 as <float>
volume_level = default_playback.get_volume()

# Set the default playback device's mute state to the opposite of its current mute state
default_playback.toggle_mute()

# Set the default playback device's mute state to the given <bool>
default_playback.set_mute(True)

# Set the default playback device's volume level on 100 to the given <float>
default_playback.set_volume(0.5)

from pyaudiodevice.audio_common import AudioCommon

# Create an instance of DefaultPlayback
common = AudioCommon()

# Get the default playback device as <AudioDevice>
default_device = common.get_default_device()

# Get a list of all enabled devices as <AudioDevice>
device_list = common.get_audio_device_list()

# Get the device with the Index corresponding to the given <int>
device_info = common.get_audio_device_by_index(index)

# Get the device with the ID corresponding to the given <string>
device_info = common.get_audio_device_by_id(id)

Attribution

Based on code https://github.com/frgnca/AudioDeviceCmdlets

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyaudiodevice-1.0.7-py3-none-any.whl (23.8 kB view details)

Uploaded Python 3

File details

Details for the file pyaudiodevice-1.0.7-py3-none-any.whl.

File metadata

  • Download URL: pyaudiodevice-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 23.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for pyaudiodevice-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 666d354f03f681fa3e98ff1676d55bc1e75d7ff75a4be29c4be3cb91c4cdbb6e
MD5 7bb48eb493c382d57f75e13501992295
BLAKE2b-256 c5a8e3e735ea181252fa9b4c9ac25f74d79074890f53c8d261969f457cd8d712

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page