mirror of
https://github.com/onyx-and-iris/voicemeeter-api-python.git
synced 2025-04-03 20:33:44 +01:00
Compare commits
4 Commits
ee3fa0a372
...
71f77b7830
Author | SHA1 | Date | |
---|---|---|---|
71f77b7830 | |||
4415851816 | |||
8b63cbfe8d | |||
de4ce850eb |
13
CHANGELOG.md
13
CHANGELOG.md
@ -11,6 +11,19 @@ Before any major/minor/patch bump all unit tests will be run to verify they pass
|
||||
|
||||
- [x]
|
||||
|
||||
## [2.1.0] - 2023-06-30
|
||||
|
||||
### Added
|
||||
|
||||
- RecorderMode added to Recorder class. See Recorder section in README for new properties and methods.
|
||||
- recorder.loop is now a forwarder method for recorder.mode.loop for backwards compatibility
|
||||
|
||||
- RecorderArmStrip, RecorderArmBus mixed into Recorder class.
|
||||
|
||||
### Removed
|
||||
|
||||
- Recorder.loop removed from documentation
|
||||
|
||||
## [2.0.0] - 2023-06-25
|
||||
|
||||
Where possible I've attempted to make the changes backwards compatible. The breaking changes affect two higher classes, Strip and Bus, as well as the behaviour of events. All other changes are additive or QOL aimed at giving more options to the developer. For example, every low-level CAPI call is now logged and error raised on Exception, you can now register callback functions as well as observer classes, extra examples to demonstrate different use cases etc.
|
||||
|
49
README.md
49
README.md
@ -398,13 +398,19 @@ The following methods are available
|
||||
- `record()`
|
||||
- `ff()`
|
||||
- `rew()`
|
||||
- `load(<filepath>)`: string
|
||||
- `load(filepath)`: raw string
|
||||
- `goto(time_string)`: time string in format `hh:mm:ss`
|
||||
- `filetype(filetype)`: string, ("wav", "aiff", "bwf", "mp3")
|
||||
|
||||
The following properties are available
|
||||
|
||||
- `loop`: boolean
|
||||
- `A1 - A5`: boolean
|
||||
- `B1 - A3`: boolean
|
||||
- `samplerate`: int, (22050, 24000, 32000, 44100, 48000, 88200, 96000, 176400, 192000)
|
||||
- `bitresolution`: int, (8, 16, 24, 32)
|
||||
- `channel`: int, from 1 to 8
|
||||
- `kbps`: int, (32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320)
|
||||
- `gain`: float, from -60.0 to 12.0
|
||||
|
||||
example:
|
||||
|
||||
@ -412,17 +418,46 @@ example:
|
||||
vm.recorder.play()
|
||||
vm.recorder.stop()
|
||||
|
||||
# Enable loop play
|
||||
vm.recorder.loop = True
|
||||
|
||||
# Disable recorder out channel B2
|
||||
vm.recorder.B2 = False
|
||||
|
||||
# filepath as raw string
|
||||
vm.recorder.load(r'C:\music\mytune.mp3')
|
||||
|
||||
# set the goto time to 1m 30s
|
||||
vm.recorder.goto("00:01:30")
|
||||
```
|
||||
|
||||
Recorder properties are defined as write only.
|
||||
#### Recorder.Mode
|
||||
|
||||
The following properties are available
|
||||
|
||||
- `recbus`: boolean
|
||||
- `playonload`: boolean
|
||||
- `loop`: boolean
|
||||
- `multitrack`: boolean
|
||||
|
||||
example:
|
||||
|
||||
```python
|
||||
# Enable loop play
|
||||
vm.recorder.mode.loop = True
|
||||
```
|
||||
|
||||
#### Recorder.ArmStrip[i]|ArmBus[i]
|
||||
|
||||
The following method is available
|
||||
|
||||
- `set(val)`: boolean
|
||||
|
||||
example:
|
||||
|
||||
```python
|
||||
# Arm strip 3
|
||||
vm.recorder.armstrip[3].set(True)
|
||||
# Arm bus 0
|
||||
vm.recorder.armbus[0].set(True)
|
||||
```
|
||||
|
||||
### VBAN
|
||||
|
||||
@ -664,7 +699,7 @@ vm.vban.outstream[0].apply(on: True, name: 'streamname', bit: 24)
|
||||
|
||||
## Config Files
|
||||
|
||||
`vm.apply_config(<configname>)`
|
||||
`vm.apply_config(configname)`
|
||||
|
||||
You may load config files in TOML format.
|
||||
Three example configs have been included with the package. Remember to save
|
||||
|
@ -80,7 +80,9 @@ class Recorder(IRemote):
|
||||
|
||||
@channel.setter
|
||||
def channel(self, val: int):
|
||||
self.getter("channel", val)
|
||||
if not 1 <= val <= 8:
|
||||
self.logger.warning(f"channel got: {val} but expected a value from 1 to 8")
|
||||
self.setter("channel", val)
|
||||
|
||||
@property
|
||||
def kbps(self):
|
||||
@ -107,10 +109,14 @@ class Recorder(IRemote):
|
||||
except UnicodeError:
|
||||
raise VMError("File full directory must be a raw string")
|
||||
|
||||
def set_loop(self, val: bool):
|
||||
self.setter("mode.loop", 1 if val else 0)
|
||||
# loop forwarder methods, for backwards compatibility
|
||||
@property
|
||||
def loop(self):
|
||||
return self.mode.loop
|
||||
|
||||
loop = property(fset=set_loop)
|
||||
@loop.setter
|
||||
def loop(self, val: bool):
|
||||
self.mode.loop = val
|
||||
|
||||
def goto(self, time_str):
|
||||
def get_sec():
|
||||
@ -135,7 +141,7 @@ class Recorder(IRemote):
|
||||
def filetype(self, val: str):
|
||||
opts = {"wav": 1, "aiff": 2, "bwf": 3, "mp3": 100}
|
||||
try:
|
||||
self.setter("filetype", opts[val])
|
||||
self.setter("filetype", opts[val.lower()])
|
||||
except KeyError:
|
||||
self.logger.warning(
|
||||
f"filetype got: {val} but expected a value in {list(opts.keys())}"
|
||||
@ -143,6 +149,7 @@ class Recorder(IRemote):
|
||||
|
||||
|
||||
class RecorderMode(IRemote):
|
||||
@property
|
||||
def identifier(self):
|
||||
return "recorder.mode"
|
||||
|
||||
@ -179,31 +186,26 @@ class RecorderMode(IRemote):
|
||||
self.setter("multitrack", 1 if val else 0)
|
||||
|
||||
|
||||
class RecorderArmStrip(IRemote):
|
||||
class RecorderArmChannel(IRemote):
|
||||
def __init__(self, remote, i):
|
||||
super().__init__(remote)
|
||||
self._i = i
|
||||
|
||||
def set(self, val: bool):
|
||||
self.setter("", 1 if val else 0)
|
||||
|
||||
|
||||
class RecorderArmStrip(RecorderArmChannel):
|
||||
@property
|
||||
def identifier(self):
|
||||
return f"recorder.armstrip[{self._i}]"
|
||||
|
||||
def set(self, val: bool):
|
||||
self.setter("", 1 if val else 0)
|
||||
|
||||
|
||||
class RecorderArmBus(IRemote):
|
||||
def __init__(self, remote, i):
|
||||
super().__init__(remote)
|
||||
self._i = i
|
||||
|
||||
class RecorderArmBus(RecorderArmChannel):
|
||||
@property
|
||||
def identifier(self):
|
||||
return f"recorder.armbus[{self._i}]"
|
||||
|
||||
def set(self, val: bool):
|
||||
self.setter("", 1 if val else 0)
|
||||
|
||||
|
||||
def _make_armchannel_mixin(remote, kind):
|
||||
"""Creates an armchannel out mixin"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user