Comments (8)
@yongtang thanks for the clarification.
WAVDataset will performs better with really huge WAV files (e.g., GBs) as decode_wav requires disk IO to read the entire file into memory before doing any decoding.
does this mean that WAVDataset supports seeking/memory mapping?
Maybe I can elaborate the use case: Imagine you have few but rather long audio recordings (like in dcase or music datasets, a WAVDataset
could give you access to the full decoded file. However, in practice, you would only train with chunked data of a few seconds per sample. The chunking could be done on the fly buy supporting seeking in the actual data loading. If this is not what you meant, I would propose to open an issue, if you agree that this could be a useful addition.
WAVDataset also simply the interaction with tf.keras.
because it can directly be used with tf.keras.fit?
For FFmpeg operators, we already have support for ffmpeg video operators. The audio operators with ffmpeg should not be very difficult to add (planed to add but haven't had enough time yet with many changes of 1.x -> 2.0).
that would be great!
from io.
Added a PR #307 as the first step to have FFmpeg support for audio streams.
from io.
@yongtang @terrytangyuan great to see that audio is getting some focus here in tf/io with the recent additions in 0.6.0. Regarding the WAVDataset
could you please comment on this from the user perspective?
- comparing
WAVInput
and tf2.0decode_wav
, which one should one use to read wavs? - for a wav reading pipeline, is
WAVDataset
faster than manually mappingtf.audio.decode_wav
? - do you plan to add ffmpeg operators?
from io.
@faroit WAVDataset
and decode_wav
have different use cases but the biggest difference is that, WAVDataset
is a data pipeline that directly support tf.keras for training and inference. WAVDataset
will be similar in performance, except WAVDataset
will performs better with really huge WAV files (e.g., GBs) as decode_wav
requires disk IO to read the entire file into memory before doing any decoding.
In essence, WAVDataset
is like decode_wav
as both are part of the TF's graph. while decode_wav
is a node (op) in the graph, WAVDataset
optimize and is really a small subgraph in the graph. WAVDataset
also simply the interaction with tf.keras.
For FFmpeg operators, we already have support for ffmpeg video operators. The audio operators with ffmpeg should not be very difficult to add (planed to add but haven't had enough time yet with many changes of 1.x -> 2.0).
from io.
I would propose to open an issue, if you agree that this could be a useful addition.
Definitely! please open an issue.
because it can directly be used with tf.keras.fit?
Yes. You can use WAVDataset in a similar way as the beginner tutorial with tf.keras (model.fit).
from io.
@faroit I added a PR #406 for reading a chunk of WAV file. You can use read_wav
and pass start=start, count=count
to only read a chunk of the samples.
I also tried to add 24bit
support, though I need a sample 24bit WAV file to see the actual memory layout to figure out how to fit 24bit into an int32
.
from io.
@yongtang, here's an example audio file of a 24-bit WAV PCM file created from a MP3 with the SoX command:
sox example.mp3 -b 24 example.wav
Input File : 'example.wav'
Channels : 2
Sample Rate : 44100
Precision : 24-bit
Duration : 00:00:20.00 = 882000 samples = 1500 CDDA sectors
File Size : 5.29M
Bit Rate : 2.12M
Sample Encoding: 24-bit Signed Integer PCM
from io.
@carlthome Created a PR #409 for 24 bit support.
from io.
Related Issues (20)
- Tensorflow 2.15 support HOT 3
- Missing ARM64 wheels for v0.35.0 on PyPI HOT 5
- [v0.35.0] Build Failure on "Analysis of target '@bazel_tools//platforms:windows' failed"
- S3 filesystem pure virtual method called; terminate called without an active exception HOT 12
- DICOM `scale=preserve` not working as intended and performance consideration
- Is the windows support dropped? HOT 1
- Inefficient Write+Copy+Delete pattern when writing to S3. HOT 1
- S3 read throughput slow down after hit prefix limit HOT 1
- extra not provided
- Tensorflow version-pinning should be reflected in setup.py. HOT 1
- Bug in Reading Compressed String Column in Parquet Dataset HOT 2
- Unable to use tensorflow_io.audio.resample on Mac M1
- tensorflow-io-gcs-filesystem==0.36.0 not available via pip HOT 1
- Missing files for Python 3.12 HOT 2
- Tensorflow 2.16 support HOT 1
- Grail bazel toolchain changed/missing
- S3 Express One Zone support
- The wheel in tensorflow-io 0.37.0 is not compatible with Python 3.12
- Please Make TFIO work on Mac M1, I need to read mp3 files!!!!
- Can not build `tensorflow-io 0.37.0` from source on Apple silicon.
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 io.