Skip to content

Commit

Permalink
Add read_wav and list_wav_info support (#406)
Browse files Browse the repository at this point in the history
* Add read_wav and list_wav_info support

This PR adds read_wav and list_wav_info support
so that it is possible to read wav file into a tensor.
Since WAV file is splittable, read_wav could take a
start and count parameter so that only a slice
of the wav file is read.

This is also part of the effort to rework on Dataset
to move to primitive ops.

See See 382 and 366 for related discussions.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Rename start, count to start, stop

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
  • Loading branch information
yongtang authored Aug 4, 2019
1 parent 7b05cd4 commit 8af0a01
Show file tree
Hide file tree
Showing 10 changed files with 438 additions and 213 deletions.
2 changes: 1 addition & 1 deletion tensorflow_io/audio/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ load(
cc_library(
name = "audio_ops",
srcs = [
"kernels/audio_input.cc",
"kernels/audio_kernels.cc",
"ops/audio_ops.cc",
],
copts = tf_io_copts(),
Expand Down
6 changes: 6 additions & 0 deletions tensorflow_io/audio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,24 @@
"""Audio Dataset.
@@WAVDataset
@@list_wav_info
@@read_wav
"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from tensorflow_io.audio.python.ops.audio_ops import WAVDataset
from tensorflow_io.audio.python.ops.audio_ops import list_wav_info
from tensorflow_io.audio.python.ops.audio_ops import read_wav

from tensorflow.python.util.all_util import remove_undocumented

_allowed_symbols = [
"WAVDataset",
"list_wav_info",
"read_wav",
]

remove_undocumented(__name__)
166 changes: 0 additions & 166 deletions tensorflow_io/audio/kernels/audio_input.cc

This file was deleted.

Loading

0 comments on commit 8af0a01

Please sign in to comment.