Skip to content

Commit a7372d9

Browse files
authored
Merge pull request #84 from sp-nitech/raw2wav [skip ci]
Add raw2wav and wav2raw
2 parents 68f4158 + 5b36f2b commit a7372d9

File tree

19 files changed

+33890
-16
lines changed

19 files changed

+33890
-16
lines changed

.github/workflows/check-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Dependencies
2020
run: |
2121
sudo apt-get update
22-
sudo apt-get install csh parallel valgrind libpcre3-dev
22+
sudo apt-get install csh parallel valgrind libpcre3-dev ffmpeg
2323
2424
- name: Tool
2525
run: cd tools && make check -j 4 PYTHON_VERSION=3

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ endif()
2525

2626
set(CMAKE_CXX_STANDARD 11)
2727
if(MSVC)
28-
set(CMAKE_CXX_FLAGS "/O2 /W4 /wd4100 /wd4456 /EHsc /D_CRT_SECURE_NO_WARNINGS")
28+
set(CMAKE_CXX_FLAGS
29+
"/O2 /W4 /wd4100 /wd4456 /wd4706 /EHsc /D_CRT_SECURE_NO_WARNINGS")
2930
else()
3031
set(CMAKE_CXX_FLAGS "-O2 -Wall -Wno-deprecated-register")
3132
endif()
@@ -371,6 +372,7 @@ set(MAIN_SOURCES
371372
${SOURCE_DIR}/main/quantize.cc
372373
${SOURCE_DIR}/main/ramp.cc
373374
${SOURCE_DIR}/main/rand.cc
375+
${SOURCE_DIR}/main/raw2wav.cc
374376
${SOURCE_DIR}/main/reverse.cc
375377
${SOURCE_DIR}/main/rlevdur.cc
376378
${SOURCE_DIR}/main/rmse.cc
@@ -391,6 +393,7 @@ set(MAIN_SOURCES
391393
${SOURCE_DIR}/main/vprod.cc
392394
${SOURCE_DIR}/main/vstat.cc
393395
${SOURCE_DIR}/main/vsum.cc
396+
${SOURCE_DIR}/main/wav2raw.cc
394397
${SOURCE_DIR}/main/window.cc
395398
${SOURCE_DIR}/main/world_synth.cc
396399
${SOURCE_DIR}/main/x2x.cc

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ format-cc:
126126
./tools/cppcheck/cppcheck -j $(JOBS) --enable=all --check-level=exhaustive --std=c++11 \
127127
--suppress=checkersReport --suppress=constParameterPointer --suppress=missingIncludeSystem \
128128
--suppress=unmatchedSuppression --suppress=unusedFunction --suppress=useStlAlgorithm \
129-
--suppress=variableScope --inline-suppr --error-exitcode=1 \
129+
--suppress=variableScope --inline-suppr --error-exitcode=1 -DCPPCHECK \
130130
--cppcheck-build-dir=$(BUILDDIR)/cppcheck --checkers-report=$(BUILDDIR)/cppcheck/report.txt \
131131
-Iinclude -Ithird_party src
132132

@@ -140,7 +140,7 @@ format-misc:
140140
fi
141141
./tools/venv/bin/cmake-format -i CMakeLists.txt
142142
./tools/venv/bin/mdformat *.md
143-
cd $(DOCDIR) && ../tools/venv/bin/docstrfmt .
143+
./tools/venv/bin/docstrfmt docs
144144

145145
test:
146146
@if [ ! -x ./tools/bats/bin/bats ]; then \

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,9 @@ cd egs/analysis_synthesis/mgc
9797
```
9898

9999
The below is a simple example that decreases the volume of input audio in `input.wav`.
100-
You may need to install `sox` command on your system.
101100

102101
```sh
103-
sox -t wav input.wav -c 1 -t s16 -r 16000 - |
104-
x2x +sd | sopr -m 0.5 | x2x +ds -r |
105-
sox -c 1 -t s16 -r 16000 - -t wav output.wav
102+
wav2raw +s input.wav | x2x +sd | sopr -m 0.5 | x2x +ds -r | raw2wav +s -s 16 > output.wav
106103
```
107104

108105
If you would like to draw figures, please prepare a python environment.
@@ -142,7 +139,7 @@ deactivate
142139
- `c2sp` -> `mgc2sp`
143140
- `cat2` and `echo2`
144141
- `da`
145-
- `ds`, `us`, `us16`, and `uscd` -> `sox`
142+
- `ds`, `us`, `us16`, and `uscd` -> `sox` or `ffmpeg`
146143
- `fig`
147144
- `gc2gc` -> `mgc2mgc`
148145
- `gcep`, `mcep`, and `uels` -> `mgcep`
@@ -151,7 +148,7 @@ deactivate
151148
- `lsp2sp` -> `mglsp2sp`
152149
- `mgc2mgclsp` and `mgclsp2mgc`
153150
- `psgr` and `xgr`
154-
- `raw2wav`, `wav2raw`, `wavjoin`, and `wavsplit` -> `sox`
151+
- `wavjoin` and `wavsplit`
155152
- Separated commands:
156153
- `c2ir` -> `c2mpir` and `mpir2c`
157154
- `dtw` -> `dtw` and `dtw_merge`

doc/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,7 @@ EXCLUDE_PATTERNS = *int24_t.h
11211121
# wildcard * is used, a substring. Examples: ANamespace, AClass,
11221122
# ANamespace::AClass, ANamespace::*Test
11231123

1124-
EXCLUDE_SYMBOLS =
1124+
EXCLUDE_SYMBOLS = DR_* STB_*
11251125

11261126
# The EXAMPLE_PATH tag can be used to specify one or more files or directories
11271127
# that contain example code fragments that are included (see the \include

doc/main/raw2wav.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.. _raw2wav:
2+
3+
raw2wav
4+
=======
5+
6+
.. doxygenfile:: raw2wav.cc
7+
8+
.. seealso::
9+
10+
:ref:`wav2raw` :ref:`x2x`

doc/main/wav2raw.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.. _wav2raw:
2+
3+
wav2raw
4+
=======
5+
6+
.. doxygenfile:: wav2raw.cc
7+
8+
.. seealso::
9+
10+
:ref:`raw2wav` :ref:`x2x`

0 commit comments

Comments
 (0)