当前位置:网站首页>Black technology, real-time voice simulation

Black technology, real-time voice simulation

2022-06-21 07:12:00 brzhang

Dare a fashion , Let me also play TTS, Because I have an idea , You can read your own words with your own voice , Find an open source project , I started to try it out , The installation environment is quite porous .

Project address

https://github.com/babysor/MockingBird

git clone Project to local , Then install the environment , Begin to experience .

Mode of operation

1、 Environmental installation

1、1 install python Environmental Science
yum install python39
1、2 Specify the system default python edition
[[email protected] alternatives]# update-alternatives --config python3

There are 3 programs which provide 'python3'.

  Selection    Command
-----------------------------------------------
   1           /usr/bin/python3.8
*  2           /usr/bin/python3.6
 + 3           /usr/bin/python3.9

Enter to keep the current selection[+], or type selection number: 

The default here is 3.6, This project is not supported , For example, if it is installed later pytorch, You're going to report a mistake

therefore , Input here 3, choice 3.9 Version start , In fact, it can also be a system python If the version is higher than 3.7 It is also possible not to install python3.9, Direct access to installation pytorch.

1、3 install pytorch
pip3 install torch torchvision

Verify that the installation was successful

import torch
x = torch.rand(5, 3)
print(x)
#============= Output 

1、4 install ffmpeg, This is more complicated , The best way is to compile and install the source code ,yum The source finding probability reports an error

Please refer to the steps here for installation and upgrade https://trac.ffmpeg.org/wiki/CompilationGuide/Centos, The whole process network ok It will take at least half an hour .

I will only show the installation steps here , Upgrade can be found through the link above .

step1

yum install autoconf automake bzip2 bzip2-devel cmake freetype-devel gcc gcc-c++ git libtool make pkgconfig zlib-devel

step2

mkdir ~/ffmpeg_sources

step3

cd ~/ffmpeg_sources
curl -O -L https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/nasm-2.15.05.tar.bz2
tar xjvf nasm-2.15.05.tar.bz2
cd nasm-2.15.05
./autogen.sh
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"
make
make install

step4

cd ~/ffmpeg_sources
curl -O -L https://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
tar xzvf yasm-1.3.0.tar.gz
cd yasm-1.3.0
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"
make
make install

step5

cd ~/ffmpeg_sources
git clone --branch stable --depth 1 https://code.videolan.org/videolan/x264.git
cd x264
PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-static
make
make install

step6

cd ~/ffmpeg_sources
git clone --branch stable --depth 2 https://bitbucket.org/multicoreware/x265_git
cd ~/ffmpeg_sources/x265_git/build/linux
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED:bool=off ../../source
make
make install

step7

cd ~/ffmpeg_sources
git clone --depth 1 https://github.com/mstorsjo/fdk-aac
cd fdk-aac
autoreconf -fiv
./configure --prefix="$HOME/ffmpeg_build" --disable-shared
make
make install

step8

cd ~/ffmpeg_sources
curl -O -L https://downloads.sourceforge.net/project/lame/lame/3.100/lame-3.100.tar.gz
tar xzvf lame-3.100.tar.gz
cd lame-3.100
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --disable-shared --enable-nasm
make
make install

step9

cd ~/ffmpeg_sources
curl -O -L https://archive.mozilla.org/pub/opus/opus-1.3.1.tar.gz
tar xzvf opus-1.3.1.tar.gz
cd opus-1.3.1
./configure --prefix="$HOME/ffmpeg_build" --disable-shared
make
make install

step10

cd ~/ffmpeg_sources
git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git
cd libvpx
./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm
make
make install

step11

cd ~/ffmpeg_sources
curl -O -L https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
tar xjvf ffmpeg-snapshot.tar.bz2
cd ffmpeg
PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
  --prefix="$HOME/ffmpeg_build" \
  --pkg-config-flags="--static" \
  --extra-cflags="-I$HOME/ffmpeg_build/include" \
  --extra-ldflags="-L$HOME/ffmpeg_build/lib" \
  --extra-libs=-lpthread \
  --extra-libs=-lm \
  --bindir="$HOME/bin" \
  --enable-gpl \
  --enable-libfdk_aac \
  --enable-libfreetype \
  --enable-libmp3lame \
  --enable-libopus \
  --enable-libvpx \
  --enable-libx264 \
  --enable-libx265 \
  --enable-nonfree
make
make install
hash -d ffmpeg
1、5 install python Need to pack
cd /pathto/MockingBird # Go to the local project clone path 
pip3 install -r requirements.txt

What the hell? , Installation report error directly

Check the following information , To solve this problem , It needs to turn dark python39 Of devel, therefore

#  install EPEL Source 
yum install epel-release -y
#  install python3 Development kit 
yum install python39-devel -y

Here is the header file we need , Then try again

This time decisively succeeded .

Continue installing an optional dependency
pip3 install webrtcvad-wheels

thus , The installation of the entire environment is completed , I made a preliminary estimate , Probably need 45 Deploy the environment in about minutes .

2、 Prepare the model

Here I use the model prepared by the community directly

author

https://pan.baidu.com/s/1iONvRxmkI-t1nHqxKytY3g  Baidu disk link  4j5d

75k steps use 3 Open source data set hybrid training

3、 open web Webpage

python web.py 

What the hell? , Another error report

Look up the , Need to install

yum install libsndfile

After running successfully, open the address in the browser , The default is http://localhost:8080

This means that the game has started .

Be careful , Start synthesizer There is no model , You need to copy the model downloaded in step 2 to

Under this catalog .

4、 How to play

原网站

版权声明
本文为[brzhang]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202221538454044.html