volctl

Library to control system audio master volume.

License

License

MIT
GroupId

GroupId

com.github.bjoernpetersen
ArtifactId

ArtifactId

volctl
Last Version

Last Version

3.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

volctl
Library to control system audio master volume.
Project URL

Project URL

https://github.com/BjoernPetersen/volctl
Source Code Management

Source Code Management

https://github.com/BjoernPetersen/volctl

Download volctl

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.bjoernpetersen/volctl/ -->
<dependency>
    <groupId>com.github.bjoernpetersen</groupId>
    <artifactId>volctl</artifactId>
    <version>3.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.bjoernpetersen/volctl/
implementation 'com.github.bjoernpetersen:volctl:3.0.0'
// https://jarcasting.com/artifacts/com.github.bjoernpetersen/volctl/
implementation ("com.github.bjoernpetersen:volctl:3.0.0")
'com.github.bjoernpetersen:volctl:jar:3.0.0'
<dependency org="com.github.bjoernpetersen" name="volctl" rev="3.0.0">
  <artifact name="volctl" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.bjoernpetersen', module='volctl', version='3.0.0')
)
libraryDependencies += "com.github.bjoernpetersen" % "volctl" % "3.0.0"
[com.github.bjoernpetersen/volctl "3.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

volctl

GitHub (pre-)release GitHub license

A simple Java library providing access to audio volume control on Windows and Linux.

The library uses native C++ code to directly access the relevant system APIs, there are no further dependencies.

Note: This project is still maintained and will be updated if needed. As this library's scope is very limited and there are no statically-linked dependencies, updates are only required if any issues are reported.

Compatibility

This library is compatible with Java 1.8+.

Usage

Example

Kotlin

val volumeControl = VolumeControl()
// Gets the current master audio volume
val value: Int = volumeControl.volume
// Sets the current master audio volume to 82%
volumeControl.volume = 82

Java

VolumeControl volumeControl = new VolumeControl();
// Gets the current master audio volume
int value = volumeControl.getVolume();
// Sets the current master audio volume to 82%
volumeControl.setVolume(82);

Gradle

Kotlin DSL

build.gradle.kts

dependencies {
    // ...
    implementation("com.github.bjoernpetersen:volctl:${Lib.VOLCTL}")
    // or
    implementation(
        group = "com.github.bjoernpetersen",
        name = "volctl",
        version = Lib.VOLCTL)
}

Groovy DSL

build.gradle

dependencies {
    // ...
    implementation 'com.github.bjoernpetersen:volctl:$volctlVersion'
}

Maven

pom.xml

<dependency>
    <groupId>com.github.bjoernpetersen</groupId>
    <artifactId>volctl</artifactId>
    <version>${volctl.version}</version>
</dependency>

Building

Gradle is used to build the project.

Before packaging, you'll need to generate the header files and compile the native library:

./gradlew buildNative

Note that this requires CMake and a C++ toolchain to be installed. Only the native library for the current platform will be built.

License

This project is released under the MIT License. That includes every file in this repository, unless explicitly stated otherwise at the top of a file. A copy of the license text can be found in the LICENSE file.

Versions

Version
3.0.0
2.0.1
2.0.0
1.0.0