marl / marl/pysox

Simplified submodule wrapper for one-off operations

Open
#30 3 comments 0 reactions 1 assignee Claimed by @rabitt View on GitHub
question
Dominant language
Python
Stars
540
Forks
83
PR merge metrics
No merged PRs in 30d

Description

so here's a idea for discussion...

I like the transform chaining for complex effects; it's a really smart way of optimizing how sox is controlled. However, I don't like how verbose it is for simple one-off operations.

For example, to convert a file currently:
```
tfm = sox.Transformer()
tfm.convert(
samplerate=samplerate,
n_channels=n_channels,
bitdepth=bitdepth)
tfm.build(input_file, output_file)
```
For simple operations, this doesn't feel very pythonic. I'd be curious how folks feel about abstracting this away for trivial / common pipelines:

```
sox.effects.convert(input_file, output_file, samplerate, n_channels, bitdepth)
```

This could also roll-up try-catch logic, if one were so inclined (e.g. `strict=False` could return a non-zero status, etc).

thoughts?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.