Comments (5)
Regarding subests of channels - it's already supported, note the test_get_audio_multichannel
- I'll document it better. I elaborated more in issue #4
Regarding the raw-PCM thing: I think if there is any common/universal format it would probably be wav, not raw pcm, as raw pcm is too easy to get wrong (no error if wrong format).
That's just for the command
type of input, where we could always place sox
at the end of the pipe to convert practically anything to PCM, and it is very easy to load with numpy as it's just a cast of binary buffer to int16. But we can make it work with wav too I guess.
I didn't really understand the AudioSource code well as your Python style is very modern... e.g. no init function.
Alright, let me elaborate on that. Python 3.7 introduced dataclass
, based on attrs library. It basically reduces the amount of boilerplate code you need to write. You can specify the members similarly as in C++, e.g.:
@dataclass
class Foo:
x: int
y: List[str]
and it automatically creates default __init__
, __eq__
, __repr__
, and can also create comparison operators, __hash__
, or impose immutability with extra arguments to dataclass
. The __init__
would look something like:
def __init__(self, x: int, y: List[str]):
self.x = x
self.y = y
self.__post_init__()
It also provides a method asdict
which can convert a dataclass
into a nice dictionary, making serialization very easy (notice the code is quite terse for what it does). There's a __post_init__
that's automatically called in the auto-generated constructor, it allows you to customize __init__
without having to write the boilerplate.
Also, I find the typing
module extremely useful for static code analysis and improving documentation. List[int]
type means the variable will be a list
of int
, Optional
means it can be None
, Union[int, str]
means it can be either an int
or str
.
from lhotse.
Alright, let me elaborate on that. Python 3.7 introduced dataclass
The users of this library are forced to use Python 3.7. If some of them do not have
sudo
permission, they will have difficulties upgrading their python version to 3.7
from lhotse.
Mm. My feeling is the python3.7 thing may be OK... this is a rather forward-looking project, and my feeling is enough people have python3.7 (or could install it in user-space).
If it's a problem later we can always change the code, but for now I don't want to slow this project down by worrying too much about such thigns.
from lhotse.
from lhotse.
from lhotse.
Related Issues (20)
- How to split manifests into several parts HOT 1
- Pytorch dataloader cannot compute length HOT 2
- Create a custom audio transformation HOT 1
- Describe on cuts does not display supervision custom info
- PR #1332 breaks many operations HOT 1
- 'ascii' codec can't encode characters in position 219-247 in processing wenet speech dateset HOT 1
- Multiple feature extractors in a single Cut HOT 1
- AttributeError: 'dict' object has no attribute 'to_dict' HOT 2
- error in window 11 installation HOT 1
- UnicodeEncodeError: 'ascii' codec can't encode characters in position 505-506: ordinal not in range(128) HOT 2
- OSError: [Errno 9] Unable to synchronously open file (unable to lock file, errno = 9, error message = 'Bad file descriptor') HOT 1
- Support for Video Features, for example How2Sign HOT 7
- dataloader slow with shar HOT 3
- Feature calculation process crashing with large dataset HOT 1
- How to combine with huggingface audio datasets? HOT 1
- AudioTransforms are dropped when saving MixedCuts? HOT 2
- How does tar work with DynamicBucketingSampler?
- Read seperate .jsonl.gz from fbank filter them and make a Cutset into single variable. HOT 3
- How to load parquet file effectively with Lhotse? HOT 1
- MUSAN mix to current CutSet: Cannot load audio of cuts in a lazy CutSet. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lhotse.