Skip to content
This repository has been archived by the owner on Mar 10, 2023. It is now read-only.

Commit

Permalink
Added example data. Added text file and audio file reading.
Browse files Browse the repository at this point in the history
  • Loading branch information
ugnelis committed Sep 28, 2017
1 parent def3339 commit 1ad241e
Show file tree
Hide file tree
Showing 19 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions data/LibriSpeech/dev-clean-wav/3752-4944-0041.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
how delightful the grass smells
Binary file added data/LibriSpeech/dev-clean-wav/3752-4944-0041.wav
Binary file not shown.
1 change: 1 addition & 0 deletions data/LibriSpeech/dev-clean-wav/777-126732-0068.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
that boy hears too much of what is talked about here
Binary file not shown.
1 change: 1 addition & 0 deletions data/LibriSpeech/test-clean-wav/4507-16021-0019.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
it is the language of wretchedness
Binary file not shown.
1 change: 1 addition & 0 deletions data/LibriSpeech/test-clean-wav/7176-92135-0009.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
and i should begin with a short homily on soliloquy
Binary file not shown.
1 change: 1 addition & 0 deletions data/LibriSpeech/train-clean-100-wav/1970-28415-0023.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
where people were making their gifts to god
Binary file not shown.
1 change: 1 addition & 0 deletions data/LibriSpeech/train-clean-100-wav/211-122425-0059.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
and the two will pass off together
Binary file not shown.
1 change: 1 addition & 0 deletions data/LibriSpeech/train-clean-100-wav/2843-152918-0008.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
one day may be pleasant enough but two three four
Binary file not shown.
1 change: 1 addition & 0 deletions data/LibriSpeech/train-clean-100-wav/3259-158083-0026.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
i have a nephew fighting for democracy in france
Binary file not shown.
1 change: 1 addition & 0 deletions data/LibriSpeech/train-clean-100-wav/3879-174923-0005.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
he must vanish out of the world
Binary file not shown.
24 changes: 24 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
import unicodedata
import re

import tensorflow as tf

import scipy.io.wavfile as wav

DATA_DIR = "data/LibriSpeech/"
TRAIN_DIR = DATA_DIR + "train-clean-100-wav/"
TEST_DIR = DATA_DIR + "test-clean-wav/"
DEV_DIR = DATA_DIR + "dev-clean-wav/"


def read_text_file(path):
"""
Expand Down Expand Up @@ -88,3 +97,18 @@ def sparse_tuples_from_sequences(sequences, dtype=np.int32):
shape = np.asarray([len(sequences), np.asarray(indexes).max(0)[1] + 1], dtype=np.int64)

return indexes, values, shape


def main(argv):
# Read text file.
text_file_path = TRAIN_DIR + "211-122425-0059.txt"
text = read_text_file(text_file_path)
text = normalize_text(text)

# Read audio file.
wav_file_path = TRAIN_DIR + "211-122425-0059.wav"
audio_rate, audio_data = wav.read(wav_file_path)


if __name__ == '__main__':
tf.app.run()

0 comments on commit 1ad241e

Please sign in to comment.