5 | Copyright [2016] [Matej Vehar]
6 |
7 | Licensed under the Apache License, Version 2.0 (the "License");
8 | you may not use this file except in compliance with the License.
9 | You may obtain a copy of the License at
10 |
11 | http://www.apache.org/licenses/LICENSE-2.0
12 |
13 | Unless required by applicable law or agreed to in writing, software
14 | distributed under the License is distributed on an "AS IS" BASIS,
15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | See the License for the specific language governing permissions and
17 | limitations under the License.
18 |
19 |
20 |
21 |
22 | An Android wrapper provided by Steve Myers, using SoundTouch C++ Audio Processing Library by Olli Parviainen 2001-2012,
23 | distrubted under LGPL license.
24 |
25 |
--------------------------------------------------------------------------------
/VoiceChanger/README.md:
--------------------------------------------------------------------------------
1 | Android application - communication between two mobile phones with modifies voice (pitch shifting)
2 | ==================
3 | Computer Sound Production @ Faculty of Computer Science and Informatics - University of Ljubljana | Slovenia
4 |
5 | Copyright [2016] [Matej Vehar]
6 |
7 | Licensed under the Apache License, Version 2.0 (the "License");
8 | you may not use this file except in compliance with the License.
9 | You may obtain a copy of the License at
10 |
11 | http://www.apache.org/licenses/LICENSE-2.0
12 |
13 | Unless required by applicable law or agreed to in writing, software
14 | distributed under the License is distributed on an "AS IS" BASIS,
15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | See the License for the specific language governing permissions and
17 | limitations under the License.
18 |
19 |
20 |
21 |
22 | An Android wrapper provided by Steve Myers, using SoundTouch C++ Audio Processing Library by Olli Parviainen 2001-2012,
23 | distrubted under LGPL license.
24 |
25 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/jni/soundtouch/source/SoundStretch/soundstretch.dsw:
--------------------------------------------------------------------------------
1 | Microsoft Developer Studio Workspace File, Format Version 6.00
2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
3 |
4 | ###############################################################################
5 |
6 | Project: "SoundTouch"=..\SoundTouch\SoundTouch.dsp - Package Owner=<4>
7 |
8 | Package=<5>
9 | {{{
10 | }}}
11 |
12 | Package=<4>
13 | {{{
14 | }}}
15 |
16 | ###############################################################################
17 |
18 | Project: "soundstretch"=.\soundstretch.dsp - Package Owner=<4>
19 |
20 | Package=<5>
21 | {{{
22 | }}}
23 |
24 | Package=<4>
25 | {{{
26 | Begin Project Dependency
27 | Project_Dep_Name SoundTouch
28 | End Project Dependency
29 | }}}
30 |
31 | ###############################################################################
32 |
33 | Global:
34 |
35 | Package=<5>
36 | {{{
37 | }}}
38 |
39 | Package=<3>
40 | {{{
41 | }}}
42 |
43 | ###############################################################################
44 |
45 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/jni/soundtouch/source/Android-lib/src/net/surina/soundtouch/SoundTouch.java:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | ///
3 | /// Example class that invokes native SoundTouch routines through the JNI
4 | /// interface.
5 | ///
6 | /// Author : Copyright (c) Olli Parviainen
7 | /// Author e-mail : oparviai 'at' iki.fi
8 | /// WWW : http://www.surina.net
9 | ///
10 | ////////////////////////////////////////////////////////////////////////////////
11 | //
12 | // $Id: SoundTouch.java 165 2012-12-28 19:55:23Z oparviai $
13 | //
14 | ////////////////////////////////////////////////////////////////////////////////
15 |
16 | package net.surina.soundtouch;
17 |
18 | public final class SoundTouch
19 | {
20 | // Native interface function that returns SoundTouch version string.
21 | // This invokes the native c++ routine defined in "soundtouch-jni.cpp".
22 | public native final String getVersionString();
23 |
24 |
25 | // Load the native library upon startup
26 | static
27 | {
28 | System.loadLibrary("soundtouch");
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/jni/soundtouch/source/Makefile.am:
--------------------------------------------------------------------------------
1 | ## Process this file with automake to create Makefile.in
2 | ##
3 | ## $Id: Makefile.am 38 2008-12-25 17:00:23Z oparviai $
4 | ##
5 | ## Copyright (C) 2003 - David W. Durham
6 | ##
7 | ## This file is part of SoundTouch, an audio processing library for pitch/time adjustments
8 | ##
9 | ## SoundTouch is free software; you can redistribute it and/or modify it under the
10 | ## terms of the GNU General Public License as published by the Free Software
11 | ## Foundation; either version 2 of the License, or (at your option) any later
12 | ## version.
13 | ##
14 | ## SoundTouch is distributed in the hope that it will be useful, but WITHOUT ANY
15 | ## WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 | ## A PARTICULAR PURPOSE. See the GNU General Public License for more details.
17 | ##
18 | ## You should have received a copy of the GNU General Public License along with
19 | ## this program; if not, write to the Free Software Foundation, Inc., 59 Temple
20 | ## Place - Suite 330, Boston, MA 02111-1307, USA
21 |
22 | include $(top_srcdir)/config/am_include.mk
23 |
24 | SUBDIRS=SoundTouch SoundStretch
25 |
26 | # set to something if you want other stuff to be included in the distribution tarball
27 | #EXTRA_DIST=
28 |
29 |
--------------------------------------------------------------------------------
/VoiceChanger/jni/soundtouch/include/Makefile.am:
--------------------------------------------------------------------------------
1 | ## Process this file with automake to create Makefile.in
2 | ##
3 | ## $Id: Makefile.am 11 2008-02-10 16:26:55Z oparviai $
4 | ##
5 | ## Copyright (C) 2003 - David W. Durham
6 | ##
7 | ## This file is part of SoundTouch, an audio processing library for pitch/time adjustments
8 | ##
9 | ## SoundTouch is free software; you can redistribute it and/or modify it under the
10 | ## terms of the GNU General Public License as published by the Free Software
11 | ## Foundation; either version 2 of the License, or (at your option) any later
12 | ## version.
13 | ##
14 | ## SoundTouch is distributed in the hope that it will be useful, but WITHOUT ANY
15 | ## WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 | ## A PARTICULAR PURPOSE. See the GNU General Public License for more details.
17 | ##
18 | ## You should have received a copy of the GNU General Public License along with
19 | ## this program; if not, write to the Free Software Foundation, Inc., 59 Temple
20 | ## Place - Suite 330, Boston, MA 02111-1307, USA
21 |
22 | ## I used config/am_include.mk for common definitions
23 | include $(top_srcdir)/config/am_include.mk
24 |
25 | pkginclude_HEADERS=FIFOSampleBuffer.h FIFOSamplePipe.h SoundTouch.h STTypes.h BPMDetect.h soundtouch_config.h
26 |
27 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/jni/soundtouch/include/Makefile.am:
--------------------------------------------------------------------------------
1 | ## Process this file with automake to create Makefile.in
2 | ##
3 | ## $Id: Makefile.am 11 2008-02-10 16:26:55Z oparviai $
4 | ##
5 | ## Copyright (C) 2003 - David W. Durham
6 | ##
7 | ## This file is part of SoundTouch, an audio processing library for pitch/time adjustments
8 | ##
9 | ## SoundTouch is free software; you can redistribute it and/or modify it under the
10 | ## terms of the GNU General Public License as published by the Free Software
11 | ## Foundation; either version 2 of the License, or (at your option) any later
12 | ## version.
13 | ##
14 | ## SoundTouch is distributed in the hope that it will be useful, but WITHOUT ANY
15 | ## WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 | ## A PARTICULAR PURPOSE. See the GNU General Public License for more details.
17 | ##
18 | ## You should have received a copy of the GNU General Public License along with
19 | ## this program; if not, write to the Free Software Foundation, Inc., 59 Temple
20 | ## Place - Suite 330, Boston, MA 02111-1307, USA
21 |
22 | ## I used config/am_include.mk for common definitions
23 | include $(top_srcdir)/config/am_include.mk
24 |
25 | pkginclude_HEADERS=FIFOSampleBuffer.h FIFOSamplePipe.h SoundTouch.h STTypes.h BPMDetect.h soundtouch_config.h
26 |
27 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
21 |
22 |
29 |
30 |
--------------------------------------------------------------------------------
/VoiceChanger/jni/soundtouch/bootstrap:
--------------------------------------------------------------------------------
1 | # $Id: bootstrap 43 2008-12-25 17:54:41Z oparviai $
2 |
3 | #!/bin/sh
4 |
5 | if [ "$1" = "--clean" ]
6 | then
7 | if [ -a Makefile ]
8 | then
9 | make maintainer-clean
10 | elif [ -a configure ]
11 | then
12 | configure && $0 --clean
13 | else
14 | bootstrap && configure && $0 --clean
15 | fi
16 |
17 | rm -rf configure libtool aclocal.m4 `find . -name Makefile.in` autom4te*.cache config/config.guess config/config.h.in config/config.sub config/depcomp config/install-sh config/ltmain.sh config/missing config/mkinstalldirs config/stamp-h config/stamp-h.in
18 |
19 | #gettextie files
20 | #rm -f ABOUT-NLS config/config.rpath config/m4/codeset.m4 config/m4/gettext.m4 config/m4/glibc21.m4 config/m4/iconv.m4 config/m4/intdiv0.m4 config/m4/inttypes-pri.m4 config/m4/inttypes.m4 config/m4/inttypes_h.m4 config/m4/isc-posix.m4 config/m4/lcmessage.m4 config/m4/lib-ld.m4 config/m4/lib-link.m4 config/m4/lib-prefix.m4 config/m4/progtest.m4 config/m4/stdint_h.m4 config/m4/uintmax_t.m4 config/m4/ulonglong.m4 po/Makefile.in.in po/Rules-quot po/boldquot.sed po/en@boldquot.header po/en@quot.header po/insert-header.sin po/quot.sed po/remove-potcdate.sin
21 |
22 | else
23 | export AUTOMAKE="automake --add-missing --foreign --copy"
24 | autoreconf -fisv && rm -f `find . -name "*~"` && rm -f ChangeLog
25 | exit $?
26 | fi
27 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/jni/soundtouch/bootstrap:
--------------------------------------------------------------------------------
1 | # $Id: bootstrap 43 2008-12-25 17:54:41Z oparviai $
2 |
3 | #!/bin/sh
4 |
5 | if [ "$1" = "--clean" ]
6 | then
7 | if [ -a Makefile ]
8 | then
9 | make maintainer-clean
10 | elif [ -a configure ]
11 | then
12 | configure && $0 --clean
13 | else
14 | bootstrap && configure && $0 --clean
15 | fi
16 |
17 | rm -rf configure libtool aclocal.m4 `find . -name Makefile.in` autom4te*.cache config/config.guess config/config.h.in config/config.sub config/depcomp config/install-sh config/ltmain.sh config/missing config/mkinstalldirs config/stamp-h config/stamp-h.in
18 |
19 | #gettextie files
20 | #rm -f ABOUT-NLS config/config.rpath config/m4/codeset.m4 config/m4/gettext.m4 config/m4/glibc21.m4 config/m4/iconv.m4 config/m4/intdiv0.m4 config/m4/inttypes-pri.m4 config/m4/inttypes.m4 config/m4/inttypes_h.m4 config/m4/isc-posix.m4 config/m4/lcmessage.m4 config/m4/lib-ld.m4 config/m4/lib-link.m4 config/m4/lib-prefix.m4 config/m4/progtest.m4 config/m4/stdint_h.m4 config/m4/uintmax_t.m4 config/m4/ulonglong.m4 po/Makefile.in.in po/Rules-quot po/boldquot.sed po/en@boldquot.header po/en@quot.header po/insert-header.sin po/quot.sed po/remove-potcdate.sin
21 |
22 | else
23 | export AUTOMAKE="automake --add-missing --foreign --copy"
24 | autoreconf -fisv && rm -f `find . -name "*~"` && rm -f ChangeLog
25 | exit $?
26 | fi
27 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/java/com/vehar/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.vehar;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.view.View;
7 | import android.view.View.OnClickListener;
8 | import android.widget.Button;
9 |
10 | import com.vehar.soundtouchandroid.R;
11 |
12 | public class MainActivity extends AppCompatActivity implements OnClickListener {
13 |
14 | private Button buttonTest = null;
15 | private Button buttonSend = null;
16 |
17 | @Override
18 | protected void onCreate(Bundle savedInstanceState) {
19 | super.onCreate(savedInstanceState);
20 | setContentView(R.layout.activity_main);
21 |
22 | buttonTest =(Button) findViewById(R.id.buttonTest);
23 | buttonSend =(Button) findViewById(R.id.buttonSend);
24 |
25 | buttonTest.setOnClickListener(this);
26 | buttonSend.setOnClickListener(this);
27 |
28 |
29 | }
30 |
31 | @Override
32 | public void onClick(View arg0) {
33 | Intent intent;
34 |
35 | int i = arg0.getId();
36 | if (i == R.id.buttonTest) {
37 | intent = new Intent(this, VoiceChanger.class);
38 | startActivity(intent);
39 |
40 |
41 | } else if (i == R.id.buttonSend) {
42 | intent = new Intent(this, Communicator.class);
43 | startActivity(intent);
44 |
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/VoiceChanger/jni/soundtouch/SoundTouch.sln:
--------------------------------------------------------------------------------
1 | Microsoft Visual Studio Solution File, Format Version 10.00
2 | # Visual Studio 2008
3 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SoundTouch", "SoundTouch.vcproj", "{68A5DD20-7057-448B-8FE0-B6AC8D205509}"
4 | EndProject
5 | Global
6 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
7 | Debug|Win32 = Debug|Win32
8 | Debug|x64 = Debug|x64
9 | Release|Win32 = Release|Win32
10 | Release|x64 = Release|x64
11 | ReleaseX64|Win32 = ReleaseX64|Win32
12 | ReleaseX64|x64 = ReleaseX64|x64
13 | EndGlobalSection
14 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
15 | {68A5DD20-7057-448B-8FE0-B6AC8D205509}.Debug|Win32.ActiveCfg = Debug|Win32
16 | {68A5DD20-7057-448B-8FE0-B6AC8D205509}.Debug|x64.ActiveCfg = Debug|x64
17 | {68A5DD20-7057-448B-8FE0-B6AC8D205509}.Release|Win32.ActiveCfg = Release|Win32
18 | {68A5DD20-7057-448B-8FE0-B6AC8D205509}.Release|x64.ActiveCfg = Release|x64
19 | {68A5DD20-7057-448B-8FE0-B6AC8D205509}.ReleaseX64|Win32.ActiveCfg = ReleaseX64|Win32
20 | {68A5DD20-7057-448B-8FE0-B6AC8D205509}.ReleaseX64|Win32.Build.0 = ReleaseX64|Win32
21 | {68A5DD20-7057-448B-8FE0-B6AC8D205509}.ReleaseX64|x64.ActiveCfg = ReleaseX64|x64
22 | {68A5DD20-7057-448B-8FE0-B6AC8D205509}.ReleaseX64|x64.Build.0 = ReleaseX64|x64
23 | EndGlobalSection
24 | GlobalSection(SolutionProperties) = preSolution
25 | HideSolutionNode = FALSE
26 | EndGlobalSection
27 | EndGlobal
28 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/jni/soundtouch/source/SoundStretch/soundstretch.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {5f361648-bec9-4711-ab49-30d7ce23ba2f}
6 | cpp;c;cxx;rc;def;r;odl;idl;hpj;bat
7 |
8 |
9 | {e7229531-1c70-4ba0-a37c-ac0e23fd6a36}
10 | h;hpp;hxx;hm;inl
11 |
12 |
13 | {8abc81f5-d032-47ae-ab04-002eb5e4f0e9}
14 | ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 | Source Files
23 |
24 |
25 | Source Files
26 |
27 |
28 |
29 |
30 | Header Files
31 |
32 |
33 | Header Files
34 |
35 |
36 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/jni/soundtouch/source/SoundStretch/soundstretch.sln:
--------------------------------------------------------------------------------
1 | Microsoft Visual Studio Solution File, Format Version 12.00
2 | # Visual Studio 2013
3 | VisualStudioVersion = 12.0.21005.1
4 | MinimumVisualStudioVersion = 10.0.40219.1
5 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "soundstretch", "soundstretch.vcxproj", "{5AACDFFA-D491-44B8-A332-DA7ACCAAF2AF}"
6 | EndProject
7 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SoundTouch", "..\SoundTouch\SoundTouch.vcxproj", "{68A5DD20-7057-448B-8FE0-B6AC8D205509}"
8 | EndProject
9 | Global
10 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
11 | Debug|Win32 = Debug|Win32
12 | Release|Win32 = Release|Win32
13 | EndGlobalSection
14 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
15 | {5AACDFFA-D491-44B8-A332-DA7ACCAAF2AF}.Debug|Win32.ActiveCfg = Debug|Win32
16 | {5AACDFFA-D491-44B8-A332-DA7ACCAAF2AF}.Debug|Win32.Build.0 = Debug|Win32
17 | {5AACDFFA-D491-44B8-A332-DA7ACCAAF2AF}.Release|Win32.ActiveCfg = Release|Win32
18 | {5AACDFFA-D491-44B8-A332-DA7ACCAAF2AF}.Release|Win32.Build.0 = Release|Win32
19 | {68A5DD20-7057-448B-8FE0-B6AC8D205509}.Debug|Win32.ActiveCfg = Debug|Win32
20 | {68A5DD20-7057-448B-8FE0-B6AC8D205509}.Debug|Win32.Build.0 = Debug|Win32
21 | {68A5DD20-7057-448B-8FE0-B6AC8D205509}.Release|Win32.ActiveCfg = Release|Win32
22 | {68A5DD20-7057-448B-8FE0-B6AC8D205509}.Release|Win32.Build.0 = Release|Win32
23 | EndGlobalSection
24 | GlobalSection(SolutionProperties) = preSolution
25 | HideSolutionNode = FALSE
26 | EndGlobalSection
27 | EndGlobal
28 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/jni/soundtouch/source/SoundTouchDLL/SoundTouchDLL.sln:
--------------------------------------------------------------------------------
1 | Microsoft Visual Studio Solution File, Format Version 10.00
2 | # Visual Studio 2008
3 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SoundTouchDLL", "SoundTouchDLL.vcproj", "{164DE61D-6391-4265-8273-30740117D356}"
4 | ProjectSection(ProjectDependencies) = postProject
5 | {68A5DD20-7057-448B-8FE0-B6AC8D205509} = {68A5DD20-7057-448B-8FE0-B6AC8D205509}
6 | EndProjectSection
7 | EndProject
8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SoundTouch", "..\SoundTouch\SoundTouch.vcproj", "{68A5DD20-7057-448B-8FE0-B6AC8D205509}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Win32 = Debug|Win32
13 | Release|Win32 = Release|Win32
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {164DE61D-6391-4265-8273-30740117D356}.Debug|Win32.ActiveCfg = Debug|Win32
17 | {164DE61D-6391-4265-8273-30740117D356}.Debug|Win32.Build.0 = Debug|Win32
18 | {164DE61D-6391-4265-8273-30740117D356}.Release|Win32.ActiveCfg = Release|Win32
19 | {164DE61D-6391-4265-8273-30740117D356}.Release|Win32.Build.0 = Release|Win32
20 | {68A5DD20-7057-448B-8FE0-B6AC8D205509}.Debug|Win32.ActiveCfg = Debug|Win32
21 | {68A5DD20-7057-448B-8FE0-B6AC8D205509}.Debug|Win32.Build.0 = Debug|Win32
22 | {68A5DD20-7057-448B-8FE0-B6AC8D205509}.Release|Win32.ActiveCfg = Release|Win32
23 | {68A5DD20-7057-448B-8FE0-B6AC8D205509}.Release|Win32.Build.0 = Release|Win32
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | EndGlobal
29 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/jni/soundtouch/config/am_include.mk:
--------------------------------------------------------------------------------
1 | ## vim:tw=78
2 | ## Process this file with automake to create Makefile.in
3 | ##
4 | ## $Id: am_include.mk 130 2011-07-17 11:46:22Z oparviai $
5 | ##
6 | ## This file is part of SoundTouch, an audio processing library for pitch/time adjustments
7 | ##
8 | ## SoundTouch is free software; you can redistribute it and/or modify it under the
9 | ## terms of the GNU General Public License as published by the Free Software
10 | ## Foundation; either version 2 of the License, or (at your option) any later
11 | ## version.
12 | ##
13 | ## SoundTouch is distributed in the hope that it will be useful, but WITHOUT ANY
14 | ## WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15 | ## A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 | ##
17 | ## You should have received a copy of the GNU General Public License along with
18 | ## this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19 | ## Place - Suite 330, Boston, MA 02111-1307, USA
20 |
21 | ## These are common definitions used in all Makefiles
22 | ## It is actually included when a makefile.am is coverted to Makefile.in
23 | ## by automake, so it's ok to have @MACROS@ that will be set by configure
24 |
25 |
26 | ## INCLUDES is automatically added to CXXFLAGS at compile time. The
27 | ## $(top_srcdir) macro is set by configure. It's important to use $(top_srcdir)
28 | ## in case a user decides to build in a separate directory from the base package
29 | ## directory. Using absolute, or relative paths is a bad idea.
30 | INCLUDES=-I$(top_srcdir)/include
31 |
32 |
33 | # doc directory
34 | pkgdocdir=$(prefix)/doc/@PACKAGE@
35 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/res/layout/activity_example.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
16 |
23 |
24 |
28 |
29 |
37 |
38 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/java/com/vehar/SoundTouch.java:
--------------------------------------------------------------------------------
1 | package com.vehar;
2 |
3 |
4 | public class SoundTouch
5 | {
6 |
7 | static
8 | {
9 | System.loadLibrary("soundtouch");
10 | }
11 |
12 | private int channels, samplingRate, bytesPerSample;
13 | private float tempo;
14 | private int pitchSemi;
15 | private int track;
16 |
17 | public SoundTouch(int track, int channels, int samplingRate, int bytesPerSample, float tempo, int pitchSemi)
18 | {
19 |
20 | this.channels = channels;
21 | this.samplingRate = samplingRate;
22 | this.bytesPerSample = bytesPerSample;
23 | this.tempo = tempo;
24 | this.pitchSemi = pitchSemi;
25 | this.track = track;
26 |
27 | setup(track, channels, samplingRate, bytesPerSample, tempo, pitchSemi);
28 | }
29 |
30 | private static synchronized native final void setup(int track, int channels, int samplingRate, int bytesPerSample, float tempo, int pitchSemi);
31 | private static synchronized native final void putBytes(int track, byte[] input, int length);
32 | private static synchronized native final int getBytes(int track, byte[] output, int toGet);
33 | private static synchronized native final void finish(int track, int bufSize);
34 | private static synchronized native final void clearBytes(int track);
35 |
36 | public void clearBuffer(int track)
37 | {
38 | clearBytes(track);
39 | }
40 | public void putBytes(byte[] input)
41 | {
42 | putBytes(track, input, input.length);
43 | }
44 |
45 | public int getBytes(byte[] output)
46 | {
47 | return getBytes(track, output, output.length);
48 | }
49 |
50 | //call finish after the last bytes have been written
51 | public void finish()
52 | {
53 | finish(track, 4096);
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/jni/soundtouch/source/Android-lib/jni/Android.mk:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2010 The Android Open Source Project
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | #
15 | # $Id: Android.mk 165 2012-12-28 19:55:23Z oparviai $
16 |
17 | LOCAL_PATH := $(call my-dir)
18 |
19 | include $(CLEAR_VARS)
20 |
21 | # *** Remember: Change -O0 into -O2 in add-applications.mk ***
22 |
23 | LOCAL_MODULE := soundtouch
24 | LOCAL_SRC_FILES := soundtouch-jni.cpp ../../SoundTouch/AAFilter.cpp ../../SoundTouch/FIFOSampleBuffer.cpp \
25 | ../../SoundTouch/FIRFilter.cpp ../../SoundTouch/cpu_detect_x86.cpp \
26 | ../../SoundTouch/RateTransposer.cpp ../../SoundTouch/SoundTouch.cpp \
27 | ../../SoundTouch/TDStretch.cpp ../../SoundTouch/BPMDetect.cpp ../../SoundTouch/PeakFinder.cpp
28 |
29 | # for native audio
30 | LOCAL_LDLIBS += -lgcc
31 | # --whole-archive -lgcc
32 | # for logging
33 | LOCAL_LDLIBS += -llog
34 | # for native asset manager
35 | #LOCAL_LDLIBS += -landroid
36 | # don't export all symbols
37 | # added "-marm" switch to use arm instruction set instead of thumb for improved calculation performance.
38 | LOCAL_CFLAGS += -Wall -fvisibility=hidden -I ../../../include -D ST_NO_EXCEPTION_HANDLING -fdata-sections -ffunction-sections -marm
39 |
40 | include $(BUILD_SHARED_LIBRARY)
41 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
29 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/jni/soundtouch/make-win.bat:
--------------------------------------------------------------------------------
1 | @REM
2 | @REM SoundTouch & SoundStretch Build script for Win32 platform
3 | @REM
4 | @REM You'll need Visual C++ 6.0 installed to compile - also execute the
5 | @REM "vcvars32.bat" in VC install directotry before running this one.
6 | @REM
7 | @REM Copyright (c) Olli Parviainen
8 | @REM File Created: 09/Sep/2003
9 | @REM
10 | @REM $Id: make-win.bat 142 2012-04-04 19:55:37Z oparviai $
11 |
12 | @rem ****************************
13 | @rem try first for VS6.0 support
14 |
15 | @if "%MsDevDir%"=="" goto nomsdevdir
16 |
17 | md bin
18 | md lib
19 | msdev source\SoundTouch\SoundTouch.dsw /MAKE ALL
20 | msdev source\SoundStretch\SoundStretch.dsw /MAKE ALL
21 |
22 | goto end
23 |
24 | :nomsdevdir
25 |
26 | @rem **********************************
27 | @rem try with devenv for VS2003 support
28 |
29 | @if "%DevEnvDir%"=="" goto nodevdir
30 |
31 | md bin
32 | md lib
33 | devenv source\SoundTouch\SoundTouch.vcproj /upgrade
34 | devenv source\SoundTouch\SoundTouch.vcproj /build debug
35 | devenv source\SoundTouch\SoundTouch.vcproj /build release
36 |
37 | devenv source\SoundStretch\SoundStretch.vcproj /upgrade
38 | devenv source\SoundStretch\SoundStretch.vcproj /build debug
39 | devenv source\SoundStretch\SoundStretch.vcproj /build release
40 |
41 | devenv source\SoundTouchDll\SoundTouchDll.vcproj /upgrade
42 | devenv source\SoundTouchDll\SoundTouchDll.vcproj /build debug
43 | devenv source\SoundTouchDll\SoundTouchDll.vcproj /build release
44 |
45 | @goto end
46 |
47 |
48 | :nodevdir
49 |
50 | @echo off
51 | echo *********************************************************************
52 | echo **
53 | echo ** ERROR: Visual Studio path not set.
54 | echo **
55 | echo ** Run "vsvars32.bat" or "vcvars32.bat" from Visual Studio installation
56 | echo ** directory, e.g. "\Program Files\Microsoft Visual Studio\VC98\Bin",
57 | echo ** then try again.
58 | echo **
59 | echo *********************************************************************
60 |
61 | :end
62 |
--------------------------------------------------------------------------------
/VoiceChanger/jni/SoundTouchDLL/SoundTouchDLL.sln:
--------------------------------------------------------------------------------
1 | Microsoft Visual Studio Solution File, Format Version 10.00
2 | # Visual Studio 2008
3 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SoundTouchDLL", "SoundTouchDLL.vcproj", "{164DE61D-6391-4265-8273-30740117D356}"
4 | ProjectSection(ProjectDependencies) = postProject
5 | {68A5DD20-7057-448B-8FE0-B6AC8D205509} = {68A5DD20-7057-448B-8FE0-B6AC8D205509}
6 | EndProjectSection
7 | EndProject
8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SoundTouch", "..\SoundTouch\SoundTouch.vcproj", "{68A5DD20-7057-448B-8FE0-B6AC8D205509}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Win32 = Debug|Win32
13 | Release|Win32 = Release|Win32
14 | ReleaseX64|Win32 = ReleaseX64|Win32
15 | EndGlobalSection
16 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
17 | {164DE61D-6391-4265-8273-30740117D356}.Debug|Win32.ActiveCfg = Debug|Win32
18 | {164DE61D-6391-4265-8273-30740117D356}.Debug|Win32.Build.0 = Debug|Win32
19 | {164DE61D-6391-4265-8273-30740117D356}.Release|Win32.ActiveCfg = Release|Win32
20 | {164DE61D-6391-4265-8273-30740117D356}.Release|Win32.Build.0 = Release|Win32
21 | {164DE61D-6391-4265-8273-30740117D356}.ReleaseX64|Win32.ActiveCfg = ReleaseX64|x64
22 | {164DE61D-6391-4265-8273-30740117D356}.ReleaseX64|Win32.Build.0 = ReleaseX64|x64
23 | {68A5DD20-7057-448B-8FE0-B6AC8D205509}.Debug|Win32.ActiveCfg = Debug|Win32
24 | {68A5DD20-7057-448B-8FE0-B6AC8D205509}.Debug|Win32.Build.0 = Debug|Win32
25 | {68A5DD20-7057-448B-8FE0-B6AC8D205509}.Release|Win32.ActiveCfg = Release|Win32
26 | {68A5DD20-7057-448B-8FE0-B6AC8D205509}.Release|Win32.Build.0 = Release|Win32
27 | {68A5DD20-7057-448B-8FE0-B6AC8D205509}.ReleaseX64|Win32.ActiveCfg = ReleaseX64|x64
28 | {68A5DD20-7057-448B-8FE0-B6AC8D205509}.ReleaseX64|Win32.Build.0 = ReleaseX64|x64
29 | EndGlobalSection
30 | GlobalSection(SolutionProperties) = preSolution
31 | HideSolutionNode = FALSE
32 | EndGlobalSection
33 | EndGlobal
34 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/jni/Android.mk:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2010 The Android Open Source Project
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | #
15 | # $Id: Android.mk 165 2012-12-28 19:55:23Z oparviai $
16 |
17 | LOCAL_PATH := $(call my-dir)
18 |
19 | include $(CLEAR_VARS)
20 |
21 | # *** Remember: Change -O0 into -O2 in add-applications.mk ***
22 |
23 | LOCAL_MODULE := soundtouch
24 | LOCAL_SRC_FILES := soundtouch-jni.cpp soundtouch/source/SoundTouch/AAFilter.cpp soundtouch/source/SoundTouch/FIFOSampleBuffer.cpp \
25 | soundtouch/source/SoundTouch/FIRFilter.cpp soundtouch/source/SoundTouch/cpu_detect_x86.cpp \
26 | soundtouch/source/SoundTouch/RateTransposer.cpp soundtouch/source/SoundTouch/SoundTouch.cpp \
27 | soundtouch/source/SoundTouch/TDStretch.cpp soundtouch/source/SoundTouch/BPMDetect.cpp soundtouch/source/SoundTouch/PeakFinder.cpp
28 |
29 | # for native audio
30 | LOCAL_LDLIBS += -lgcc
31 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/soundtouch/include
32 | # --whole-archive -lgcc
33 | # for logging
34 | LOCAL_LDLIBS += -llog
35 | # for native asset manager
36 | #LOCAL_LDLIBS += -landroid
37 | # don't export all symbols
38 | # added "-marm" switch to use arm instruction set instead of thumb for improved calculation performance.
39 | LOCAL_CFLAGS += -Wall -fvisibility=hidden -I soundtouch/source/../include -D ST_NO_EXCEPTION_HANDLING -fdata-sections -ffunction-sections -marm
40 |
41 | include $(BUILD_SHARED_LIBRARY)
42 |
--------------------------------------------------------------------------------
/VoiceChanger/jni/soundtouch/make-win.bat:
--------------------------------------------------------------------------------
1 | @REM
2 | @REM SoundTouch & SoundStretch Build script for Win32 platform
3 | @REM
4 | @REM You'll need Visual C++ 6.0 installed to compile - also execute the
5 | @REM "vcvars32.bat" in VC install directotry before running this one.
6 | @REM
7 | @REM Copyright (c) Olli Parviainen
8 | @REM File Created: 09/Sep/2003
9 | @REM
10 | @REM $Id: make-win.bat 197 2014-04-06 18:03:48Z oparviai $
11 |
12 | @rem ****************************
13 | @rem try first for VS6.0 support
14 |
15 | @if "%MsDevDir%"=="" goto nomsdevdir
16 |
17 | md bin
18 | md lib
19 | msdev source\SoundTouch\SoundTouch.dsw /MAKE ALL
20 | msdev source\SoundStretch\SoundStretch.dsw /MAKE ALL
21 |
22 | goto end
23 |
24 | :nomsdevdir
25 |
26 | @rem **********************************
27 | @rem try with devenv for VS2003 support
28 |
29 | @if "%DevEnvDir%"=="" goto nodevdir
30 |
31 | md bin
32 | md lib
33 | devenv source\SoundTouch\SoundTouch.vcproj /upgrade
34 | devenv source\SoundTouch\SoundTouch.vcproj /build debug
35 | devenv source\SoundTouch\SoundTouch.vcproj /build release
36 |
37 | devenv source\SoundStretch\SoundStretch.vcproj /upgrade
38 | devenv source\SoundStretch\SoundStretch.vcproj /build debug
39 | devenv source\SoundStretch\SoundStretch.vcproj /build release
40 | devenv source\SoundStretch\SoundStretch.vcproj /build releasex64
41 |
42 | devenv source\SoundTouchDll\SoundTouchDll.vcproj /upgrade
43 | devenv source\SoundTouchDll\SoundTouchDll.vcproj /build debug
44 | devenv source\SoundTouchDll\SoundTouchDll.vcproj /build release
45 | devenv source\SoundTouchDll\SoundTouchDll.vcproj /build releasex64
46 |
47 | @goto end
48 |
49 |
50 | :nodevdir
51 |
52 | @echo off
53 | echo *********************************************************************
54 | echo **
55 | echo ** ERROR: Visual Studio path not set.
56 | echo **
57 | echo ** Run "vsvars32.bat" or "vcvars32.bat" from Visual Studio installation
58 | echo ** directory, e.g. "\Program Files\Microsoft Visual Studio\VC98\Bin",
59 | echo ** then try again.
60 | echo **
61 | echo *********************************************************************
62 |
63 | :end
64 |
--------------------------------------------------------------------------------
/VoiceChanger/jni/Android.mk:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2010 The Android Open Project
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | #
15 | # $Id: Android.mk 165 2012-12-28 19:55:23Z oparviai $
16 |
17 | LOCAL_PATH := $(call my-dir)
18 |
19 | include $(CLEAR_VARS)
20 |
21 | # *** Remember: Change -O0 into -O2 in add-applications.mk ***
22 |
23 | LOCAL_MODULE := soundtouch
24 | LOCAL_SRC_FILES := soundtouch-jni.cpp soundtouch/AAFilter.cpp soundtouch/FIFOSampleBuffer.cpp \
25 | soundtouch/FIRFilter.cpp soundtouch/cpu_detect_x86.cpp \
26 | soundtouch/sse_optimized.cpp \
27 | soundtouch/RateTransposer.cpp soundtouch/SoundTouch.cpp \
28 | soundtouch/InterpolateCubic.cpp soundtouch/InterpolateLinear.cpp \
29 | soundtouch/InterpolateShannon.cpp soundtouch/TDStretch.cpp \
30 | soundtouch/BPMDetect.cpp soundtouch/PeakFinder.cpp
31 |
32 | # for native audio
33 | LOCAL_SHARED_LIBRARIES += -lgcc
34 | # --whole-archive -lgcc
35 | # for logging
36 | LOCAL_LDLIBS += -llog
37 | # for native asset manager
38 | #LOCAL_LDLIBS += -landroid
39 |
40 | # Custom Flags:
41 | # -fvisibility=hidden : don't export all symbols
42 | LOCAL_CFLAGS += -fvisibility=hidden -I soundtouch/include -fdata-sections -ffunction-sections
43 |
44 | # OpenMP mode : enable these flags to enable using OpenMP for parallel computation
45 | #LOCAL_CFLAGS += -fopenmp
46 | #LOCAL_LDFLAGS += -fopenmp
47 |
48 |
49 | # Use ARM instruction set instead of Thumb for improved calculation performance in ARM CPUs
50 | LOCAL_ARM_MODE := arm
51 |
52 | include $(BUILD_SHARED_LIBRARY)
53 |
--------------------------------------------------------------------------------
/VoiceChanger/import-summary.txt:
--------------------------------------------------------------------------------
1 | ECLIPSE ANDROID PROJECT IMPORT SUMMARY
2 | ======================================
3 |
4 | Ignored Files:
5 | --------------
6 | The following files were *not* copied into the new Gradle project; you
7 | should evaluate whether these are still needed in your project and if
8 | so manually move them:
9 |
10 | * .gitattributes
11 | * .gitignore
12 | * .idea\
13 | * .idea\VoiceChanger.iml
14 | * .idea\compiler.xml
15 | * .idea\copyright\
16 | * .idea\copyright\profiles_settings.xml
17 | * .idea\encodings.xml
18 | * .idea\misc.xml
19 | * .idea\modules.xml
20 | * .idea\vcs.xml
21 | * .idea\workspace.xml
22 | * README.md
23 | * proguard-project.txt
24 |
25 | Replaced Jars with Dependencies:
26 | --------------------------------
27 | The importer recognized the following .jar files as third party
28 | libraries and replaced them with Gradle dependencies instead. This has
29 | the advantage that more explicit version information is known, and the
30 | libraries can be updated automatically. However, it is possible that
31 | the .jar file in your project was of an older version than the
32 | dependency we picked, which could render the project not compileable.
33 | You can disable the jar replacement in the import wizard and try again:
34 |
35 | android-support-v4.jar => com.android.support:support-v4:19.1.0
36 |
37 | Moved Files:
38 | ------------
39 | Android Gradle projects use a different directory structure than ADT
40 | Eclipse projects. Here's how the projects were restructured:
41 |
42 | * AndroidManifest.xml => app\src\main\AndroidManifest.xml
43 | * jni\ => app\src\main\jni\
44 | * libs\jl1.0.1.jar => app\libs\jl1.0.1.jar
45 | * res\ => app\src\main\res\
46 | * src\ => app\src\main\java\
47 |
48 | Next Steps:
49 | -----------
50 | You can now build the project. The Gradle project needs network
51 | connectivity to download dependencies.
52 |
53 | Bugs:
54 | -----
55 | If for some reason your project does not build, and you determine that
56 | it is due to a bug or limitation of the Eclipse to Gradle importer,
57 | please file a bug at http://b.android.com with category
58 | Component-Tools.
59 |
60 | (This import summary is for your information only, and can be deleted
61 | after import once you are satisfied with the results.)
62 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/res/layout/activity_qrcode.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
19 |
20 |
26 |
27 |
28 |
29 |
40 |
41 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/VoiceChanger/jni/soundtouch/InterpolateCubic.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | ///
3 | /// Cubic interpolation routine.
4 | ///
5 | /// Author : Copyright (c) Olli Parviainen
6 | /// Author e-mail : oparviai 'at' iki.fi
7 | /// SoundTouch WWW: http://www.surina.net/soundtouch
8 | ///
9 | ////////////////////////////////////////////////////////////////////////////////
10 | //
11 | // $Id: InterpolateCubic.h 225 2015-07-26 14:45:48Z oparviai $
12 | //
13 | ////////////////////////////////////////////////////////////////////////////////
14 | //
15 | // License :
16 | //
17 | // SoundTouch audio processing library
18 | // Copyright (c) Olli Parviainen
19 | //
20 | // This library is free software; you can redistribute it and/or
21 | // modify it under the terms of the GNU Lesser General Public
22 | // License as published by the Free Software Foundation; either
23 | // version 2.1 of the License, or (at your option) any later version.
24 | //
25 | // This library is distributed in the hope that it will be useful,
26 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
27 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 | // Lesser General Public License for more details.
29 | //
30 | // You should have received a copy of the GNU Lesser General Public
31 | // License along with this library; if not, write to the Free Software
32 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
33 | //
34 | ////////////////////////////////////////////////////////////////////////////////
35 |
36 | #ifndef _InterpolateCubic_H_
37 | #define _InterpolateCubic_H_
38 |
39 | #include "RateTransposer.h"
40 | #include "../soundtouch/include/STTypes.h"
41 |
42 | namespace soundtouch
43 | {
44 |
45 | class InterpolateCubic : public TransposerBase
46 | {
47 | protected:
48 | virtual void resetRegisters();
49 | virtual int transposeMono(SAMPLETYPE *dest,
50 | const SAMPLETYPE *src,
51 | int &srcSamples);
52 | virtual int transposeStereo(SAMPLETYPE *dest,
53 | const SAMPLETYPE *src,
54 | int &srcSamples);
55 | virtual int transposeMulti(SAMPLETYPE *dest,
56 | const SAMPLETYPE *src,
57 | int &srcSamples);
58 |
59 | double fract;
60 |
61 | public:
62 | InterpolateCubic();
63 | };
64 |
65 | }
66 |
67 | #endif
68 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/jni/soundtouch/source/SoundStretch/Makefile.am:
--------------------------------------------------------------------------------
1 | ## Process this file with automake to create Makefile.in
2 | ##
3 | ## $Id: Makefile.am 128 2011-07-17 10:59:56Z oparviai $
4 | ##
5 | ## Copyright (C) 2003 - David W. Durham
6 | ##
7 | ## This file is part of SoundTouch, an audio processing library for pitch/time adjustments
8 | ##
9 | ## SoundTouch is free software; you can redistribute it and/or modify it under the
10 | ## terms of the GNU General Public License as published by the Free Software
11 | ## Foundation; either version 2 of the License, or (at your option) any later
12 | ## version.
13 | ##
14 | ## SoundTouch is distributed in the hope that it will be useful, but WITHOUT ANY
15 | ## WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 | ## A PARTICULAR PURPOSE. See the GNU General Public License for more details.
17 | ##
18 | ## You should have received a copy of the GNU General Public License along with
19 | ## this program; if not, write to the Free Software Foundation, Inc., 59 Temple
20 | ## Place - Suite 330, Boston, MA 02111-1307, USA
21 |
22 | include $(top_srcdir)/config/am_include.mk
23 |
24 |
25 | ## bin_PROGRAMS is the macro that tells automake the name of the programs to
26 | ## install in the bin directory (/usr/local/bin) by default. By setting
27 | ## --prefix= at configure time the user can change this (eg: ./configure
28 | ## --prefix=/usr will install soundstretch under /usr/bin/soundstretch )
29 | bin_PROGRAMS=soundstretch
30 |
31 | noinst_HEADERS=RunParameters.h WavFile.h
32 |
33 | # extra files to include in distrubution tarball
34 | EXTRA_DIST=soundstretch.dsp soundstretch.dsw soundstretch.sln soundstretch.vcproj
35 |
36 | ## for every name listed under bin_PROGRAMS, you have a _SOURCES. This lists
37 | ## all the sources in the current directory that are used to build soundstretch.
38 | soundstretch_SOURCES=main.cpp RunParameters.cpp WavFile.cpp
39 |
40 | ## soundstretch_LDADD is a list of extras to pass at link time. All the objects
41 | ## created by the above soundstretch_SOURCES are automatically linked in, so here I
42 | ## list object files from other directories as well as flags passed to the
43 | ## linker.
44 | soundstretch_LDADD=../SoundTouch/libSoundTouch.la -lm
45 |
46 | ## linker flags.
47 | # OP 2011-7-17 Linker flags disabled to prevent stripping symbols by default
48 | # soundstretch_LDFLAGS=-s
49 |
50 | ## additional compiler flags
51 | soundstretch_CXXFLAGS=-O3
52 |
53 | #clean-local:
54 | # -rm -f additional-files-to-remove-on-make-clean
55 |
--------------------------------------------------------------------------------
/VoiceChanger/jni/soundtouch/cpu_detect.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | ///
3 | /// A header file for detecting the Intel MMX instructions set extension.
4 | ///
5 | /// Please see 'mmx_win.cpp', 'mmx_cpp.cpp' and 'mmx_non_x86.cpp' for the
6 | /// routine implementations for x86 Windows, x86 gnu version and non-x86
7 | /// platforms, respectively.
8 | ///
9 | /// Author : Copyright (c) Olli Parviainen
10 | /// Author e-mail : oparviai 'at' iki.fi
11 | /// SoundTouch WWW: http://www.surina.net/soundtouch
12 | ///
13 | ////////////////////////////////////////////////////////////////////////////////
14 | //
15 | // Last changed : $Date: 2008-02-10 18:26:55 +0200 (Sun, 10 Feb 2008) $
16 | // File revision : $Revision: 4 $
17 | //
18 | // $Id: cpu_detect.h 11 2008-02-10 16:26:55Z oparviai $
19 | //
20 | ////////////////////////////////////////////////////////////////////////////////
21 | //
22 | // License :
23 | //
24 | // SoundTouch audio processing library
25 | // Copyright (c) Olli Parviainen
26 | //
27 | // This library is free software; you can redistribute it and/or
28 | // modify it under the terms of the GNU Lesser General Public
29 | // License as published by the Free Software Foundation; either
30 | // version 2.1 of the License, or (at your option) any later version.
31 | //
32 | // This library is distributed in the hope that it will be useful,
33 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
34 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
35 | // Lesser General Public License for more details.
36 | //
37 | // You should have received a copy of the GNU Lesser General Public
38 | // License along with this library; if not, write to the Free Software
39 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
40 | //
41 | ////////////////////////////////////////////////////////////////////////////////
42 |
43 | #ifndef _CPU_DETECT_H_
44 | #define _CPU_DETECT_H_
45 |
46 | #include "../soundtouch/include/STTypes.h"
47 |
48 | #define SUPPORT_MMX 0x0001
49 | #define SUPPORT_3DNOW 0x0002
50 | #define SUPPORT_ALTIVEC 0x0004
51 | #define SUPPORT_SSE 0x0008
52 | #define SUPPORT_SSE2 0x0010
53 |
54 | /// Checks which instruction set extensions are supported by the CPU.
55 | ///
56 | /// \return A bitmask of supported extensions, see SUPPORT_... defines.
57 | uint detectCPUextensions(void);
58 |
59 | /// Disables given set of instruction extensions. See SUPPORT_... defines.
60 | void disableExtensions(uint wDisableMask);
61 |
62 | #endif // _CPU_DETECT_H_
63 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/jni/soundtouch/source/SoundTouch/cpu_detect.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | ///
3 | /// A header file for detecting the Intel MMX instructions set extension.
4 | ///
5 | /// Please see 'mmx_win.cpp', 'mmx_cpp.cpp' and 'mmx_non_x86.cpp' for the
6 | /// routine implementations for x86 Windows, x86 gnu version and non-x86
7 | /// platforms, respectively.
8 | ///
9 | /// Author : Copyright (c) Olli Parviainen
10 | /// Author e-mail : oparviai 'at' iki.fi
11 | /// SoundTouch WWW: http://www.surina.net/soundtouch
12 | ///
13 | ////////////////////////////////////////////////////////////////////////////////
14 | //
15 | // Last changed : $Date: 2008-02-10 18:26:55 +0200 (Sun, 10 Feb 2008) $
16 | // File revision : $Revision: 4 $
17 | //
18 | // $Id: cpu_detect.h 11 2008-02-10 16:26:55Z oparviai $
19 | //
20 | ////////////////////////////////////////////////////////////////////////////////
21 | //
22 | // License :
23 | //
24 | // SoundTouch audio processing library
25 | // Copyright (c) Olli Parviainen
26 | //
27 | // This library is free software; you can redistribute it and/or
28 | // modify it under the terms of the GNU Lesser General Public
29 | // License as published by the Free Software Foundation; either
30 | // version 2.1 of the License, or (at your option) any later version.
31 | //
32 | // This library is distributed in the hope that it will be useful,
33 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
34 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
35 | // Lesser General Public License for more details.
36 | //
37 | // You should have received a copy of the GNU Lesser General Public
38 | // License along with this library; if not, write to the Free Software
39 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
40 | //
41 | ////////////////////////////////////////////////////////////////////////////////
42 |
43 | #ifndef _CPU_DETECT_H_
44 | #define _CPU_DETECT_H_
45 |
46 | #include "STTypes.h"
47 |
48 | #define SUPPORT_MMX 0x0001
49 | #define SUPPORT_3DNOW 0x0002
50 | #define SUPPORT_ALTIVEC 0x0004
51 | #define SUPPORT_SSE 0x0008
52 | #define SUPPORT_SSE2 0x0010
53 |
54 | /// Checks which instruction set extensions are supported by the CPU.
55 | ///
56 | /// \return A bitmask of supported extensions, see SUPPORT_... defines.
57 | uint detectCPUextensions(void);
58 |
59 | /// Disables given set of instruction extensions. See SUPPORT_... defines.
60 | void disableExtensions(uint wDisableMask);
61 |
62 | #endif // _CPU_DETECT_H_
63 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/jni/soundtouch/source/SoundStretch/RunParameters.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | ///
3 | /// A class for parsing the 'soundstretch' application command line parameters
4 | ///
5 | /// Author : Copyright (c) Olli Parviainen
6 | /// Author e-mail : oparviai 'at' iki.fi
7 | /// SoundTouch WWW: http://www.surina.net/soundtouch
8 | ///
9 | ////////////////////////////////////////////////////////////////////////////////
10 | //
11 | // Last changed : $Date: 2009-05-17 19:48:30 +0300 (Sun, 17 May 2009) $
12 | // File revision : $Revision: 4 $
13 | //
14 | // $Id: RunParameters.h 72 2009-05-17 16:48:30Z oparviai $
15 | //
16 | ////////////////////////////////////////////////////////////////////////////////
17 | //
18 | // License :
19 | //
20 | // SoundTouch audio processing library
21 | // Copyright (c) Olli Parviainen
22 | //
23 | // This library is free software; you can redistribute it and/or
24 | // modify it under the terms of the GNU Lesser General Public
25 | // License as published by the Free Software Foundation; either
26 | // version 2.1 of the License, or (at your option) any later version.
27 | //
28 | // This library is distributed in the hope that it will be useful,
29 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
30 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
31 | // Lesser General Public License for more details.
32 | //
33 | // You should have received a copy of the GNU Lesser General Public
34 | // License along with this library; if not, write to the Free Software
35 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
36 | //
37 | ////////////////////////////////////////////////////////////////////////////////
38 |
39 | #ifndef RUNPARAMETERS_H
40 | #define RUNPARAMETERS_H
41 |
42 | #include "STTypes.h"
43 | #include
44 |
45 | using namespace std;
46 |
47 | /// Parses command line parameters into program parameters
48 | class RunParameters
49 | {
50 | private:
51 | void throwIllegalParamExp(const string &str) const;
52 | void throwLicense() const;
53 | void parseSwitchParam(const string &str);
54 | void checkLimits();
55 | float parseSwitchValue(const string &str) const;
56 |
57 | public:
58 | char *inFileName;
59 | char *outFileName;
60 | float tempoDelta;
61 | float pitchDelta;
62 | float rateDelta;
63 | int quick;
64 | int noAntiAlias;
65 | float goalBPM;
66 | BOOL detectBPM;
67 | BOOL speech;
68 |
69 | RunParameters(const int nParams, const char * const paramStr[]);
70 | };
71 |
72 | #endif
73 |
--------------------------------------------------------------------------------
/VoiceChanger/jni/soundtouch/soundtouch.m4:
--------------------------------------------------------------------------------
1 | # m4 configure test script for the SoundTouch library
2 | # (c)2003 David W. Durham
3 | #
4 | # $Id: soundtouch.m4 20 2008-02-17 14:20:52Z oparviai $
5 | #
6 | # This file can be included with other packages that need to test
7 | # for libSoundTouch.
8 | #
9 | # It will #define HAVE_LIBSOUNDTOUCH iff the library is found
10 | # It will AC_SUBST SOUNDTOUCH_LIBS and SOUNDTOUCH_CXXFLAGS as well
11 | # It also defines some flags to the configure script for specifying
12 | # the location to search for libSoundTouch
13 | #
14 | # A user of libSoundTouch should add @SOUNDTOUCH_LIBS@ and
15 | # @SOUNDTOUCH_CXXFLAGS@ to the appropriate variables in his
16 | # Makefile.am files
17 | #
18 | # This script works with autoconf-2.5x and automake-1.6 but I have
19 | # not tested it with older versions.
20 |
21 |
22 | dnl min version not supported yet
23 | dnl AM_PATH_SOUNDTOUCH([MINMUM-VERSION, [(additional) ACTION-IF-FOUND] [, ACTION-IF-NOT-FOUND]]])
24 |
25 | AH_TEMPLATE([HAVE_LIBSOUNDTOUCH], [defined by $0])
26 | SOUNDTOUCH_CXXFLAGS=""
27 | SOUNDTOUCH_LIBS=""
28 |
29 | AC_DEFUN([AM_PATH_SOUNDTOUCH],[
30 | AC_ARG_WITH(soundtouch-prefix,[ --with-soundtouch-prefix=DIR Prefix where SoundTouch was installed (optional)], [soundtouch_prefix="$withval"],[soundtouch_prefix=""])
31 |
32 | AC_ARG_ENABLE(soundtouch-check,[ --disable-soundtouch-check Do not look for the SoundTouch Library],[enable_soundtouch_check="$enableval"],[enable_soundtouch_check="yes"])
33 |
34 | if test "$enable_soundtouch_check" = "yes"
35 | then
36 | saved_CPPFLAGS="$CPPFLAGS"
37 | saved_LDFLAGS="$LDFLAGS"
38 |
39 | CPPFLAGS="$CPPFLAGS -I$soundtouch_prefix/include"
40 | LDFLAGS="$LDFLAGS -L$soundtouch_prefix/lib"
41 |
42 | dnl make sure SoundTouch.h header file exists
43 | dnl could use AC_CHECK_HEADERS to check for all of them, but the supporting .h file names may change later
44 | AC_CHECK_HEADER([soundtouch/SoundTouch.h],[
45 | dnl SoundTouch.h found
46 | dnl make sure libSoundTouch is linkable
47 | AC_CHECK_LIB([SoundTouch],[soundtouch_ac_test],[
48 | dnl libSoundTouch found
49 | SOUNDTOUCH_CXXFLAGS="-I$soundtouch_prefix/include"
50 | SOUNDTOUCH_LIBS="-L$soundtouch_prefix/lib -lSoundTouch"
51 | AC_DEFINE([HAVE_LIBSOUNDTOUCH])
52 |
53 | dnl run action-if-found
54 | ifelse([$2], , :, [$2])
55 | ],[
56 | dnl run action-if-not-found
57 | ifelse([$3], , :, [$3])
58 | ])
59 | ],[
60 | dnl run action-if-not-found
61 | ifelse([$3], , :, [$3])
62 | ])
63 |
64 | CPPFLAGS="$saved_CPPFLAGS"
65 | LDFLAGS="$saved_LDFLAGS"
66 | fi
67 |
68 | AC_SUBST(SOUNDTOUCH_CXXFLAGS)
69 | AC_SUBST(SOUNDTOUCH_LIBS)
70 | ])
71 |
--------------------------------------------------------------------------------
/VoiceChanger/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/jni/soundtouch/soundtouch.m4:
--------------------------------------------------------------------------------
1 | # m4 configure test script for the SoundTouch library
2 | # (c)2003 David W. Durham
3 | #
4 | # $Id: soundtouch.m4 20 2008-02-17 14:20:52Z oparviai $
5 | #
6 | # This file can be included with other packages that need to test
7 | # for libSoundTouch.
8 | #
9 | # It will #define HAVE_LIBSOUNDTOUCH iff the library is found
10 | # It will AC_SUBST SOUNDTOUCH_LIBS and SOUNDTOUCH_CXXFLAGS as well
11 | # It also defines some flags to the configure script for specifying
12 | # the location to search for libSoundTouch
13 | #
14 | # A user of libSoundTouch should add @SOUNDTOUCH_LIBS@ and
15 | # @SOUNDTOUCH_CXXFLAGS@ to the appropriate variables in his
16 | # Makefile.am files
17 | #
18 | # This script works with autoconf-2.5x and automake-1.6 but I have
19 | # not tested it with older versions.
20 |
21 |
22 | dnl min version not supported yet
23 | dnl AM_PATH_SOUNDTOUCH([MINMUM-VERSION, [(additional) ACTION-IF-FOUND] [, ACTION-IF-NOT-FOUND]]])
24 |
25 | AH_TEMPLATE([HAVE_LIBSOUNDTOUCH], [defined by $0])
26 | SOUNDTOUCH_CXXFLAGS=""
27 | SOUNDTOUCH_LIBS=""
28 |
29 | AC_DEFUN([AM_PATH_SOUNDTOUCH],[
30 | AC_ARG_WITH(soundtouch-prefix,[ --with-soundtouch-prefix=DIR Prefix where SoundTouch was installed (optional)], [soundtouch_prefix="$withval"],[soundtouch_prefix=""])
31 |
32 | AC_ARG_ENABLE(soundtouch-check,[ --disable-soundtouch-check Do not look for the SoundTouch Library],[enable_soundtouch_check="$enableval"],[enable_soundtouch_check="yes"])
33 |
34 | if test "$enable_soundtouch_check" = "yes"
35 | then
36 | saved_CPPFLAGS="$CPPFLAGS"
37 | saved_LDFLAGS="$LDFLAGS"
38 |
39 | CPPFLAGS="$CPPFLAGS -I$soundtouch_prefix/include"
40 | LDFLAGS="$LDFLAGS -L$soundtouch_prefix/lib"
41 |
42 | dnl make sure SoundTouch.h header file exists
43 | dnl could use AC_CHECK_HEADERS to check for all of them, but the supporting .h file names may change later
44 | AC_CHECK_HEADER([soundtouch/SoundTouch.h],[
45 | dnl SoundTouch.h found
46 | dnl make sure libSoundTouch is linkable
47 | AC_CHECK_LIB([SoundTouch],[soundtouch_ac_test],[
48 | dnl libSoundTouch found
49 | SOUNDTOUCH_CXXFLAGS="-I$soundtouch_prefix/include"
50 | SOUNDTOUCH_LIBS="-L$soundtouch_prefix/lib -lSoundTouch"
51 | AC_DEFINE([HAVE_LIBSOUNDTOUCH])
52 |
53 | dnl run action-if-found
54 | ifelse([$2], , :, [$2])
55 | ],[
56 | dnl run action-if-not-found
57 | ifelse([$3], , :, [$3])
58 | ])
59 | ],[
60 | dnl run action-if-not-found
61 | ifelse([$3], , :, [$3])
62 | ])
63 |
64 | CPPFLAGS="$saved_CPPFLAGS"
65 | LDFLAGS="$saved_LDFLAGS"
66 | fi
67 |
68 | AC_SUBST(SOUNDTOUCH_CXXFLAGS)
69 | AC_SUBST(SOUNDTOUCH_LIBS)
70 | ])
71 |
--------------------------------------------------------------------------------
/VoiceChanger/jni/soundtouch/InterpolateShannon.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | ///
3 | /// Sample interpolation routine using 8-tap band-limited Shannon interpolation
4 | /// with kaiser window.
5 | ///
6 | /// Notice. This algorithm is remarkably much heavier than linear or cubic
7 | /// interpolation, and not remarkably better than cubic algorithm. Thus mostly
8 | /// for experimental purposes
9 | ///
10 | /// Author : Copyright (c) Olli Parviainen
11 | /// Author e-mail : oparviai 'at' iki.fi
12 | /// SoundTouch WWW: http://www.surina.net/soundtouch
13 | ///
14 | ////////////////////////////////////////////////////////////////////////////////
15 | //
16 | // $Id: InterpolateShannon.h 225 2015-07-26 14:45:48Z oparviai $
17 | //
18 | ////////////////////////////////////////////////////////////////////////////////
19 | //
20 | // License :
21 | //
22 | // SoundTouch audio processing library
23 | // Copyright (c) Olli Parviainen
24 | //
25 | // This library is free software; you can redistribute it and/or
26 | // modify it under the terms of the GNU Lesser General Public
27 | // License as published by the Free Software Foundation; either
28 | // version 2.1 of the License, or (at your option) any later version.
29 | //
30 | // This library is distributed in the hope that it will be useful,
31 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
32 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
33 | // Lesser General Public License for more details.
34 | //
35 | // You should have received a copy of the GNU Lesser General Public
36 | // License along with this library; if not, write to the Free Software
37 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
38 | //
39 | ////////////////////////////////////////////////////////////////////////////////
40 |
41 | #ifndef _InterpolateShannon_H_
42 | #define _InterpolateShannon_H_
43 |
44 | #include "RateTransposer.h"
45 | #include "../soundtouch/include/STTypes.h"
46 |
47 | namespace soundtouch
48 | {
49 |
50 | class InterpolateShannon : public TransposerBase
51 | {
52 | protected:
53 | void resetRegisters();
54 | int transposeMono(SAMPLETYPE *dest,
55 | const SAMPLETYPE *src,
56 | int &srcSamples);
57 | int transposeStereo(SAMPLETYPE *dest,
58 | const SAMPLETYPE *src,
59 | int &srcSamples);
60 | int transposeMulti(SAMPLETYPE *dest,
61 | const SAMPLETYPE *src,
62 | int &srcSamples);
63 |
64 | double fract;
65 |
66 | public:
67 | InterpolateShannon();
68 | };
69 |
70 | }
71 |
72 | #endif
73 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/jni/soundtouch/source/SoundTouch/Makefile.am:
--------------------------------------------------------------------------------
1 | ## Process this file with automake to create Makefile.in
2 | ##
3 | ## $Id: Makefile.am 138 2012-04-01 20:00:09Z oparviai $
4 | ##
5 | ## This file is part of SoundTouch, an audio processing library for pitch/time adjustments
6 | ##
7 | ## SoundTouch is free software; you can redistribute it and/or modify it under the
8 | ## terms of the GNU General Public License as published by the Free Software
9 | ## Foundation; either version 2 of the License, or (at your option) any later
10 | ## version.
11 | ##
12 | ## SoundTouch is distributed in the hope that it will be useful, but WITHOUT ANY
13 | ## WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14 | ## A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15 | ##
16 | ## You should have received a copy of the GNU General Public License along with
17 | ## this program; if not, write to the Free Software Foundation, Inc., 59 Temple
18 | ## Place - Suite 330, Boston, MA 02111-1307, USA
19 |
20 |
21 | include $(top_srcdir)/config/am_include.mk
22 |
23 |
24 | # set to something if you want other stuff to be included in the distribution tarball
25 | EXTRA_DIST=SoundTouch.dsp SoundTouch.dsw SoundTouch.sln SoundTouch.vcproj
26 |
27 | noinst_HEADERS=AAFilter.h cpu_detect.h cpu_detect_x86.cpp FIRFilter.h RateTransposer.h TDStretch.h PeakFinder.h
28 |
29 | lib_LTLIBRARIES=libSoundTouch.la
30 | #
31 | libSoundTouch_la_SOURCES=AAFilter.cpp FIRFilter.cpp FIFOSampleBuffer.cpp RateTransposer.cpp SoundTouch.cpp TDStretch.cpp cpu_detect_x86.cpp BPMDetect.cpp PeakFinder.cpp
32 |
33 |
34 | # Compiler flags
35 | AM_CXXFLAGS=-O3 -fcheck-new -I../../include
36 |
37 | # Compile the files that need MMX and SSE individually.
38 | libSoundTouch_la_LIBADD=libSoundTouchMMX.la libSoundTouchSSE.la
39 | noinst_LTLIBRARIES=libSoundTouchMMX.la libSoundTouchSSE.la
40 | libSoundTouchMMX_la_SOURCES=mmx_optimized.cpp
41 | libSoundTouchSSE_la_SOURCES=sse_optimized.cpp
42 |
43 | # We enable optimizations by default.
44 | # If MMX is supported compile with -mmmx.
45 | # Do not assume -msse is also supported.
46 | if HAVE_MMX
47 | libSoundTouchMMX_la_CXXFLAGS = -mmmx $(AM_CXXFLAGS)
48 | else
49 | libSoundTouchMMX_la_CXXFLAGS = $(AM_CXXFLAGS)
50 | endif
51 |
52 | # We enable optimizations by default.
53 | # If SSE is supported compile with -msse.
54 | if HAVE_SSE
55 | libSoundTouchSSE_la_CXXFLAGS = -msse $(AM_CXXFLAGS)
56 | else
57 | libSoundTouchSSE_la_CXXFLAGS = $(AM_CXXFLAGS)
58 | endif
59 |
60 | # Let the user disable optimizations if he wishes to.
61 | if !X86_OPTIMIZATIONS
62 | libSoundTouchMMX_la_CXXFLAGS = $(AM_CXXFLAGS)
63 | libSoundTouchSSE_la_CXXFLAGS = $(AM_CXXFLAGS)
64 | endif
65 |
66 |
67 | # other linking flags to add
68 | # noinst_LTLIBRARIES = libSoundTouchOpt.la
69 | # libSoundTouch_la_LIBADD = libSoundTouchOpt.la
70 | # libSoundTouchOpt_la_SOURCES = mmx_optimized.cpp sse_optimized.cpp
71 | # libSoundTouchOpt_la_CXXFLAGS = -O3 -msse -fcheck-new -I../../include
72 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/res/layout/activity_send.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
21 |
22 |
30 |
31 |
32 |
39 |
40 |
47 |
48 |
55 |
56 |
57 |
65 |
66 |
76 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/jni/soundtouch/Makefile.am:
--------------------------------------------------------------------------------
1 | ## Process this file with automake to create Makefile.in
2 | ##
3 | ## $Id: Makefile.am 89 2010-04-03 15:30:08Z oparviai $
4 | ##
5 | ## Copyright (C) 2003 - David W. Durham
6 | ##
7 | ## This file is part of SoundTouch, an audio processing library for pitch/time adjustments
8 | ##
9 | ## SoundTouch is free software; you can redistribute it and/or modify it under the
10 | ## terms of the GNU General Public License as published by the Free Software
11 | ## Foundation; either version 2 of the License, or (at your option) any later
12 | ## version.
13 | ##
14 | ## SoundTouch is distributed in the hope that it will be useful, but WITHOUT ANY
15 | ## WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 | ## A PARTICULAR PURPOSE. See the GNU General Public License for more details.
17 | ##
18 | ## You should have received a copy of the GNU General Public License along with
19 | ## this program; if not, write to the Free Software Foundation, Inc., 59 Temple
20 | ## Place - Suite 330, Boston, MA 02111-1307, USA
21 |
22 | ## I used config/am_include.mk for common definitions
23 | include $(top_srcdir)/config/am_include.mk
24 |
25 | ## Descend into SUBDIRS and run make. Look at the Makefile.am files in the
26 | ## subdirectories Start at frontend_fox/Makefile.am to see how everything works.
27 | SUBDIRS=include source
28 |
29 |
30 | # list files that are documentation to be packaged in a release tarball and installed
31 | pkgdoc_DATA=COPYING.TXT README.html
32 |
33 | # extra data files that are to be pacakged in a release tarball and installed into the data directory
34 | #pkgdata_DATA=
35 |
36 | # sets up for soundtouch.m4 to be installed
37 | m4datadir=$(datadir)/aclocal
38 | m4data_DATA=soundtouch.m4
39 |
40 | ## These extra files and directories will be included in the distribution. by
41 | ## using make-dist by default many common filenames are automatically included
42 | ## such as AUTHORS, COPYING, etc the bootstrap script really shouldn't be a part
43 | ## of a final package, but it is useful for developers who might want to make
44 | ## changes to the configure scripts or makefiles.
45 | # NOTE: wouldn't have to list the .TXT file if it were named without the .TXT
46 | EXTRA_DIST= \
47 | soundtouch.m4 \
48 | config/m4 \
49 | bootstrap \
50 | make-win.bat \
51 | COPYING.TXT \
52 | README.html
53 |
54 | pkgconfigdir = $(libdir)/pkgconfig
55 | pkgconfig_DATA = soundtouch.pc
56 |
57 | ## This removes stuff from the distribution which may be present
58 | ## from a cvs checkout or other build reasons
59 | dist-hook:
60 | rm -rf `find $(distdir) -type d -name CVS` # remove all CVS directories
61 | echo rm -rf `find $(distdir) -type f -name \.\#\*` # CVS revision files left around for some reason
62 |
63 | ## This happens at 'make distclean'
64 | #distcleancheck:
65 | # rm -rf files-that-may-also-need-to-be-deleted-on-'make distclean'
66 |
67 |
68 | # flag to aclocal where to find m4 macros for tests
69 | ACLOCAL_AMFLAGS = -I config/m4
70 | AUTOMAKE_OPTIONS = foreign
71 |
--------------------------------------------------------------------------------
/VoiceChanger/jni/soundtouch/Makefile.am:
--------------------------------------------------------------------------------
1 | ## Process this file with automake to create Makefile.in
2 | ##
3 | ## $Id: Makefile.am 230 2015-09-20 07:38:32Z oparviai $
4 | ##
5 | ## This file is part of SoundTouch, an audio processing library for pitch/time adjustments
6 | ##
7 | ## SoundTouch is free software; you can redistribute it and/or modify it under the
8 | ## terms of the GNU General Public License as published by the Free Software
9 | ## Foundation; either version 2 of the License, or (at your option) any later
10 | ## version.
11 | ##
12 | ## SoundTouch is distributed in the hope that it will be useful, but WITHOUT ANY
13 | ## WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14 | ## A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15 | ##
16 | ## You should have received a copy of the GNU General Public License along with
17 | ## this program; if not, write to the Free Software Foundation, Inc., 59 Temple
18 | ## Place - Suite 330, Boston, MA 02111-1307, USA
19 |
20 |
21 | include $(top_srcdir)/config/am_include.mk
22 |
23 |
24 | # set to something if you want other stuff to be included in the distribution tarball
25 | EXTRA_DIST=SoundTouch.dsp SoundTouch.dsw SoundTouch.sln SoundTouch.vcproj
26 |
27 | noinst_HEADERS=AAFilter.h cpu_detect.h cpu_detect_x86.cpp FIRFilter.h RateTransposer.h TDStretch.h PeakFinder.h
28 |
29 | lib_LTLIBRARIES=libSoundTouch.la
30 | #
31 | libSoundTouch_la_SOURCES=AAFilter.cpp FIRFilter.cpp FIFOSampleBuffer.cpp \
32 | RateTransposer.cpp SoundTouch.cpp TDStretch.cpp cpu_detect_x86.cpp \
33 | BPMDetect.cpp PeakFinder.cpp InterpolateLinear.cpp InterpolateCubic.cpp \
34 | InterpolateShannon.cpp
35 |
36 | # Compiler flags
37 | AM_CXXFLAGS+=-O3
38 |
39 | # Compile the files that need MMX and SSE individually.
40 | libSoundTouch_la_LIBADD=libSoundTouchMMX.la libSoundTouchSSE.la
41 | noinst_LTLIBRARIES=libSoundTouchMMX.la libSoundTouchSSE.la
42 | libSoundTouchMMX_la_SOURCES=mmx_optimized.cpp
43 | libSoundTouchSSE_la_SOURCES=sse_optimized.cpp
44 |
45 | # We enable optimizations by default.
46 | # If MMX is supported compile with -mmmx.
47 | # Do not assume -msse is also supported.
48 | if HAVE_MMX
49 | libSoundTouchMMX_la_CXXFLAGS = -mmmx $(AM_CXXFLAGS)
50 | else
51 | libSoundTouchMMX_la_CXXFLAGS = $(AM_CXXFLAGS)
52 | endif
53 |
54 | # We enable optimizations by default.
55 | # If SSE is supported compile with -msse.
56 | if HAVE_SSE
57 | libSoundTouchSSE_la_CXXFLAGS = -msse $(AM_CXXFLAGS)
58 | else
59 | libSoundTouchSSE_la_CXXFLAGS = $(AM_CXXFLAGS)
60 | endif
61 |
62 | # Let the user disable optimizations if he wishes to.
63 | if !X86_OPTIMIZATIONS
64 | libSoundTouchMMX_la_CXXFLAGS = $(AM_CXXFLAGS)
65 | libSoundTouchSSE_la_CXXFLAGS = $(AM_CXXFLAGS)
66 | endif
67 |
68 | # Modify the default 0.0.0 to LIB_SONAME.0.0
69 | libSoundTouch_la_LDFLAGS=-version-info @LIB_SONAME@
70 |
71 | # other linking flags to add
72 | # noinst_LTLIBRARIES = libSoundTouchOpt.la
73 | # libSoundTouch_la_LIBADD = libSoundTouchOpt.la
74 | # libSoundTouchOpt_la_SOURCES = mmx_optimized.cpp sse_optimized.cpp
75 | # libSoundTouchOpt_la_CXXFLAGS = -O3 -msse -fcheck-new -I../../include
76 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/jni/soundtouch/source/SoundTouch/SoundTouch.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {fe1a3908-a89e-4691-b904-296efdc0ba9c}
6 | cpp;c;cxx;rc;def;r;odl;idl;hpj;bat
7 |
8 |
9 | {86819e0d-7d18-4bb4-9558-c7f4af1846bb}
10 |
11 |
12 | {0618773b-8d8a-4c3d-8f56-664bb89e0fa8}
13 | h;hpp;hxx;hm;inl
14 |
15 |
16 |
17 |
18 | Source Files
19 |
20 |
21 | Source Files
22 |
23 |
24 | Source Files
25 |
26 |
27 | Source Files
28 |
29 |
30 | Source Files
31 |
32 |
33 | Source Files
34 |
35 |
36 | Source Files
37 |
38 |
39 | Source Files
40 |
41 |
42 | Source Files
43 |
44 |
45 | Source Files\bpm
46 |
47 |
48 | Source Files\bpm
49 |
50 |
51 |
52 |
53 | Header Files
54 |
55 |
56 | Header Files
57 |
58 |
59 | Header Files
60 |
61 |
62 | Header Files
63 |
64 |
65 | Header Files
66 |
67 |
68 | Header Files
69 |
70 |
71 | Header Files
72 |
73 |
74 | Header Files
75 |
76 |
77 | Header Files
78 |
79 |
80 | Header Files
81 |
82 |
83 | Header Files
84 |
85 |
86 |
--------------------------------------------------------------------------------
/VoiceChanger/jni/soundtouch/InterpolateLinear.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | ///
3 | /// Linear interpolation routine.
4 | ///
5 | /// Author : Copyright (c) Olli Parviainen
6 | /// Author e-mail : oparviai 'at' iki.fi
7 | /// SoundTouch WWW: http://www.surina.net/soundtouch
8 | ///
9 | ////////////////////////////////////////////////////////////////////////////////
10 | //
11 | // $Id: InterpolateLinear.h 225 2015-07-26 14:45:48Z oparviai $
12 | //
13 | ////////////////////////////////////////////////////////////////////////////////
14 | //
15 | // License :
16 | //
17 | // SoundTouch audio processing library
18 | // Copyright (c) Olli Parviainen
19 | //
20 | // This library is free software; you can redistribute it and/or
21 | // modify it under the terms of the GNU Lesser General Public
22 | // License as published by the Free Software Foundation; either
23 | // version 2.1 of the License, or (at your option) any later version.
24 | //
25 | // This library is distributed in the hope that it will be useful,
26 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
27 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 | // Lesser General Public License for more details.
29 | //
30 | // You should have received a copy of the GNU Lesser General Public
31 | // License along with this library; if not, write to the Free Software
32 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
33 | //
34 | ////////////////////////////////////////////////////////////////////////////////
35 |
36 | #ifndef _InterpolateLinear_H_
37 | #define _InterpolateLinear_H_
38 |
39 | #include "RateTransposer.h"
40 | #include "../soundtouch/include/STTypes.h"
41 |
42 | namespace soundtouch
43 | {
44 |
45 | /// Linear transposer class that uses integer arithmetics
46 | class InterpolateLinearInteger : public TransposerBase
47 | {
48 | protected:
49 | int iFract;
50 | int iRate;
51 |
52 | virtual void resetRegisters();
53 |
54 | virtual int transposeMono(SAMPLETYPE *dest,
55 | const SAMPLETYPE *src,
56 | int &srcSamples);
57 | virtual int transposeStereo(SAMPLETYPE *dest,
58 | const SAMPLETYPE *src,
59 | int &srcSamples);
60 | virtual int transposeMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, int &srcSamples);
61 | public:
62 | InterpolateLinearInteger();
63 |
64 | /// Sets new target rate. Normal rate = 1.0, smaller values represent slower
65 | /// rate, larger faster rates.
66 | virtual void setRate(double newRate);
67 | };
68 |
69 |
70 | /// Linear transposer class that uses floating point arithmetics
71 | class InterpolateLinearFloat : public TransposerBase
72 | {
73 | protected:
74 | double fract;
75 |
76 | virtual void resetRegisters();
77 |
78 | virtual int transposeMono(SAMPLETYPE *dest,
79 | const SAMPLETYPE *src,
80 | int &srcSamples);
81 | virtual int transposeStereo(SAMPLETYPE *dest,
82 | const SAMPLETYPE *src,
83 | int &srcSamples);
84 | virtual int transposeMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, int &srcSamples);
85 |
86 | public:
87 | InterpolateLinearFloat();
88 | };
89 |
90 | }
91 |
92 | #endif
93 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/jni/soundtouch/source/SoundTouch/AAFilter.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | ///
3 | /// Sampled sound tempo changer/time stretch algorithm. Changes the sound tempo
4 | /// while maintaining the original pitch by using a time domain WSOLA-like method
5 | /// with several performance-increasing tweaks.
6 | ///
7 | /// Anti-alias filter is used to prevent folding of high frequencies when
8 | /// transposing the sample rate with interpolation.
9 | ///
10 | /// Author : Copyright (c) Olli Parviainen
11 | /// Author e-mail : oparviai 'at' iki.fi
12 | /// SoundTouch WWW: http://www.surina.net/soundtouch
13 | ///
14 | ////////////////////////////////////////////////////////////////////////////////
15 | //
16 | // Last changed : $Date: 2008-02-10 18:26:55 +0200 (Sun, 10 Feb 2008) $
17 | // File revision : $Revision: 4 $
18 | //
19 | // $Id: AAFilter.h 11 2008-02-10 16:26:55Z oparviai $
20 | //
21 | ////////////////////////////////////////////////////////////////////////////////
22 | //
23 | // License :
24 | //
25 | // SoundTouch audio processing library
26 | // Copyright (c) Olli Parviainen
27 | //
28 | // This library is free software; you can redistribute it and/or
29 | // modify it under the terms of the GNU Lesser General Public
30 | // License as published by the Free Software Foundation; either
31 | // version 2.1 of the License, or (at your option) any later version.
32 | //
33 | // This library is distributed in the hope that it will be useful,
34 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
35 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
36 | // Lesser General Public License for more details.
37 | //
38 | // You should have received a copy of the GNU Lesser General Public
39 | // License along with this library; if not, write to the Free Software
40 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
41 | //
42 | ////////////////////////////////////////////////////////////////////////////////
43 |
44 | #ifndef AAFilter_H
45 | #define AAFilter_H
46 |
47 | #include "STTypes.h"
48 |
49 | namespace soundtouch
50 | {
51 |
52 | class AAFilter
53 | {
54 | protected:
55 | class FIRFilter *pFIR;
56 |
57 | /// Low-pass filter cut-off frequency, negative = invalid
58 | double cutoffFreq;
59 |
60 | /// num of filter taps
61 | uint length;
62 |
63 | /// Calculate the FIR coefficients realizing the given cutoff-frequency
64 | void calculateCoeffs();
65 | public:
66 | AAFilter(uint length);
67 |
68 | ~AAFilter();
69 |
70 | /// Sets new anti-alias filter cut-off edge frequency, scaled to sampling
71 | /// frequency (nyquist frequency = 0.5). The filter will cut off the
72 | /// frequencies than that.
73 | void setCutoffFreq(double newCutoffFreq);
74 |
75 | /// Sets number of FIR filter taps, i.e. ~filter complexity
76 | void setLength(uint newLength);
77 |
78 | uint getLength() const;
79 |
80 | /// Applies the filter to the given sequence of samples.
81 | /// Note : The amount of outputted samples is by value of 'filter length'
82 | /// smaller than the amount of input samples.
83 | uint evaluate(SAMPLETYPE *dest,
84 | const SAMPLETYPE *src,
85 | uint numSamples,
86 | uint numChannels) const;
87 | };
88 |
89 | }
90 |
91 | #endif
92 |
--------------------------------------------------------------------------------
/VoiceChanger/jni/SoundTouchDLL/SoundTouchDLL.rc:
--------------------------------------------------------------------------------
1 | // Microsoft Visual C++ generated resource script.
2 | //
3 | #include "resource.h"
4 |
5 | #define APSTUDIO_READONLY_SYMBOLS
6 | /////////////////////////////////////////////////////////////////////////////
7 | //
8 | // Generated from the TEXTINCLUDE 2 resource.
9 | //
10 | #include "afxres.h"
11 |
12 | /////////////////////////////////////////////////////////////////////////////
13 | #undef APSTUDIO_READONLY_SYMBOLS
14 |
15 | /////////////////////////////////////////////////////////////////////////////
16 | // English (U.S.) resources
17 |
18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
19 | #ifdef _WIN32
20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
21 | #pragma code_page(1252)
22 | #endif //_WIN32
23 |
24 | #ifdef APSTUDIO_INVOKED
25 | /////////////////////////////////////////////////////////////////////////////
26 | //
27 | // TEXTINCLUDE
28 | //
29 |
30 | 1 TEXTINCLUDE
31 | BEGIN
32 | "resource.h\0"
33 | END
34 |
35 | 2 TEXTINCLUDE
36 | BEGIN
37 | "#include ""afxres.h""\r\n"
38 | "\0"
39 | END
40 |
41 | 3 TEXTINCLUDE
42 | BEGIN
43 | "\r\n"
44 | "\0"
45 | END
46 |
47 | #endif // APSTUDIO_INVOKED
48 |
49 | #endif // English (U.S.) resources
50 | /////////////////////////////////////////////////////////////////////////////
51 |
52 |
53 | /////////////////////////////////////////////////////////////////////////////
54 | // Finnish resources
55 |
56 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FIN)
57 | #ifdef _WIN32
58 | LANGUAGE LANG_FINNISH, SUBLANG_DEFAULT
59 | #pragma code_page(1252)
60 | #endif //_WIN32
61 |
62 | /////////////////////////////////////////////////////////////////////////////
63 | //
64 | // Version
65 | //
66 |
67 | VS_VERSION_INFO VERSIONINFO
68 | FILEVERSION 1,9,2,0
69 | PRODUCTVERSION 1,9,2,0
70 | FILEFLAGSMASK 0x17L
71 | #ifdef _DEBUG
72 | FILEFLAGS 0x1L
73 | #else
74 | FILEFLAGS 0x0L
75 | #endif
76 | FILEOS 0x4L
77 | FILETYPE 0x2L
78 | FILESUBTYPE 0x0L
79 | BEGIN
80 | BLOCK "StringFileInfo"
81 | BEGIN
82 | BLOCK "000004b0"
83 | BEGIN
84 | VALUE "Comments", "SoundTouch Library licensed for 3rd party applications subject to LGPL license v2.1. Visit http://www.surina.net/soundtouch for more information about the SoundTouch library."
85 | VALUE "FileDescription", "SoundTouch Dynamic Link Library"
86 | VALUE "FileVersion", "1, 9, 2, 0"
87 | VALUE "InternalName", "SoundTouch"
88 | VALUE "LegalCopyright", "Copyright (C) Olli Parviainen 1999-2015"
89 | VALUE "OriginalFilename", "SoundTouch.dll"
90 | VALUE "ProductName", " SoundTouch Dynamic Link Library"
91 | VALUE "ProductVersion", "1, 9, 2, 0"
92 | END
93 | END
94 | BLOCK "VarFileInfo"
95 | BEGIN
96 | VALUE "Translation", 0x0, 1200
97 | END
98 | END
99 |
100 | #endif // Finnish resources
101 | /////////////////////////////////////////////////////////////////////////////
102 |
103 |
104 |
105 | #ifndef APSTUDIO_INVOKED
106 | /////////////////////////////////////////////////////////////////////////////
107 | //
108 | // Generated from the TEXTINCLUDE 3 resource.
109 | //
110 |
111 |
112 | /////////////////////////////////////////////////////////////////////////////
113 | #endif // not APSTUDIO_INVOKED
114 |
115 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/jni/soundtouch/source/SoundTouchDLL/SoundTouchDLL.rc:
--------------------------------------------------------------------------------
1 | // Microsoft Visual C++ generated resource script.
2 | //
3 | #include "resource.h"
4 |
5 | #define APSTUDIO_READONLY_SYMBOLS
6 | /////////////////////////////////////////////////////////////////////////////
7 | //
8 | // Generated from the TEXTINCLUDE 2 resource.
9 | //
10 | #include "afxres.h"
11 |
12 | /////////////////////////////////////////////////////////////////////////////
13 | #undef APSTUDIO_READONLY_SYMBOLS
14 |
15 | /////////////////////////////////////////////////////////////////////////////
16 | // English (U.S.) resources
17 |
18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
19 | #ifdef _WIN32
20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
21 | #pragma code_page(1252)
22 | #endif //_WIN32
23 |
24 | #ifdef APSTUDIO_INVOKED
25 | /////////////////////////////////////////////////////////////////////////////
26 | //
27 | // TEXTINCLUDE
28 | //
29 |
30 | 1 TEXTINCLUDE
31 | BEGIN
32 | "resource.h\0"
33 | END
34 |
35 | 2 TEXTINCLUDE
36 | BEGIN
37 | "#include ""afxres.h""\r\n"
38 | "\0"
39 | END
40 |
41 | 3 TEXTINCLUDE
42 | BEGIN
43 | "\r\n"
44 | "\0"
45 | END
46 |
47 | #endif // APSTUDIO_INVOKED
48 |
49 | #endif // English (U.S.) resources
50 | /////////////////////////////////////////////////////////////////////////////
51 |
52 |
53 | /////////////////////////////////////////////////////////////////////////////
54 | // Finnish resources
55 |
56 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FIN)
57 | #ifdef _WIN32
58 | LANGUAGE LANG_FINNISH, SUBLANG_DEFAULT
59 | #pragma code_page(1252)
60 | #endif //_WIN32
61 |
62 | /////////////////////////////////////////////////////////////////////////////
63 | //
64 | // Version
65 | //
66 |
67 | VS_VERSION_INFO VERSIONINFO
68 | FILEVERSION 1,7,0,0
69 | PRODUCTVERSION 1,7,0,0
70 | FILEFLAGSMASK 0x17L
71 | #ifdef _DEBUG
72 | FILEFLAGS 0x1L
73 | #else
74 | FILEFLAGS 0x0L
75 | #endif
76 | FILEOS 0x4L
77 | FILETYPE 0x2L
78 | FILESUBTYPE 0x0L
79 | BEGIN
80 | BLOCK "StringFileInfo"
81 | BEGIN
82 | BLOCK "000004b0"
83 | BEGIN
84 | VALUE "Comments", "SoundTouch Library licensed for 3rd party applications subject to LGPL license v2.1. Visit http://www.surina.net/soundtouch for more information about the SoundTouch library."
85 | VALUE "FileDescription", "SoundTouch Dynamic Link Library"
86 | VALUE "FileVersion", "1, 7, 0, 0"
87 | VALUE "InternalName", "SoundTouch"
88 | VALUE "LegalCopyright", "Copyright (C) Olli Parviainen 1999-2012"
89 | VALUE "OriginalFilename", "SoundTouch.dll"
90 | VALUE "ProductName", " SoundTouch Dynamic Link Library"
91 | VALUE "ProductVersion", "1, 7, 0, 0"
92 | END
93 | END
94 | BLOCK "VarFileInfo"
95 | BEGIN
96 | VALUE "Translation", 0x0, 1200
97 | END
98 | END
99 |
100 | #endif // Finnish resources
101 | /////////////////////////////////////////////////////////////////////////////
102 |
103 |
104 |
105 | #ifndef APSTUDIO_INVOKED
106 | /////////////////////////////////////////////////////////////////////////////
107 | //
108 | // Generated from the TEXTINCLUDE 3 resource.
109 | //
110 |
111 |
112 | /////////////////////////////////////////////////////////////////////////////
113 | #endif // not APSTUDIO_INVOKED
114 |
115 |
--------------------------------------------------------------------------------
/VoiceChanger/.gitignore:
--------------------------------------------------------------------------------
1 | #################
2 | ## Eclipse
3 | #################
4 |
5 | *.pydevproject
6 | .project
7 | .idea/
8 | .gradle/
9 | .metadata
10 | bin/
11 | tmp/
12 | *.tmp
13 | *.bak
14 | *.swp
15 | *~.nib
16 | local.properties
17 | .classpath
18 | .settings/
19 | .loadpath
20 |
21 | # External tool builders
22 | .externalToolBuilders/
23 |
24 | # Locally stored "Eclipse launch configurations"
25 | *.launch
26 |
27 | # CDT-specific
28 | .cproject
29 |
30 | # PDT-specific
31 | .buildpath
32 |
33 |
34 | #################
35 | ## Visual Studio
36 | #################
37 |
38 | ## Ignore Visual Studio temporary files, build results, and
39 | ## files generated by popular Visual Studio add-ons.
40 |
41 | # User-specific files
42 | *.suo
43 | *.user
44 | *.sln.docstates
45 |
46 | # Build results
47 |
48 | [Dd]ebug/
49 | [Rr]elease/
50 | x64/
51 | build/
52 | [Bb]in/
53 | [Oo]bj/
54 |
55 | # MSTest test Results
56 | [Tt]est[Rr]esult*/
57 | [Bb]uild[Ll]og.*
58 |
59 | *_i.c
60 | *_p.c
61 | *.ilk
62 | *.meta
63 | *.obj
64 | *.pch
65 | *.pdb
66 | *.pgc
67 | *.pgd
68 | *.rsp
69 | *.sbr
70 | *.tlb
71 | *.tli
72 | *.tlh
73 | *.tmp
74 | *.tmp_proj
75 | *.log
76 | *.vspscc
77 | *.vssscc
78 | .builds
79 | *.pidb
80 | *.log
81 | *.scc
82 |
83 | # Visual C++ cache files
84 | ipch/
85 | *.aps
86 | *.ncb
87 | *.opensdf
88 | *.sdf
89 | *.cachefile
90 |
91 | # Visual Studio profiler
92 | *.psess
93 | *.vsp
94 | *.vspx
95 |
96 | # Guidance Automation Toolkit
97 | *.gpState
98 |
99 | # ReSharper is a .NET coding add-in
100 | _ReSharper*/
101 | *.[Rr]e[Ss]harper
102 |
103 | # TeamCity is a build add-in
104 | _TeamCity*
105 |
106 | # DotCover is a Code Coverage Tool
107 | *.dotCover
108 |
109 | # NCrunch
110 | *.ncrunch*
111 | .*crunch*.local.xml
112 |
113 | # Installshield output folder
114 | [Ee]xpress/
115 |
116 | # DocProject is a documentation generator add-in
117 | DocProject/buildhelp/
118 | DocProject/Help/*.HxT
119 | DocProject/Help/*.HxC
120 | DocProject/Help/*.hhc
121 | DocProject/Help/*.hhk
122 | DocProject/Help/*.hhp
123 | DocProject/Help/Html2
124 | DocProject/Help/html
125 |
126 | # Click-Once directory
127 | publish/
128 |
129 | # Publish Web Output
130 | *.Publish.xml
131 | *.pubxml
132 |
133 | # NuGet Packages Directory
134 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line
135 | #packages/
136 |
137 | # Windows Azure Build Output
138 | csx
139 | *.build.csdef
140 |
141 | # Windows Store app package directory
142 | AppPackages/
143 |
144 | # Others
145 | sql/
146 | *.Cache
147 | ClientBin/
148 | [Ss]tyle[Cc]op.*
149 | ~$*
150 | *~
151 | *.dbmdl
152 | *.[Pp]ublish.xml
153 | *.pfx
154 | *.publishsettings
155 |
156 | # RIA/Silverlight projects
157 | Generated_Code/
158 |
159 | # Backup & report files from converting an old project file to a newer
160 | # Visual Studio version. Backup files are not needed, because we have git ;-)
161 | _UpgradeReport_Files/
162 | Backup*/
163 | UpgradeLog*.XML
164 | UpgradeLog*.htm
165 |
166 | # SQL Server files
167 | App_Data/*.mdf
168 | App_Data/*.ldf
169 |
170 | #############
171 | ## Windows detritus
172 | #############
173 |
174 | # Windows image file caches
175 | Thumbs.db
176 | ehthumbs.db
177 |
178 | # Folder config file
179 | Desktop.ini
180 |
181 | # Recycle Bin used on file shares
182 | $RECYCLE.BIN/
183 |
184 | # Mac crap
185 | .DS_Store
186 |
187 |
188 | #############
189 | ## Python
190 | #############
191 |
192 | *.py[co]
193 |
194 | # Packages
195 | *.egg
196 | *.egg-info
197 | dist/
198 | build/
199 | eggs/
200 | parts/
201 | var/
202 | sdist/
203 | develop-eggs/
204 | .installed.cfg
205 |
206 | # Installer logs
207 | pip-log.txt
208 |
209 | # Unit test / coverage reports
210 | .coverage
211 | .tox
212 |
213 | #Translations
214 | *.mo
215 |
216 | #Mr Developer
217 | .mr.developer.cfg
218 |
--------------------------------------------------------------------------------
/VoiceChanger/jni/soundtouch/AAFilter.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | ///
3 | /// Sampled sound tempo changer/time stretch algorithm. Changes the sound tempo
4 | /// while maintaining the original pitch by using a time domain WSOLA-like method
5 | /// with several performance-increasing tweaks.
6 | ///
7 | /// Anti-alias filter is used to prevent folding of high frequencies when
8 | /// transposing the sample rate with interpolation.
9 | ///
10 | /// Author : Copyright (c) Olli Parviainen
11 | /// Author e-mail : oparviai 'at' iki.fi
12 | /// SoundTouch WWW: http://www.surina.net/soundtouch
13 | ///
14 | ////////////////////////////////////////////////////////////////////////////////
15 | //
16 | // Last changed : $Date: 2014-01-07 21:41:23 +0200 (Tue, 07 Jan 2014) $
17 | // File revision : $Revision: 4 $
18 | //
19 | // $Id: AAFilter.h 187 2014-01-07 19:41:23Z oparviai $
20 | //
21 | ////////////////////////////////////////////////////////////////////////////////
22 | //
23 | // License :
24 | //
25 | // SoundTouch audio processing library
26 | // Copyright (c) Olli Parviainen
27 | //
28 | // This library is free software; you can redistribute it and/or
29 | // modify it under the terms of the GNU Lesser General Public
30 | // License as published by the Free Software Foundation; either
31 | // version 2.1 of the License, or (at your option) any later version.
32 | //
33 | // This library is distributed in the hope that it will be useful,
34 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
35 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
36 | // Lesser General Public License for more details.
37 | //
38 | // You should have received a copy of the GNU Lesser General Public
39 | // License along with this library; if not, write to the Free Software
40 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
41 | //
42 | ////////////////////////////////////////////////////////////////////////////////
43 |
44 | #ifndef AAFilter_H
45 | #define AAFilter_H
46 |
47 | #include "../soundtouch/include/STTypes.h"
48 | #include "../soundtouch/include/FIFOSampleBuffer.h"
49 |
50 | namespace soundtouch
51 | {
52 |
53 | class AAFilter
54 | {
55 | protected:
56 | class FIRFilter *pFIR;
57 |
58 | /// Low-pass filter cut-off frequency, negative = invalid
59 | double cutoffFreq;
60 |
61 | /// num of filter taps
62 | uint length;
63 |
64 | /// Calculate the FIR coefficients realizing the given cutoff-frequency
65 | void calculateCoeffs();
66 | public:
67 | AAFilter(uint length);
68 |
69 | ~AAFilter();
70 |
71 | /// Sets new anti-alias filter cut-off edge frequency, scaled to sampling
72 | /// frequency (nyquist frequency = 0.5). The filter will cut off the
73 | /// frequencies than that.
74 | void setCutoffFreq(double newCutoffFreq);
75 |
76 | /// Sets number of FIR filter taps, i.e. ~filter complexity
77 | void setLength(uint newLength);
78 |
79 | uint getLength() const;
80 |
81 | /// Applies the filter to the given sequence of samples.
82 | /// Note : The amount of outputted samples is by value of 'filter length'
83 | /// smaller than the amount of input samples.
84 | uint evaluate(SAMPLETYPE *dest,
85 | const SAMPLETYPE *src,
86 | uint numSamples,
87 | uint numChannels) const;
88 |
89 | /// Applies the filter to the given src & dest pipes, so that processed amount of
90 | /// samples get removed from src, and produced amount added to dest
91 | /// Note : The amount of outputted samples is by value of 'filter length'
92 | /// smaller than the amount of input samples.
93 | uint evaluate(FIFOSampleBuffer &dest,
94 | FIFOSampleBuffer &src) const;
95 |
96 | };
97 |
98 | }
99 |
100 | #endif
101 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/java/com/vehar/Communicator.java:
--------------------------------------------------------------------------------
1 | package com.vehar;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.view.View;
7 | import android.view.View.OnClickListener;
8 | import android.widget.Button;
9 | import android.widget.SeekBar;
10 | import android.widget.TextView;
11 | import android.widget.Toast;
12 |
13 | import com.google.zxing.integration.android.IntentIntegrator;
14 | import com.google.zxing.integration.android.IntentResult;
15 | import com.vehar.soundtouchandroid.R;
16 |
17 | import java.io.IOException;
18 |
19 | public class Communicator extends AppCompatActivity implements OnClickListener {
20 |
21 | Button buttonQR = null;
22 | Button buttonReadQR = null;
23 | Button buttonStartSending = null;
24 |
25 | TextView textMode = null;
26 | TextView sendStat = null;
27 |
28 | SeekBar pitchBar = null;
29 | //
30 | private boolean isSending = false;
31 | private String IP = null;
32 | private int PORT = 6767;
33 |
34 | //
35 | AudioStreamingTwoWay streamer = null;
36 |
37 | @Override
38 | protected void onCreate(Bundle savedInstanceState) {
39 | super.onCreate(savedInstanceState);
40 | setContentView(R.layout.activity_send);
41 |
42 | buttonQR = (Button) findViewById(R.id.buttonQR);
43 | buttonReadQR = (Button) findViewById(R.id.buttonReadQR);
44 | buttonStartSending = (Button) findViewById(R.id.buttonStartSending);
45 | textMode = (TextView) findViewById(R.id.textMode);
46 | sendStat = (TextView) findViewById(R.id.sendStat);
47 | pitchBar = (SeekBar) findViewById(R.id.pitchBar);
48 |
49 | streamer = new AudioStreamingTwoWay(sendStat);
50 |
51 | }
52 |
53 | @Override
54 | protected void onDestroy(){
55 |
56 | System.out.println("Stopping..");
57 |
58 | if(streamer != null){
59 | streamer.stop();
60 | }
61 |
62 | super.onDestroy();
63 |
64 | }
65 |
66 | @Override
67 | public void onClick(View arg0) {
68 | int i = arg0.getId();
69 | if (i == R.id.buttonQR) {
70 | Intent intentGenQr = new Intent(this, QRCodeServer.class);
71 | startActivity(intentGenQr);
72 |
73 | } else if (i == R.id.buttonReadQR) {
74 | IntentIntegrator integrator = new IntentIntegrator(this);
75 | integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES);
76 | integrator.setPrompt("Scan a barcode");
77 | integrator.setBeepEnabled(false);
78 | integrator.initiateScan();
79 | integrator.setOrientationLocked(true);
80 |
81 | } else if (i == R.id.buttonStartSending) {
82 | if (isSending) {
83 | //TODO: Stop sending
84 | Toast.makeText(this, "Stopping...", Toast.LENGTH_SHORT).show();
85 |
86 | streamer.stop();
87 | isSending = !isSending;
88 | } else {
89 | Toast.makeText(this, "Starting...", Toast.LENGTH_SHORT).show();
90 |
91 | try {
92 | streamer.startStreamingTransfer(IP, PORT, pitchBar.getProgress()-10, this);
93 | } catch (IOException e) {
94 | e.printStackTrace();
95 | }
96 | isSending = !isSending;
97 | }
98 |
99 |
100 | }
101 |
102 | }
103 |
104 | @Override
105 | protected void onActivityResult(int requestCode, int resultCode, Intent data) {
106 | IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
107 | if (result != null) {
108 | if (result.getContents() == null) {
109 | Toast.makeText(this, "Cancelled", Toast.LENGTH_LONG).show();
110 | } else {
111 | IP = result.getContents();
112 | textMode.setText("Sending to IP: " + result.getContents());
113 | buttonStartSending.setVisibility(View.VISIBLE);
114 | pitchBar.setVisibility(View.VISIBLE);
115 |
116 | }
117 | } else {
118 | super.onActivityResult(requestCode, resultCode, data);
119 | }
120 |
121 |
122 | }
123 |
124 | }
125 |
--------------------------------------------------------------------------------
/VoiceChanger/jni/soundtouch/PeakFinder.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | ///
3 | /// The routine detects highest value on an array of values and calculates the
4 | /// precise peak location as a mass-center of the 'hump' around the peak value.
5 | ///
6 | /// Author : Copyright (c) Olli Parviainen
7 | /// Author e-mail : oparviai 'at' iki.fi
8 | /// SoundTouch WWW: http://www.surina.net/soundtouch
9 | ///
10 | ////////////////////////////////////////////////////////////////////////////////
11 | //
12 | // Last changed : $Date: 2011-12-30 22:33:46 +0200 (Fri, 30 Dec 2011) $
13 | // File revision : $Revision: 4 $
14 | //
15 | // $Id: PeakFinder.h 132 2011-12-30 20:33:46Z oparviai $
16 | //
17 | ////////////////////////////////////////////////////////////////////////////////
18 | //
19 | // License :
20 | //
21 | // SoundTouch audio processing library
22 | // Copyright (c) Olli Parviainen
23 | //
24 | // This library is free software; you can redistribute it and/or
25 | // modify it under the terms of the GNU Lesser General Public
26 | // License as published by the Free Software Foundation; either
27 | // version 2.1 of the License, or (at your option) any later version.
28 | //
29 | // This library is distributed in the hope that it will be useful,
30 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
31 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
32 | // Lesser General Public License for more details.
33 | //
34 | // You should have received a copy of the GNU Lesser General Public
35 | // License along with this library; if not, write to the Free Software
36 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
37 | //
38 | ////////////////////////////////////////////////////////////////////////////////
39 |
40 | #ifndef _PeakFinder_H_
41 | #define _PeakFinder_H_
42 |
43 | namespace soundtouch
44 | {
45 |
46 | class PeakFinder
47 | {
48 | protected:
49 | /// Min, max allowed peak positions within the data vector
50 | int minPos, maxPos;
51 |
52 | /// Calculates the mass center between given vector items.
53 | double calcMassCenter(const float *data, ///< Data vector.
54 | int firstPos, ///< Index of first vector item beloging to the peak.
55 | int lastPos ///< Index of last vector item beloging to the peak.
56 | ) const;
57 |
58 | /// Finds the data vector index where the monotoniously decreasing signal crosses the
59 | /// given level.
60 | int findCrossingLevel(const float *data, ///< Data vector.
61 | float level, ///< Goal crossing level.
62 | int peakpos, ///< Peak position index within the data vector.
63 | int direction /// Direction where to proceed from the peak: 1 = right, -1 = left.
64 | ) const;
65 |
66 | // Finds real 'top' of a peak hump from neighnourhood of the given 'peakpos'.
67 | int findTop(const float *data, int peakpos) const;
68 |
69 |
70 | /// Finds the 'ground' level, i.e. smallest level between two neighbouring peaks, to right-
71 | /// or left-hand side of the given peak position.
72 | int findGround(const float *data, /// Data vector.
73 | int peakpos, /// Peak position index within the data vector.
74 | int direction /// Direction where to proceed from the peak: 1 = right, -1 = left.
75 | ) const;
76 |
77 | /// get exact center of peak near given position by calculating local mass of center
78 | double getPeakCenter(const float *data, int peakpos) const;
79 |
80 | public:
81 | /// Constructor.
82 | PeakFinder();
83 |
84 | /// Detect exact peak position of the data vector by finding the largest peak 'hump'
85 | /// and calculating the mass-center location of the peak hump.
86 | ///
87 | /// \return The location of the largest base harmonic peak hump.
88 | double detectPeak(const float *data, /// Data vector to be analyzed. The data vector has
89 | /// to be at least 'maxPos' items long.
90 | int minPos, ///< Min allowed peak location within the vector data.
91 | int maxPos ///< Max allowed peak location within the vector data.
92 | );
93 | };
94 |
95 | }
96 |
97 | #endif // _PeakFinder_H_
98 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/jni/soundtouch/source/SoundTouch/PeakFinder.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | ///
3 | /// The routine detects highest value on an array of values and calculates the
4 | /// precise peak location as a mass-center of the 'hump' around the peak value.
5 | ///
6 | /// Author : Copyright (c) Olli Parviainen
7 | /// Author e-mail : oparviai 'at' iki.fi
8 | /// SoundTouch WWW: http://www.surina.net/soundtouch
9 | ///
10 | ////////////////////////////////////////////////////////////////////////////////
11 | //
12 | // Last changed : $Date: 2011-12-30 22:33:46 +0200 (Fri, 30 Dec 2011) $
13 | // File revision : $Revision: 4 $
14 | //
15 | // $Id: PeakFinder.h 132 2011-12-30 20:33:46Z oparviai $
16 | //
17 | ////////////////////////////////////////////////////////////////////////////////
18 | //
19 | // License :
20 | //
21 | // SoundTouch audio processing library
22 | // Copyright (c) Olli Parviainen
23 | //
24 | // This library is free software; you can redistribute it and/or
25 | // modify it under the terms of the GNU Lesser General Public
26 | // License as published by the Free Software Foundation; either
27 | // version 2.1 of the License, or (at your option) any later version.
28 | //
29 | // This library is distributed in the hope that it will be useful,
30 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
31 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
32 | // Lesser General Public License for more details.
33 | //
34 | // You should have received a copy of the GNU Lesser General Public
35 | // License along with this library; if not, write to the Free Software
36 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
37 | //
38 | ////////////////////////////////////////////////////////////////////////////////
39 |
40 | #ifndef _PeakFinder_H_
41 | #define _PeakFinder_H_
42 |
43 | namespace soundtouch
44 | {
45 |
46 | class PeakFinder
47 | {
48 | protected:
49 | /// Min, max allowed peak positions within the data vector
50 | int minPos, maxPos;
51 |
52 | /// Calculates the mass center between given vector items.
53 | double calcMassCenter(const float *data, ///< Data vector.
54 | int firstPos, ///< Index of first vector item beloging to the peak.
55 | int lastPos ///< Index of last vector item beloging to the peak.
56 | ) const;
57 |
58 | /// Finds the data vector index where the monotoniously decreasing signal crosses the
59 | /// given level.
60 | int findCrossingLevel(const float *data, ///< Data vector.
61 | float level, ///< Goal crossing level.
62 | int peakpos, ///< Peak position index within the data vector.
63 | int direction /// Direction where to proceed from the peak: 1 = right, -1 = left.
64 | ) const;
65 |
66 | // Finds real 'top' of a peak hump from neighnourhood of the given 'peakpos'.
67 | int findTop(const float *data, int peakpos) const;
68 |
69 |
70 | /// Finds the 'ground' level, i.e. smallest level between two neighbouring peaks, to right-
71 | /// or left-hand side of the given peak position.
72 | int findGround(const float *data, /// Data vector.
73 | int peakpos, /// Peak position index within the data vector.
74 | int direction /// Direction where to proceed from the peak: 1 = right, -1 = left.
75 | ) const;
76 |
77 | /// get exact center of peak near given position by calculating local mass of center
78 | double getPeakCenter(const float *data, int peakpos) const;
79 |
80 | public:
81 | /// Constructor.
82 | PeakFinder();
83 |
84 | /// Detect exact peak position of the data vector by finding the largest peak 'hump'
85 | /// and calculating the mass-center location of the peak hump.
86 | ///
87 | /// \return The location of the largest base harmonic peak hump.
88 | double detectPeak(const float *data, /// Data vector to be analyzed. The data vector has
89 | /// to be at least 'maxPos' items long.
90 | int minPos, ///< Min allowed peak location within the vector data.
91 | int maxPos ///< Max allowed peak location within the vector data.
92 | );
93 | };
94 |
95 | }
96 |
97 | #endif // _PeakFinder_H_
98 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/java/com/vehar/QRCodeServer.java:
--------------------------------------------------------------------------------
1 | package com.vehar;
2 |
3 | import android.graphics.Bitmap;
4 | import android.graphics.Color;
5 | import android.media.AudioTrack;
6 | import android.net.wifi.WifiInfo;
7 | import android.net.wifi.WifiManager;
8 | import android.os.Bundle;
9 | import android.support.v7.app.AppCompatActivity;
10 | import android.text.format.Formatter;
11 | import android.widget.ImageView;
12 | import android.widget.TextView;
13 |
14 | import com.google.zxing.BarcodeFormat;
15 | import com.google.zxing.EncodeHintType;
16 | import com.google.zxing.WriterException;
17 | import com.google.zxing.common.BitMatrix;
18 | import com.google.zxing.qrcode.QRCodeWriter;
19 | import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
20 | import com.vehar.soundtouchandroid.R;
21 |
22 | import java.io.IOException;
23 | import java.net.InetAddress;
24 | import java.net.NetworkInterface;
25 | import java.net.SocketException;
26 | import java.util.Enumeration;
27 | import java.util.Hashtable;
28 |
29 | public class QRCodeServer extends AppCompatActivity {
30 |
31 | ImageView qrImage = null;
32 | TextView stat =null;
33 |
34 |
35 | private AudioTrack track = null;
36 | private boolean isRecording = false;
37 | int BufferElements2Rec = 4096; // want to play 2048 (2K) since 2 bytes we use only 1024
38 | int BytesPerElement = 2; // 2 bytes in 16bit format
39 | int bufferSize = 0;
40 |
41 | AudioStreamingTwoWay listener = null;
42 |
43 | @Override
44 | protected void onCreate(Bundle savedInstanceState) {
45 | super.onCreate(savedInstanceState);
46 | setContentView(R.layout.activity_qrcode);
47 |
48 | qrImage = (ImageView) findViewById(R.id.qrkoda);
49 | stat = (TextView) findViewById(R.id.stat);
50 |
51 | String myIP = getLocalIpAddress();
52 |
53 | if(myIP == ""){
54 | super.onDestroy();
55 | }
56 |
57 | stat.setText("PORT: 6767, IP: "+myIP);
58 |
59 |
60 | try {
61 | Bitmap qrCode = generateQrCode(myIP);
62 | qrImage.setImageBitmap(qrCode);
63 |
64 | } catch (WriterException e) {
65 | e.printStackTrace();
66 | }
67 | listener = new AudioStreamingTwoWay(stat);
68 | try {
69 | listener.startListeningTransfer(this,1);
70 | } catch (IOException e) {
71 | e.printStackTrace();
72 | }
73 |
74 | }
75 |
76 | @Override
77 | protected void onDestroy(){
78 | System.out.println("Stopping..");
79 |
80 | if(listener!= null){
81 | listener.stop();
82 | }
83 |
84 | super.onDestroy();
85 | }
86 |
87 | public Bitmap generateQrCode(String myCodeText) throws WriterException {
88 | Hashtable hintMap = new Hashtable();
89 | hintMap.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H); // H = 30% damage
90 |
91 | QRCodeWriter qrCodeWriter = new QRCodeWriter();
92 |
93 | int size = 256;
94 |
95 | BitMatrix bitMatrix = qrCodeWriter.encode(myCodeText, BarcodeFormat.QR_CODE, size, size, hintMap);
96 | int width = bitMatrix.getWidth();
97 |
98 | Bitmap bmp = Bitmap.createBitmap(width, width, Bitmap.Config.RGB_565);
99 | for (int x = 0; x < width; x++) {
100 | for (int y = 0; y < width; y++) {
101 | bmp.setPixel(y, x, bitMatrix.get(x, y) ? Color.BLACK : Color.WHITE);
102 | }
103 | }
104 | return bmp;
105 | }
106 |
107 |
108 | public String getLocalIpAddress() {
109 | String ip = "";
110 |
111 | WifiManager wifiMgr = (WifiManager) getSystemService(WIFI_SERVICE);
112 | WifiInfo wifiInfo = wifiMgr.getConnectionInfo();
113 | int ipaddr = wifiInfo.getIpAddress();
114 |
115 | if(ipaddr>0){
116 | ip = Formatter.formatIpAddress(ipaddr);
117 |
118 | System.out.println("Found Wifi IP: "+ip);
119 | return ip;
120 | }
121 |
122 |
123 | try {
124 | for (Enumeration en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) {
125 | NetworkInterface intf = en.nextElement();
126 | for (Enumeration enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();) {
127 | InetAddress inetAddress = enumIpAddr.nextElement();
128 | if (!inetAddress.isLoopbackAddress()) {
129 | ip = Formatter.formatIpAddress(inetAddress.hashCode());
130 | System.out.println("Found IP: "+ip);
131 |
132 | }
133 | }
134 | }
135 | } catch (SocketException ex) {
136 | ex.printStackTrace();
137 | }
138 | return ip;
139 | }
140 | }
141 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/java/com/vehar/AudioRecording.java:
--------------------------------------------------------------------------------
1 | package com.vehar;
2 |
3 | import android.media.AudioFormat;
4 | import android.media.AudioManager;
5 | import android.media.AudioRecord;
6 | import android.media.AudioTrack;
7 | import android.media.MediaRecorder;
8 |
9 | import java.util.ArrayList;
10 | import java.util.List;
11 |
12 | /**
13 | * Created by matejv on 22.11.2016.
14 | */
15 |
16 | public class AudioRecording {
17 | static final int RECORDER_BPP = 16;
18 | static final int RECORDER_SAMPLERATE = 44100;
19 | static final int RECORDER_CHANNELS = AudioFormat.CHANNEL_IN_STEREO;
20 | static final int RECORDER_AUDIO_ENCODING = AudioFormat.ENCODING_PCM_16BIT;
21 |
22 | private AudioRecord recorder = null;
23 | private AudioTrack track = null;
24 |
25 | private SoundTouch st = null;
26 | private Thread recordingThread = null;
27 | private boolean isRecording = false;
28 |
29 | private List SOUNDS = new ArrayList<>();
30 | private List PROC_SOUNDS = new ArrayList<>();
31 |
32 |
33 | int BufferElements2Rec = 4096; // want to play 2048 (2K) since 2 bytes we use only 1024
34 | int BytesPerElement = 2; // 2 bytes in 16bit format
35 | int bufferSize = 0;
36 |
37 |
38 | public AudioRecording() {
39 | bufferSize = AudioRecord.getMinBufferSize(RECORDER_SAMPLERATE,
40 | RECORDER_CHANNELS, RECORDER_AUDIO_ENCODING);
41 |
42 | track = new AudioTrack(AudioManager.STREAM_MUSIC, RECORDER_SAMPLERATE, RECORDER_CHANNELS,
43 | RECORDER_AUDIO_ENCODING, BufferElements2Rec * BytesPerElement, AudioTrack.MODE_STREAM);
44 |
45 | st = new SoundTouch(0, 2, RECORDER_SAMPLERATE, 2, 1.0f, 5);
46 |
47 | }
48 |
49 | public void startRecording(int pitch) {
50 |
51 | recorder = new AudioRecord(MediaRecorder.AudioSource.MIC,
52 | RECORDER_SAMPLERATE, RECORDER_CHANNELS,
53 | RECORDER_AUDIO_ENCODING, BufferElements2Rec * BytesPerElement);
54 |
55 | st = new SoundTouch(0, 2, RECORDER_SAMPLERATE, BytesPerElement, 1.0f, pitch);
56 |
57 |
58 | SOUNDS.clear();
59 | PROC_SOUNDS.clear();
60 |
61 | recorder.startRecording();
62 |
63 | isRecording = true;
64 |
65 | recordingThread = new Thread(new Runnable() {
66 |
67 | public void run() {
68 |
69 | getAudioData();
70 |
71 | }
72 | }, "AudioRecorder Thread");
73 | recordingThread.start();
74 | }
75 |
76 |
77 | public void stopRecording() {
78 | // stops the recording activity
79 | if (null != recorder) {
80 | isRecording = false;
81 |
82 |
83 | recorder.stop();
84 | recorder.release();
85 |
86 | recorder = null;
87 | recordingThread = null;
88 | }
89 | }
90 |
91 | public void playOriginal() {
92 | track.stop();
93 | track.flush();
94 |
95 | byte[] sound = new byte[SOUNDS.size()];
96 | for (int i = 0; i < sound.length; i++) {
97 | sound[i] = SOUNDS.get(i);
98 | }
99 | track.play();
100 | track.write(sound, 0, sound.length);
101 |
102 |
103 | }
104 |
105 |
106 | public void playProcessed() {
107 | track.stop();
108 | track.flush();
109 |
110 |
111 | st.finish();
112 |
113 | byte[] processed = new byte[BufferElements2Rec];
114 | int st_proc = 0;
115 | do {
116 | st_proc = st.getBytes(processed);
117 | for (int i = 0; i < st_proc; i++) {
118 | PROC_SOUNDS.add(processed[i]);
119 | }
120 | } while (st_proc != 0);
121 |
122 |
123 | byte[] sound = new byte[PROC_SOUNDS.size()];
124 | for (int i = 0; i < PROC_SOUNDS.size(); i++) {
125 | sound[i] = PROC_SOUNDS.get(i);
126 | }
127 | track.play();
128 | track.write(sound, 0, sound.length);
129 |
130 | }
131 |
132 | public void stop() {
133 | track.stop();
134 | track.flush();
135 |
136 | }
137 |
138 | private void getAudioData() {
139 | // Write the output audio in byte
140 | byte sData[] = new byte[BufferElements2Rec];
141 |
142 | track.play();
143 |
144 | while (isRecording) {
145 | // gets the voice output from microphone to byte format
146 | recorder.read(sData, 0, BufferElements2Rec);
147 |
148 | // track.write(sData,0,BufferElements2Rec);
149 |
150 | //Copy to array
151 | for (int i = 0; i < BufferElements2Rec; i++) {
152 | SOUNDS.add(sData[i]);
153 | }
154 |
155 | st.putBytes(sData);
156 |
157 | int st_proc = st.getBytes(sData);
158 | //track.write(sData,0,st_proc);
159 |
160 | for (int i = 0; i < st_proc; i++) {
161 | PROC_SOUNDS.add(sData[i]);
162 | }
163 |
164 | }
165 |
166 | }
167 |
168 |
169 | }
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/jni/soundtouch/source/SoundTouch/FIRFilter.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | ///
3 | /// General FIR digital filter routines with MMX optimization.
4 | ///
5 | /// Note : MMX optimized functions reside in a separate, platform-specific file,
6 | /// e.g. 'mmx_win.cpp' or 'mmx_gcc.cpp'
7 | ///
8 | /// Author : Copyright (c) Olli Parviainen
9 | /// Author e-mail : oparviai 'at' iki.fi
10 | /// SoundTouch WWW: http://www.surina.net/soundtouch
11 | ///
12 | ////////////////////////////////////////////////////////////////////////////////
13 | //
14 | // Last changed : $Date: 2011-02-13 21:13:57 +0200 (Sun, 13 Feb 2011) $
15 | // File revision : $Revision: 4 $
16 | //
17 | // $Id: FIRFilter.h 104 2011-02-13 19:13:57Z oparviai $
18 | //
19 | ////////////////////////////////////////////////////////////////////////////////
20 | //
21 | // License :
22 | //
23 | // SoundTouch audio processing library
24 | // Copyright (c) Olli Parviainen
25 | //
26 | // This library is free software; you can redistribute it and/or
27 | // modify it under the terms of the GNU Lesser General Public
28 | // License as published by the Free Software Foundation; either
29 | // version 2.1 of the License, or (at your option) any later version.
30 | //
31 | // This library is distributed in the hope that it will be useful,
32 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
34 | // Lesser General Public License for more details.
35 | //
36 | // You should have received a copy of the GNU Lesser General Public
37 | // License along with this library; if not, write to the Free Software
38 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
39 | //
40 | ////////////////////////////////////////////////////////////////////////////////
41 |
42 | #ifndef FIRFilter_H
43 | #define FIRFilter_H
44 |
45 | #include
46 | #include "STTypes.h"
47 |
48 | namespace soundtouch
49 | {
50 |
51 | class FIRFilter
52 | {
53 | protected:
54 | // Number of FIR filter taps
55 | uint length;
56 | // Number of FIR filter taps divided by 8
57 | uint lengthDiv8;
58 |
59 | // Result divider factor in 2^k format
60 | uint resultDivFactor;
61 |
62 | // Result divider value.
63 | SAMPLETYPE resultDivider;
64 |
65 | // Memory for filter coefficients
66 | SAMPLETYPE *filterCoeffs;
67 |
68 | virtual uint evaluateFilterStereo(SAMPLETYPE *dest,
69 | const SAMPLETYPE *src,
70 | uint numSamples) const;
71 | virtual uint evaluateFilterMono(SAMPLETYPE *dest,
72 | const SAMPLETYPE *src,
73 | uint numSamples) const;
74 |
75 | public:
76 | FIRFilter();
77 | virtual ~FIRFilter();
78 |
79 | /// Operator 'new' is overloaded so that it automatically creates a suitable instance
80 | /// depending on if we've a MMX-capable CPU available or not.
81 | static void * operator new(size_t s);
82 |
83 | static FIRFilter *newInstance();
84 |
85 | /// Applies the filter to the given sequence of samples.
86 | /// Note : The amount of outputted samples is by value of 'filter_length'
87 | /// smaller than the amount of input samples.
88 | ///
89 | /// \return Number of samples copied to 'dest'.
90 | uint evaluate(SAMPLETYPE *dest,
91 | const SAMPLETYPE *src,
92 | uint numSamples,
93 | uint numChannels) const;
94 |
95 | uint getLength() const;
96 |
97 | virtual void setCoefficients(const SAMPLETYPE *coeffs,
98 | uint newLength,
99 | uint uResultDivFactor);
100 | };
101 |
102 |
103 | // Optional subclasses that implement CPU-specific optimizations:
104 |
105 | #ifdef SOUNDTOUCH_ALLOW_MMX
106 |
107 | /// Class that implements MMX optimized functions exclusive for 16bit integer samples type.
108 | class FIRFilterMMX : public FIRFilter
109 | {
110 | protected:
111 | short *filterCoeffsUnalign;
112 | short *filterCoeffsAlign;
113 |
114 | virtual uint evaluateFilterStereo(short *dest, const short *src, uint numSamples) const;
115 | public:
116 | FIRFilterMMX();
117 | ~FIRFilterMMX();
118 |
119 | virtual void setCoefficients(const short *coeffs, uint newLength, uint uResultDivFactor);
120 | };
121 |
122 | #endif // SOUNDTOUCH_ALLOW_MMX
123 |
124 |
125 | #ifdef SOUNDTOUCH_ALLOW_SSE
126 | /// Class that implements SSE optimized functions exclusive for floating point samples type.
127 | class FIRFilterSSE : public FIRFilter
128 | {
129 | protected:
130 | float *filterCoeffsUnalign;
131 | float *filterCoeffsAlign;
132 |
133 | virtual uint evaluateFilterStereo(float *dest, const float *src, uint numSamples) const;
134 | public:
135 | FIRFilterSSE();
136 | ~FIRFilterSSE();
137 |
138 | virtual void setCoefficients(const float *coeffs, uint newLength, uint uResultDivFactor);
139 | };
140 |
141 | #endif // SOUNDTOUCH_ALLOW_SSE
142 |
143 | }
144 |
145 | #endif // FIRFilter_H
146 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/jni/soundtouch/source/SoundStretch/soundstretch.dsp:
--------------------------------------------------------------------------------
1 | # Microsoft Developer Studio Project File - Name="soundstretch" - Package Owner=<4>
2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00
3 | # ** DO NOT EDIT **
4 |
5 | # TARGTYPE "Win32 (x86) Console Application" 0x0103
6 |
7 | CFG=soundstretch - Win32 Debug
8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE,
9 | !MESSAGE use the Export Makefile command and run
10 | !MESSAGE
11 | !MESSAGE NMAKE /f "soundstretch.mak".
12 | !MESSAGE
13 | !MESSAGE You can specify a configuration when running NMAKE
14 | !MESSAGE by defining the macro CFG on the command line. For example:
15 | !MESSAGE
16 | !MESSAGE NMAKE /f "soundstretch.mak" CFG="soundstretch - Win32 Debug"
17 | !MESSAGE
18 | !MESSAGE Possible choices for configuration are:
19 | !MESSAGE
20 | !MESSAGE "soundstretch - Win32 Release" (based on "Win32 (x86) Console Application")
21 | !MESSAGE "soundstretch - Win32 Debug" (based on "Win32 (x86) Console Application")
22 | !MESSAGE
23 |
24 | # Begin Project
25 | # PROP AllowPerConfigDependencies 0
26 | # PROP Scc_ProjName ""
27 | # PROP Scc_LocalPath ""
28 | CPP=cl.exe
29 | RSC=rc.exe
30 |
31 | !IF "$(CFG)" == "soundstretch - Win32 Release"
32 |
33 | # PROP BASE Use_MFC 0
34 | # PROP BASE Use_Debug_Libraries 0
35 | # PROP BASE Output_Dir "Release"
36 | # PROP BASE Intermediate_Dir "Release"
37 | # PROP BASE Target_Dir ""
38 | # PROP Use_MFC 0
39 | # PROP Use_Debug_Libraries 0
40 | # PROP Output_Dir "Release"
41 | # PROP Intermediate_Dir "Release"
42 | # PROP Ignore_Export_Lib 0
43 | # PROP Target_Dir ""
44 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
45 | # ADD CPP /nologo /W3 /GX /Zi /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
46 | # SUBTRACT CPP /YX
47 | # ADD BASE RSC /l 0x40b /d "NDEBUG"
48 | # ADD RSC /l 0x40b /d "NDEBUG"
49 | BSC32=bscmake.exe
50 | # ADD BASE BSC32 /nologo
51 | # ADD BSC32 /nologo
52 | LINK32=link.exe
53 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
54 | # ADD LINK32 SoundTouch.lib /nologo /subsystem:console /profile /map /debug /machine:I386 /libpath:"..\..\lib"
55 | # Begin Special Build Tool
56 | SOURCE="$(InputPath)"
57 | PostBuild_Cmds=copy Release\soundstretch.exe ..\..\bin\
58 | # End Special Build Tool
59 |
60 | !ELSEIF "$(CFG)" == "soundstretch - Win32 Debug"
61 |
62 | # PROP BASE Use_MFC 0
63 | # PROP BASE Use_Debug_Libraries 1
64 | # PROP BASE Output_Dir "Debug"
65 | # PROP BASE Intermediate_Dir "Debug"
66 | # PROP BASE Target_Dir ""
67 | # PROP Use_MFC 0
68 | # PROP Use_Debug_Libraries 1
69 | # PROP Output_Dir "Debug"
70 | # PROP Intermediate_Dir "Debug"
71 | # PROP Ignore_Export_Lib 0
72 | # PROP Target_Dir ""
73 | # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
74 | # ADD CPP /nologo /Zp16 /W3 /Gm /GX /ZI /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /FD /GZ /c
75 | # SUBTRACT CPP /YX
76 | # ADD BASE RSC /l 0x40b /d "_DEBUG"
77 | # ADD RSC /l 0x40b /d "_DEBUG"
78 | BSC32=bscmake.exe
79 | # ADD BASE BSC32 /nologo
80 | # ADD BSC32 /nologo
81 | LINK32=link.exe
82 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
83 | # ADD LINK32 SoundTouchD.lib /nologo /subsystem:console /map /debug /machine:I386 /nodefaultlib:"libc" /out:"Debug/soundstretchD.exe" /pdbtype:sept /libpath:"..\..\lib"
84 | # SUBTRACT LINK32 /pdb:none
85 | # Begin Special Build Tool
86 | SOURCE="$(InputPath)"
87 | PostBuild_Cmds=copy Debug\soundstretchD.exe ..\..\bin\
88 | # End Special Build Tool
89 |
90 | !ENDIF
91 |
92 | # Begin Target
93 |
94 | # Name "soundstretch - Win32 Release"
95 | # Name "soundstretch - Win32 Debug"
96 | # Begin Group "Source Files"
97 |
98 | # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
99 | # Begin Source File
100 |
101 | SOURCE=.\main.cpp
102 | # End Source File
103 | # Begin Source File
104 |
105 | SOURCE=.\RunParameters.cpp
106 | # End Source File
107 | # Begin Source File
108 |
109 | SOURCE=.\WavFile.cpp
110 | # End Source File
111 | # End Group
112 | # Begin Group "Header Files"
113 |
114 | # PROP Default_Filter "h;hpp;hxx;hm;inl"
115 | # Begin Source File
116 |
117 | SOURCE=.\RunParameters.h
118 | # End Source File
119 | # Begin Source File
120 |
121 | SOURCE=..\..\..\include\SoundTouch.h
122 | # End Source File
123 | # Begin Source File
124 |
125 | SOURCE=..\..\..\include\STTypes.h
126 | # End Source File
127 | # Begin Source File
128 |
129 | SOURCE=.\WavFile.h
130 | # End Source File
131 | # End Group
132 | # Begin Group "Resource Files"
133 |
134 | # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
135 | # End Group
136 | # End Target
137 | # End Project
138 |
--------------------------------------------------------------------------------
/VoiceChanger/jni/soundtouch/cpu_detect_x86.cpp:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | ///
3 | /// Generic version of the x86 CPU extension detection routine.
4 | ///
5 | /// This file is for GNU & other non-Windows compilers, see 'cpu_detect_x86_win.cpp'
6 | /// for the Microsoft compiler version.
7 | ///
8 | /// Author : Copyright (c) Olli Parviainen
9 | /// Author e-mail : oparviai 'at' iki.fi
10 | /// SoundTouch WWW: http://www.surina.net/soundtouch
11 | ///
12 | ////////////////////////////////////////////////////////////////////////////////
13 | //
14 | // Last changed : $Date: 2014-01-07 20:24:28 +0200 (Tue, 07 Jan 2014) $
15 | // File revision : $Revision: 4 $
16 | //
17 | // $Id: cpu_detect_x86.cpp 183 2014-01-07 18:24:28Z oparviai $
18 | //
19 | ////////////////////////////////////////////////////////////////////////////////
20 | //
21 | // License :
22 | //
23 | // SoundTouch audio processing library
24 | // Copyright (c) Olli Parviainen
25 | //
26 | // This library is free software; you can redistribute it and/or
27 | // modify it under the terms of the GNU Lesser General Public
28 | // License as published by the Free Software Foundation; either
29 | // version 2.1 of the License, or (at your option) any later version.
30 | //
31 | // This library is distributed in the hope that it will be useful,
32 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
34 | // Lesser General Public License for more details.
35 | //
36 | // You should have received a copy of the GNU Lesser General Public
37 | // License along with this library; if not, write to the Free Software
38 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
39 | //
40 | ////////////////////////////////////////////////////////////////////////////////
41 |
42 | #include "cpu_detect.h"
43 | #include "../soundtouch/include/STTypes.h"
44 |
45 |
46 | #if defined(SOUNDTOUCH_ALLOW_X86_OPTIMIZATIONS)
47 |
48 | #if defined(__GNUC__) && defined(__i386__)
49 | // gcc
50 | #include "cpuid.h"
51 | #elif defined(_M_IX86)
52 | // windows non-gcc
53 | #include
54 | #endif
55 |
56 | #define bit_MMX (1 << 23)
57 | #define bit_SSE (1 << 25)
58 | #define bit_SSE2 (1 << 26)
59 | #endif
60 |
61 |
62 | //////////////////////////////////////////////////////////////////////////////
63 | //
64 | // processor instructions extension detection routines
65 | //
66 | //////////////////////////////////////////////////////////////////////////////
67 |
68 | // Flag variable indicating whick ISA extensions are disabled (for debugging)
69 | static uint _dwDisabledISA = 0x00; // 0xffffffff; //<- use this to disable all extensions
70 |
71 | // Disables given set of instruction extensions. See SUPPORT_... defines.
72 | void disableExtensions(uint dwDisableMask)
73 | {
74 | _dwDisabledISA = dwDisableMask;
75 | }
76 |
77 |
78 |
79 | /// Checks which instruction set extensions are supported by the CPU.
80 | uint detectCPUextensions(void)
81 | {
82 | /// If building for a 64bit system (no Itanium) and the user wants optimizations.
83 | /// Return the OR of SUPPORT_{MMX,SSE,SSE2}. 11001 or 0x19.
84 | /// Keep the _dwDisabledISA test (2 more operations, could be eliminated).
85 | #if ((defined(__GNUC__) && defined(__x86_64__)) \
86 | || defined(_M_X64)) \
87 | && defined(SOUNDTOUCH_ALLOW_X86_OPTIMIZATIONS)
88 | return 0x19 & ~_dwDisabledISA;
89 |
90 | /// If building for a 32bit system and the user wants optimizations.
91 | /// Keep the _dwDisabledISA test (2 more operations, could be eliminated).
92 | #elif ((defined(__GNUC__) && defined(__i386__)) \
93 | || defined(_M_IX86)) \
94 | && defined(SOUNDTOUCH_ALLOW_X86_OPTIMIZATIONS)
95 |
96 | if (_dwDisabledISA == 0xffffffff) return 0;
97 |
98 | uint res = 0;
99 |
100 | #if defined(__GNUC__)
101 | // GCC version of cpuid. Requires GCC 4.3.0 or later for __cpuid intrinsic support.
102 | uint eax, ebx, ecx, edx; // unsigned int is the standard type. uint is defined by the compiler and not guaranteed to be portable.
103 |
104 | // Check if no cpuid support.
105 | if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) return 0; // always disable extensions.
106 |
107 | if (edx & bit_MMX) res = res | SUPPORT_MMX;
108 | if (edx & bit_SSE) res = res | SUPPORT_SSE;
109 | if (edx & bit_SSE2) res = res | SUPPORT_SSE2;
110 |
111 | #else
112 | // Window / VS version of cpuid. Notice that Visual Studio 2005 or later required
113 | // for __cpuid intrinsic support.
114 | int reg[4] = {-1};
115 |
116 | // Check if no cpuid support.
117 | __cpuid(reg,0);
118 | if ((unsigned int)reg[0] == 0) return 0; // always disable extensions.
119 |
120 | __cpuid(reg,1);
121 | if ((unsigned int)reg[3] & bit_MMX) res = res | SUPPORT_MMX;
122 | if ((unsigned int)reg[3] & bit_SSE) res = res | SUPPORT_SSE;
123 | if ((unsigned int)reg[3] & bit_SSE2) res = res | SUPPORT_SSE2;
124 |
125 | #endif
126 |
127 | return res & ~_dwDisabledISA;
128 |
129 | #else
130 |
131 | /// One of these is true:
132 | /// 1) We don't want optimizations.
133 | /// 2) Using an unsupported compiler.
134 | /// 3) Running on a non-x86 platform.
135 | return 0;
136 |
137 | #endif
138 | }
139 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/jni/soundtouch/source/SoundTouch/cpu_detect_x86.cpp:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | ///
3 | /// Generic version of the x86 CPU extension detection routine.
4 | ///
5 | /// This file is for GNU & other non-Windows compilers, see 'cpu_detect_x86_win.cpp'
6 | /// for the Microsoft compiler version.
7 | ///
8 | /// Author : Copyright (c) Olli Parviainen
9 | /// Author e-mail : oparviai 'at' iki.fi
10 | /// SoundTouch WWW: http://www.surina.net/soundtouch
11 | ///
12 | ////////////////////////////////////////////////////////////////////////////////
13 | //
14 | // Last changed : $Date: 2012-11-08 20:44:37 +0200 (Thu, 08 Nov 2012) $
15 | // File revision : $Revision: 4 $
16 | //
17 | // $Id: cpu_detect_x86.cpp 159 2012-11-08 18:44:37Z oparviai $
18 | //
19 | ////////////////////////////////////////////////////////////////////////////////
20 | //
21 | // License :
22 | //
23 | // SoundTouch audio processing library
24 | // Copyright (c) Olli Parviainen
25 | //
26 | // This library is free software; you can redistribute it and/or
27 | // modify it under the terms of the GNU Lesser General Public
28 | // License as published by the Free Software Foundation; either
29 | // version 2.1 of the License, or (at your option) any later version.
30 | //
31 | // This library is distributed in the hope that it will be useful,
32 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
34 | // Lesser General Public License for more details.
35 | //
36 | // You should have received a copy of the GNU Lesser General Public
37 | // License along with this library; if not, write to the Free Software
38 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
39 | //
40 | ////////////////////////////////////////////////////////////////////////////////
41 |
42 | #include "cpu_detect.h"
43 | #include "STTypes.h"
44 |
45 | #if defined(SOUNDTOUCH_ALLOW_X86_OPTIMIZATIONS)
46 |
47 | #if defined(__GNUC__) && defined(__i386__)
48 | // gcc
49 | #include "cpuid.h"
50 | #elif defined(_M_IX86)
51 | // windows non-gcc
52 | #include
53 | #define bit_MMX (1 << 23)
54 | #define bit_SSE (1 << 25)
55 | #define bit_SSE2 (1 << 26)
56 | #endif
57 |
58 | #endif
59 |
60 |
61 | //////////////////////////////////////////////////////////////////////////////
62 | //
63 | // processor instructions extension detection routines
64 | //
65 | //////////////////////////////////////////////////////////////////////////////
66 |
67 | // Flag variable indicating whick ISA extensions are disabled (for debugging)
68 | static uint _dwDisabledISA = 0x00; // 0xffffffff; //<- use this to disable all extensions
69 |
70 | // Disables given set of instruction extensions. See SUPPORT_... defines.
71 | void disableExtensions(uint dwDisableMask)
72 | {
73 | _dwDisabledISA = dwDisableMask;
74 | }
75 |
76 |
77 |
78 | /// Checks which instruction set extensions are supported by the CPU.
79 | uint detectCPUextensions(void)
80 | {
81 | /// If building for a 64bit system (no Itanium) and the user wants optimizations.
82 | /// Return the OR of SUPPORT_{MMX,SSE,SSE2}. 11001 or 0x19.
83 | /// Keep the _dwDisabledISA test (2 more operations, could be eliminated).
84 | #if ((defined(__GNUC__) && defined(__x86_64__)) \
85 | || defined(_M_X64)) \
86 | && defined(SOUNDTOUCH_ALLOW_X86_OPTIMIZATIONS)
87 | return 0x19 & ~_dwDisabledISA;
88 |
89 | /// If building for a 32bit system and the user wants optimizations.
90 | /// Keep the _dwDisabledISA test (2 more operations, could be eliminated).
91 | #elif ((defined(__GNUC__) && defined(__i386__)) \
92 | || defined(_M_IX86)) \
93 | && defined(SOUNDTOUCH_ALLOW_X86_OPTIMIZATIONS)
94 |
95 | if (_dwDisabledISA == 0xffffffff) return 0;
96 |
97 | uint res = 0;
98 |
99 | #if defined(__GNUC__)
100 | // GCC version of cpuid. Requires GCC 4.3.0 or later for __cpuid intrinsic support.
101 | uint eax, ebx, ecx, edx; // unsigned int is the standard type. uint is defined by the compiler and not guaranteed to be portable.
102 |
103 | // Check if no cpuid support.
104 | if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) return 0; // always disable extensions.
105 |
106 | if (edx & bit_MMX) res = res | SUPPORT_MMX;
107 | if (edx & bit_SSE) res = res | SUPPORT_SSE;
108 | if (edx & bit_SSE2) res = res | SUPPORT_SSE2;
109 |
110 | #else
111 | // Window / VS version of cpuid. Notice that Visual Studio 2005 or later required
112 | // for __cpuid intrinsic support.
113 | int reg[4] = {-1};
114 |
115 | // Check if no cpuid support.
116 | __cpuid(reg,0);
117 | if ((unsigned int)reg[0] == 0) return 0; // always disable extensions.
118 |
119 | __cpuid(reg,1);
120 | if ((unsigned int)reg[3] & bit_MMX) res = res | SUPPORT_MMX;
121 | if ((unsigned int)reg[3] & bit_SSE) res = res | SUPPORT_SSE;
122 | if ((unsigned int)reg[3] & bit_SSE2) res = res | SUPPORT_SSE2;
123 |
124 | #endif
125 |
126 | return res & ~_dwDisabledISA;
127 |
128 | #else
129 |
130 | /// One of these is true:
131 | /// 1) We don't want optimizations.
132 | /// 2) Using an unsupported compiler.
133 | /// 3) Running on a non-x86 platform.
134 | return 0;
135 |
136 | #endif
137 | }
138 |
--------------------------------------------------------------------------------
/VoiceChanger/jni/soundtouch/FIRFilter.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | ///
3 | /// General FIR digital filter routines with MMX optimization.
4 | ///
5 | /// Note : MMX optimized functions reside in a separate, platform-specific file,
6 | /// e.g. 'mmx_win.cpp' or 'mmx_gcc.cpp'
7 | ///
8 | /// Author : Copyright (c) Olli Parviainen
9 | /// Author e-mail : oparviai 'at' iki.fi
10 | /// SoundTouch WWW: http://www.surina.net/soundtouch
11 | ///
12 | ////////////////////////////////////////////////////////////////////////////////
13 | //
14 | // Last changed : $Date: 2015-02-21 23:24:29 +0200 (Sat, 21 Feb 2015) $
15 | // File revision : $Revision: 4 $
16 | //
17 | // $Id: FIRFilter.h 202 2015-02-21 21:24:29Z oparviai $
18 | //
19 | ////////////////////////////////////////////////////////////////////////////////
20 | //
21 | // License :
22 | //
23 | // SoundTouch audio processing library
24 | // Copyright (c) Olli Parviainen
25 | //
26 | // This library is free software; you can redistribute it and/or
27 | // modify it under the terms of the GNU Lesser General Public
28 | // License as published by the Free Software Foundation; either
29 | // version 2.1 of the License, or (at your option) any later version.
30 | //
31 | // This library is distributed in the hope that it will be useful,
32 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
33 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
34 | // Lesser General Public License for more details.
35 | //
36 | // You should have received a copy of the GNU Lesser General Public
37 | // License along with this library; if not, write to the Free Software
38 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
39 | //
40 | ////////////////////////////////////////////////////////////////////////////////
41 |
42 | #ifndef FIRFilter_H
43 | #define FIRFilter_H
44 |
45 | #include
46 | #include "../soundtouch/include/STTypes.h"
47 |
48 | namespace soundtouch
49 | {
50 |
51 | class FIRFilter
52 | {
53 | protected:
54 | // Number of FIR filter taps
55 | uint length;
56 | // Number of FIR filter taps divided by 8
57 | uint lengthDiv8;
58 |
59 | // Result divider factor in 2^k format
60 | uint resultDivFactor;
61 |
62 | // Result divider value.
63 | SAMPLETYPE resultDivider;
64 |
65 | // Memory for filter coefficients
66 | SAMPLETYPE *filterCoeffs;
67 |
68 | virtual uint evaluateFilterStereo(SAMPLETYPE *dest,
69 | const SAMPLETYPE *src,
70 | uint numSamples) const;
71 | virtual uint evaluateFilterMono(SAMPLETYPE *dest,
72 | const SAMPLETYPE *src,
73 | uint numSamples) const;
74 | virtual uint evaluateFilterMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, uint numSamples, uint numChannels);
75 |
76 | public:
77 | FIRFilter();
78 | virtual ~FIRFilter();
79 |
80 | /// Operator 'new' is overloaded so that it automatically creates a suitable instance
81 | /// depending on if we've a MMX-capable CPU available or not.
82 | static void * operator new(size_t s);
83 |
84 | static FIRFilter *newInstance();
85 |
86 | /// Applies the filter to the given sequence of samples.
87 | /// Note : The amount of outputted samples is by value of 'filter_length'
88 | /// smaller than the amount of input samples.
89 | ///
90 | /// \return Number of samples copied to 'dest'.
91 | uint evaluate(SAMPLETYPE *dest,
92 | const SAMPLETYPE *src,
93 | uint numSamples,
94 | uint numChannels);
95 |
96 | uint getLength() const;
97 |
98 | virtual void setCoefficients(const SAMPLETYPE *coeffs,
99 | uint newLength,
100 | uint uResultDivFactor);
101 | };
102 |
103 |
104 | // Optional subclasses that implement CPU-specific optimizations:
105 |
106 | #ifdef SOUNDTOUCH_ALLOW_MMX
107 |
108 | /// Class that implements MMX optimized functions exclusive for 16bit integer samples type.
109 | class FIRFilterMMX : public FIRFilter
110 | {
111 | protected:
112 | short *filterCoeffsUnalign;
113 | short *filterCoeffsAlign;
114 |
115 | virtual uint evaluateFilterStereo(short *dest, const short *src, uint numSamples) const;
116 | public:
117 | FIRFilterMMX();
118 | ~FIRFilterMMX();
119 |
120 | virtual void setCoefficients(const short *coeffs, uint newLength, uint uResultDivFactor);
121 | };
122 |
123 | #endif // SOUNDTOUCH_ALLOW_MMX
124 |
125 |
126 | #ifdef SOUNDTOUCH_ALLOW_SSE
127 | /// Class that implements SSE optimized functions exclusive for floating point samples type.
128 | class FIRFilterSSE : public FIRFilter
129 | {
130 | protected:
131 | float *filterCoeffsUnalign;
132 | float *filterCoeffsAlign;
133 |
134 | virtual uint evaluateFilterStereo(float *dest, const float *src, uint numSamples) const;
135 | public:
136 | FIRFilterSSE();
137 | ~FIRFilterSSE();
138 |
139 | virtual void setCoefficients(const float *coeffs, uint newLength, uint uResultDivFactor);
140 | };
141 |
142 | #endif // SOUNDTOUCH_ALLOW_SSE
143 |
144 | }
145 |
146 | #endif // FIRFilter_H
147 |
--------------------------------------------------------------------------------
/VoiceChanger/jni/soundtouch/SoundTouch.dsp:
--------------------------------------------------------------------------------
1 | # Microsoft Developer Studio Project File - Name="SoundTouch" - Package Owner=<4>
2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00
3 | # ** DO NOT EDIT **
4 |
5 | # TARGTYPE "Win32 (x86) Static Library" 0x0104
6 |
7 | CFG=SoundTouch - Win32 Debug
8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE,
9 | !MESSAGE use the Export Makefile command and run
10 | !MESSAGE
11 | !MESSAGE NMAKE /f "SoundTouch.mak".
12 | !MESSAGE
13 | !MESSAGE You can specify a configuration when running NMAKE
14 | !MESSAGE by defining the macro CFG on the command line. For example:
15 | !MESSAGE
16 | !MESSAGE NMAKE /f "SoundTouch.mak" CFG="SoundTouch - Win32 Debug"
17 | !MESSAGE
18 | !MESSAGE Possible choices for configuration are:
19 | !MESSAGE
20 | !MESSAGE "SoundTouch - Win32 Release" (based on "Win32 (x86) Static Library")
21 | !MESSAGE "SoundTouch - Win32 Debug" (based on "Win32 (x86) Static Library")
22 | !MESSAGE
23 |
24 | # Begin Project
25 | # PROP AllowPerConfigDependencies 0
26 | # PROP Scc_ProjName ""
27 | # PROP Scc_LocalPath ""
28 | CPP=cl.exe
29 | RSC=rc.exe
30 |
31 | !IF "$(CFG)" == "SoundTouch - Win32 Release"
32 |
33 | # PROP BASE Use_MFC 0
34 | # PROP BASE Use_Debug_Libraries 0
35 | # PROP BASE Output_Dir "Release"
36 | # PROP BASE Intermediate_Dir "Release"
37 | # PROP BASE Target_Dir ""
38 | # PROP Use_MFC 0
39 | # PROP Use_Debug_Libraries 0
40 | # PROP Output_Dir "Release"
41 | # PROP Intermediate_Dir "Release"
42 | # PROP Target_Dir ""
43 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
44 | # ADD CPP /nologo /W3 /GX /Zi /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
45 | # ADD BASE RSC /l 0x40b /d "NDEBUG"
46 | # ADD RSC /l 0x40b /d "NDEBUG"
47 | BSC32=bscmake.exe
48 | # ADD BASE BSC32 /nologo
49 | # ADD BSC32 /nologo
50 | LIB32=link.exe -lib
51 | # ADD BASE LIB32 /nologo
52 | # ADD LIB32 /nologo
53 | # Begin Special Build Tool
54 | SOURCE="$(InputPath)"
55 | PostBuild_Cmds=copy .\Release\SoundTouch.lib ..\..\lib\
56 | # End Special Build Tool
57 |
58 | !ELSEIF "$(CFG)" == "SoundTouch - Win32 Debug"
59 |
60 | # PROP BASE Use_MFC 0
61 | # PROP BASE Use_Debug_Libraries 1
62 | # PROP BASE Output_Dir "Debug"
63 | # PROP BASE Intermediate_Dir "Debug"
64 | # PROP BASE Target_Dir ""
65 | # PROP Use_MFC 0
66 | # PROP Use_Debug_Libraries 1
67 | # PROP Output_Dir "Debug"
68 | # PROP Intermediate_Dir "Debug"
69 | # PROP Target_Dir ""
70 | # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
71 | # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /YX /FD /GZ /c
72 | # ADD BASE RSC /l 0x40b /d "_DEBUG"
73 | # ADD RSC /l 0x40b /d "_DEBUG"
74 | BSC32=bscmake.exe
75 | # ADD BASE BSC32 /nologo
76 | # ADD BSC32 /nologo
77 | LIB32=link.exe -lib
78 | # ADD BASE LIB32 /nologo
79 | # ADD LIB32 /nologo /out:"Debug\SoundTouchD.lib"
80 | # Begin Special Build Tool
81 | SOURCE="$(InputPath)"
82 | PostBuild_Cmds=copy .\Debug\SoundTouchD.lib ..\..\lib\
83 | # End Special Build Tool
84 |
85 | !ENDIF
86 |
87 | # Begin Target
88 |
89 | # Name "SoundTouch - Win32 Release"
90 | # Name "SoundTouch - Win32 Debug"
91 | # Begin Group "Source Files"
92 |
93 | # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
94 | # Begin Group "bpm"
95 |
96 | # PROP Default_Filter ""
97 | # Begin Source File
98 |
99 | SOURCE=.\BPMDetect.cpp
100 | # End Source File
101 | # Begin Source File
102 |
103 | SOURCE=.\PeakFinder.cpp
104 | # End Source File
105 | # End Group
106 | # Begin Source File
107 |
108 | SOURCE=.\3dnow_win.cpp
109 | # End Source File
110 | # Begin Source File
111 |
112 | SOURCE=.\AAFilter.cpp
113 | # End Source File
114 | # Begin Source File
115 |
116 | SOURCE=.\cpu_detect_x86_win.cpp
117 | # End Source File
118 | # Begin Source File
119 |
120 | SOURCE=.\FIFOSampleBuffer.cpp
121 | # End Source File
122 | # Begin Source File
123 |
124 | SOURCE=.\FIRFilter.cpp
125 | # End Source File
126 | # Begin Source File
127 |
128 | SOURCE=.\mmx_optimized.cpp
129 | # End Source File
130 | # Begin Source File
131 |
132 | SOURCE=.\RateTransposer.cpp
133 | # End Source File
134 | # Begin Source File
135 |
136 | SOURCE=.\SoundTouch.cpp
137 | # End Source File
138 | # Begin Source File
139 |
140 | SOURCE=.\sse_optimized.cpp
141 | # End Source File
142 | # Begin Source File
143 |
144 | SOURCE=.\TDStretch.cpp
145 | # End Source File
146 | # End Group
147 | # Begin Group "Header Files"
148 |
149 | # PROP Default_Filter "h;hpp;hxx;hm;inl"
150 | # Begin Source File
151 |
152 | SOURCE=.\AAFilter.h
153 | # End Source File
154 | # Begin Source File
155 |
156 | SOURCE=.\cpu_detect.h
157 | # End Source File
158 | # Begin Source File
159 |
160 | SOURCE=..\..\include\FIFOSampleBuffer.h
161 | # End Source File
162 | # Begin Source File
163 |
164 | SOURCE=..\..\include\FIFOSamplePipe.h
165 | # End Source File
166 | # Begin Source File
167 |
168 | SOURCE=.\FIRFilter.h
169 | # End Source File
170 | # Begin Source File
171 |
172 | SOURCE=.\RateTransposer.h
173 | # End Source File
174 | # Begin Source File
175 |
176 | SOURCE=..\..\include\SoundTouch.h
177 | # End Source File
178 | # Begin Source File
179 |
180 | SOURCE=..\..\include\STTypes.h
181 | # End Source File
182 | # Begin Source File
183 |
184 | SOURCE=.\TDStretch.h
185 | # End Source File
186 | # End Group
187 | # End Target
188 | # End Project
189 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/jni/soundtouch/source/SoundTouch/SoundTouch.dsp:
--------------------------------------------------------------------------------
1 | # Microsoft Developer Studio Project File - Name="SoundTouch" - Package Owner=<4>
2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00
3 | # ** DO NOT EDIT **
4 |
5 | # TARGTYPE "Win32 (x86) Static Library" 0x0104
6 |
7 | CFG=SoundTouch - Win32 Debug
8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE,
9 | !MESSAGE use the Export Makefile command and run
10 | !MESSAGE
11 | !MESSAGE NMAKE /f "SoundTouch.mak".
12 | !MESSAGE
13 | !MESSAGE You can specify a configuration when running NMAKE
14 | !MESSAGE by defining the macro CFG on the command line. For example:
15 | !MESSAGE
16 | !MESSAGE NMAKE /f "SoundTouch.mak" CFG="SoundTouch - Win32 Debug"
17 | !MESSAGE
18 | !MESSAGE Possible choices for configuration are:
19 | !MESSAGE
20 | !MESSAGE "SoundTouch - Win32 Release" (based on "Win32 (x86) Static Library")
21 | !MESSAGE "SoundTouch - Win32 Debug" (based on "Win32 (x86) Static Library")
22 | !MESSAGE
23 |
24 | # Begin Project
25 | # PROP AllowPerConfigDependencies 0
26 | # PROP Scc_ProjName ""
27 | # PROP Scc_LocalPath ""
28 | CPP=cl.exe
29 | RSC=rc.exe
30 |
31 | !IF "$(CFG)" == "SoundTouch - Win32 Release"
32 |
33 | # PROP BASE Use_MFC 0
34 | # PROP BASE Use_Debug_Libraries 0
35 | # PROP BASE Output_Dir "Release"
36 | # PROP BASE Intermediate_Dir "Release"
37 | # PROP BASE Target_Dir ""
38 | # PROP Use_MFC 0
39 | # PROP Use_Debug_Libraries 0
40 | # PROP Output_Dir "Release"
41 | # PROP Intermediate_Dir "Release"
42 | # PROP Target_Dir ""
43 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
44 | # ADD CPP /nologo /W3 /GX /Zi /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
45 | # ADD BASE RSC /l 0x40b /d "NDEBUG"
46 | # ADD RSC /l 0x40b /d "NDEBUG"
47 | BSC32=bscmake.exe
48 | # ADD BASE BSC32 /nologo
49 | # ADD BSC32 /nologo
50 | LIB32=link.exe -lib
51 | # ADD BASE LIB32 /nologo
52 | # ADD LIB32 /nologo
53 | # Begin Special Build Tool
54 | SOURCE="$(InputPath)"
55 | PostBuild_Cmds=copy .\Release\SoundTouch.lib ..\..\lib\
56 | # End Special Build Tool
57 |
58 | !ELSEIF "$(CFG)" == "SoundTouch - Win32 Debug"
59 |
60 | # PROP BASE Use_MFC 0
61 | # PROP BASE Use_Debug_Libraries 1
62 | # PROP BASE Output_Dir "Debug"
63 | # PROP BASE Intermediate_Dir "Debug"
64 | # PROP BASE Target_Dir ""
65 | # PROP Use_MFC 0
66 | # PROP Use_Debug_Libraries 1
67 | # PROP Output_Dir "Debug"
68 | # PROP Intermediate_Dir "Debug"
69 | # PROP Target_Dir ""
70 | # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
71 | # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /YX /FD /GZ /c
72 | # ADD BASE RSC /l 0x40b /d "_DEBUG"
73 | # ADD RSC /l 0x40b /d "_DEBUG"
74 | BSC32=bscmake.exe
75 | # ADD BASE BSC32 /nologo
76 | # ADD BSC32 /nologo
77 | LIB32=link.exe -lib
78 | # ADD BASE LIB32 /nologo
79 | # ADD LIB32 /nologo /out:"Debug\SoundTouchD.lib"
80 | # Begin Special Build Tool
81 | SOURCE="$(InputPath)"
82 | PostBuild_Cmds=copy .\Debug\SoundTouchD.lib ..\..\lib\
83 | # End Special Build Tool
84 |
85 | !ENDIF
86 |
87 | # Begin Target
88 |
89 | # Name "SoundTouch - Win32 Release"
90 | # Name "SoundTouch - Win32 Debug"
91 | # Begin Group "Source Files"
92 |
93 | # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
94 | # Begin Group "bpm"
95 |
96 | # PROP Default_Filter ""
97 | # Begin Source File
98 |
99 | SOURCE=.\BPMDetect.cpp
100 | # End Source File
101 | # Begin Source File
102 |
103 | SOURCE=.\PeakFinder.cpp
104 | # End Source File
105 | # End Group
106 | # Begin Source File
107 |
108 | SOURCE=.\3dnow_win.cpp
109 | # End Source File
110 | # Begin Source File
111 |
112 | SOURCE=.\AAFilter.cpp
113 | # End Source File
114 | # Begin Source File
115 |
116 | SOURCE=.\cpu_detect_x86_win.cpp
117 | # End Source File
118 | # Begin Source File
119 |
120 | SOURCE=.\FIFOSampleBuffer.cpp
121 | # End Source File
122 | # Begin Source File
123 |
124 | SOURCE=.\FIRFilter.cpp
125 | # End Source File
126 | # Begin Source File
127 |
128 | SOURCE=.\mmx_optimized.cpp
129 | # End Source File
130 | # Begin Source File
131 |
132 | SOURCE=.\RateTransposer.cpp
133 | # End Source File
134 | # Begin Source File
135 |
136 | SOURCE=.\SoundTouch.cpp
137 | # End Source File
138 | # Begin Source File
139 |
140 | SOURCE=.\sse_optimized.cpp
141 | # End Source File
142 | # Begin Source File
143 |
144 | SOURCE=.\TDStretch.cpp
145 | # End Source File
146 | # End Group
147 | # Begin Group "Header Files"
148 |
149 | # PROP Default_Filter "h;hpp;hxx;hm;inl"
150 | # Begin Source File
151 |
152 | SOURCE=.\AAFilter.h
153 | # End Source File
154 | # Begin Source File
155 |
156 | SOURCE=.\cpu_detect.h
157 | # End Source File
158 | # Begin Source File
159 |
160 | SOURCE=..\..\include\FIFOSampleBuffer.h
161 | # End Source File
162 | # Begin Source File
163 |
164 | SOURCE=..\..\include\FIFOSamplePipe.h
165 | # End Source File
166 | # Begin Source File
167 |
168 | SOURCE=.\FIRFilter.h
169 | # End Source File
170 | # Begin Source File
171 |
172 | SOURCE=.\RateTransposer.h
173 | # End Source File
174 | # Begin Source File
175 |
176 | SOURCE=..\..\include\SoundTouch.h
177 | # End Source File
178 | # Begin Source File
179 |
180 | SOURCE=..\..\include\STTypes.h
181 | # End Source File
182 | # Begin Source File
183 |
184 | SOURCE=.\TDStretch.h
185 | # End Source File
186 | # End Group
187 | # End Target
188 | # End Project
189 |
--------------------------------------------------------------------------------
/VoiceChanger/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/jni/soundtouch/source/SoundTouch/AAFilter.cpp:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | ///
3 | /// FIR low-pass (anti-alias) filter with filter coefficient design routine and
4 | /// MMX optimization.
5 | ///
6 | /// Anti-alias filter is used to prevent folding of high frequencies when
7 | /// transposing the sample rate with interpolation.
8 | ///
9 | /// Author : Copyright (c) Olli Parviainen
10 | /// Author e-mail : oparviai 'at' iki.fi
11 | /// SoundTouch WWW: http://www.surina.net/soundtouch
12 | ///
13 | ////////////////////////////////////////////////////////////////////////////////
14 | //
15 | // Last changed : $Date: 2009-01-11 13:34:24 +0200 (Sun, 11 Jan 2009) $
16 | // File revision : $Revision: 4 $
17 | //
18 | // $Id: AAFilter.cpp 45 2009-01-11 11:34:24Z oparviai $
19 | //
20 | ////////////////////////////////////////////////////////////////////////////////
21 | //
22 | // License :
23 | //
24 | // SoundTouch audio processing library
25 | // Copyright (c) Olli Parviainen
26 | //
27 | // This library is free software; you can redistribute it and/or
28 | // modify it under the terms of the GNU Lesser General Public
29 | // License as published by the Free Software Foundation; either
30 | // version 2.1 of the License, or (at your option) any later version.
31 | //
32 | // This library is distributed in the hope that it will be useful,
33 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
34 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
35 | // Lesser General Public License for more details.
36 | //
37 | // You should have received a copy of the GNU Lesser General Public
38 | // License along with this library; if not, write to the Free Software
39 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
40 | //
41 | ////////////////////////////////////////////////////////////////////////////////
42 |
43 | #include
44 | #include
45 | #include
46 | #include
47 | #include "AAFilter.h"
48 | #include "FIRFilter.h"
49 |
50 | using namespace soundtouch;
51 |
52 | #define PI 3.141592655357989
53 | #define TWOPI (2 * PI)
54 |
55 | /*****************************************************************************
56 | *
57 | * Implementation of the class 'AAFilter'
58 | *
59 | *****************************************************************************/
60 |
61 | AAFilter::AAFilter(uint len)
62 | {
63 | pFIR = FIRFilter::newInstance();
64 | cutoffFreq = 0.5;
65 | setLength(len);
66 | }
67 |
68 |
69 |
70 | AAFilter::~AAFilter()
71 | {
72 | delete pFIR;
73 | }
74 |
75 |
76 |
77 | // Sets new anti-alias filter cut-off edge frequency, scaled to
78 | // sampling frequency (nyquist frequency = 0.5).
79 | // The filter will cut frequencies higher than the given frequency.
80 | void AAFilter::setCutoffFreq(double newCutoffFreq)
81 | {
82 | cutoffFreq = newCutoffFreq;
83 | calculateCoeffs();
84 | }
85 |
86 |
87 |
88 | // Sets number of FIR filter taps
89 | void AAFilter::setLength(uint newLength)
90 | {
91 | length = newLength;
92 | calculateCoeffs();
93 | }
94 |
95 |
96 |
97 | // Calculates coefficients for a low-pass FIR filter using Hamming window
98 | void AAFilter::calculateCoeffs()
99 | {
100 | uint i;
101 | double cntTemp, temp, tempCoeff,h, w;
102 | double fc2, wc;
103 | double scaleCoeff, sum;
104 | double *work;
105 | SAMPLETYPE *coeffs;
106 |
107 | assert(length >= 2);
108 | assert(length % 4 == 0);
109 | assert(cutoffFreq >= 0);
110 | assert(cutoffFreq <= 0.5);
111 |
112 | work = new double[length];
113 | coeffs = new SAMPLETYPE[length];
114 |
115 | fc2 = 2.0 * cutoffFreq;
116 | wc = PI * fc2;
117 | tempCoeff = TWOPI / (double)length;
118 |
119 | sum = 0;
120 | for (i = 0; i < length; i ++)
121 | {
122 | cntTemp = (double)i - (double)(length / 2);
123 |
124 | temp = cntTemp * wc;
125 | if (temp != 0)
126 | {
127 | h = fc2 * sin(temp) / temp; // sinc function
128 | }
129 | else
130 | {
131 | h = 1.0;
132 | }
133 | w = 0.54 + 0.46 * cos(tempCoeff * cntTemp); // hamming window
134 |
135 | temp = w * h;
136 | work[i] = temp;
137 |
138 | // calc net sum of coefficients
139 | sum += temp;
140 | }
141 |
142 | // ensure the sum of coefficients is larger than zero
143 | assert(sum > 0);
144 |
145 | // ensure we've really designed a lowpass filter...
146 | assert(work[length/2] > 0);
147 | assert(work[length/2 + 1] > -1e-6);
148 | assert(work[length/2 - 1] > -1e-6);
149 |
150 | // Calculate a scaling coefficient in such a way that the result can be
151 | // divided by 16384
152 | scaleCoeff = 16384.0f / sum;
153 |
154 | for (i = 0; i < length; i ++)
155 | {
156 | // scale & round to nearest integer
157 | temp = work[i] * scaleCoeff;
158 | temp += (temp >= 0) ? 0.5 : -0.5;
159 | // ensure no overfloods
160 | assert(temp >= -32768 && temp <= 32767);
161 | coeffs[i] = (SAMPLETYPE)temp;
162 | }
163 |
164 | // Set coefficients. Use divide factor 14 => divide result by 2^14 = 16384
165 | pFIR->setCoefficients(coeffs, length, 14);
166 |
167 | delete[] work;
168 | delete[] coeffs;
169 | }
170 |
171 |
172 | // Applies the filter to the given sequence of samples.
173 | // Note : The amount of outputted samples is by value of 'filter length'
174 | // smaller than the amount of input samples.
175 | uint AAFilter::evaluate(SAMPLETYPE *dest, const SAMPLETYPE *src, uint numSamples, uint numChannels) const
176 | {
177 | return pFIR->evaluate(dest, src, numSamples, numChannels);
178 | }
179 |
180 |
181 | uint AAFilter::getLength() const
182 | {
183 | return pFIR->getLength();
184 | }
185 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/java/com/vehar/VoiceChanger.java:
--------------------------------------------------------------------------------
1 | /////////////////////////////////////////////////////////////////////////////
2 | ///
3 | /// Example Android Application/Activity that allows processing WAV
4 | /// audio files with SoundTouch library
5 | ///
6 | /// Copyright (c) Olli Parviainen
7 | ///
8 | ////////////////////////////////////////////////////////////////////////////////
9 | //
10 | // $Id: SoundTouch.java 210 2015-05-14 20:03:56Z oparviai $
11 | //
12 | ////////////////////////////////////////////////////////////////////////////////
13 |
14 |
15 | package com.vehar;
16 |
17 | import android.Manifest;
18 | import android.content.Intent;
19 | import android.content.pm.PackageManager;
20 | import android.os.Bundle;
21 | import android.support.v4.app.ActivityCompat;
22 | import android.support.v4.content.ContextCompat;
23 | import android.support.v7.app.AppCompatActivity;
24 | import android.view.View;
25 | import android.view.View.OnClickListener;
26 | import android.widget.Button;
27 | import android.widget.SeekBar;
28 | import android.widget.TextView;
29 |
30 | import com.vehar.soundtouchandroid.R;
31 |
32 | import java.util.ArrayList;
33 | import java.util.List;
34 |
35 | //App states
36 | public class VoiceChanger extends AppCompatActivity implements OnClickListener {
37 | TextView textViewConsole = null;
38 | SeekBar pitchBar = null;
39 | Button buttonRecord = null;
40 | Button buttonProcess = null;
41 | Button buttonPlayOriginal = null;
42 | Button buttonPlayProcessed = null;
43 |
44 |
45 | private AudioRecording recorder = null;
46 |
47 | private boolean isRecording = false;
48 | private boolean isRecordered = false;
49 | private boolean isProcessing = false;
50 | private boolean isProcessed = false;
51 |
52 | String TAG = "voiceChanger";
53 |
54 |
55 | StringBuilder consoleText = new StringBuilder();
56 |
57 | /// Called when the activity is created
58 | @Override
59 | protected void onCreate(Bundle savedInstanceState) {
60 | super.onCreate(savedInstanceState);
61 | setContentView(R.layout.activity_example);
62 |
63 | Permissions();
64 |
65 | pitchBar = (SeekBar) findViewById(R.id.pitchBar);
66 | buttonRecord = (Button) findViewById(R.id.buttonRecord);
67 |
68 | buttonPlayOriginal = (Button) findViewById(R.id.buttonPlayOriginal);
69 | buttonPlayProcessed = (Button) findViewById(R.id.buttonPlayProcessed);
70 |
71 |
72 | pitchBar.setProgress(10);
73 |
74 | recorder = new AudioRecording();
75 |
76 | }
77 |
78 |
79 | /// Function to append status text onto "console box" on the Activity
80 | public void appendToConsole(final String text) {
81 | // run on UI thread to avoid conflicts
82 | runOnUiThread(new Runnable() {
83 | public void run() {
84 | consoleText.append(text);
85 | consoleText.append("\n");
86 | textViewConsole.setText(consoleText);
87 | }
88 | });
89 | }
90 |
91 |
92 | /// Button click handler
93 | @Override
94 | public void onClick(View arg0) {
95 | int i = arg0.getId();
96 | if (i == R.id.buttonRecord) {
97 | if (!isRecording && !isProcessing) {
98 | isRecording = true;
99 | record();
100 | } else {
101 | stopRecording();
102 | isRecording = false;
103 | isRecordered = true;
104 | buttonPlayOriginal.setEnabled(true);
105 | }
106 |
107 |
108 | } else if (i == R.id.buttonPlayOriginal) {
109 | if (isRecordered) {
110 | recorder.playOriginal();
111 | }
112 |
113 | } else if (i == R.id.buttonPlayProcessed) {
114 | if (isRecordered) {
115 | recorder.playProcessed();
116 | }
117 | } else if (i == R.id.buttonQR) {
118 | Intent intentGenQr = new Intent(this, QRCodeServer.class);
119 | startActivity(intentGenQr);
120 |
121 | }
122 |
123 | }
124 |
125 |
126 | private void stopRecording() {
127 | buttonRecord.setText("Record");
128 |
129 | recorder.stopRecording();
130 | }
131 |
132 | private void record() {
133 | buttonRecord.setText("Stop recording");
134 |
135 | recorder.startRecording(pitchBar.getProgress()-10);
136 | }
137 |
138 | @Override
139 | public void onStart() {
140 | super.onStart();
141 |
142 | }
143 |
144 | @Override
145 | public void onStop() {
146 | super.onStop();
147 |
148 | }
149 |
150 | private boolean Permissions() {
151 | int permissionWRITE_EXTERNAL_STORAGE = ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);
152 | int permissionRECORD = ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO);
153 | int permissionWIFI = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_WIFI_STATE);
154 | List listPermissionsNeeded = new ArrayList();
155 |
156 | if (permissionWRITE_EXTERNAL_STORAGE != PackageManager.PERMISSION_GRANTED) {
157 | listPermissionsNeeded.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
158 | }
159 | if (permissionRECORD != PackageManager.PERMISSION_GRANTED) {
160 | listPermissionsNeeded.add(Manifest.permission.RECORD_AUDIO);
161 | }
162 |
163 | if (permissionWIFI != PackageManager.PERMISSION_GRANTED) {
164 | listPermissionsNeeded.add(Manifest.permission.ACCESS_WIFI_STATE);
165 | }
166 |
167 | if (!listPermissionsNeeded.isEmpty()) {
168 | ActivityCompat.requestPermissions(this, listPermissionsNeeded.toArray(new String[listPermissionsNeeded.size()]), 1);
169 | return false;
170 | }
171 |
172 | return true;
173 |
174 |
175 | }
176 |
177 |
178 | }
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/jni/soundtouch/source/SoundTouchDLL/SoundTouchDLL.vcproj:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
14 |
15 |
16 |
17 |
18 |
26 |
29 |
32 |
35 |
38 |
41 |
54 |
57 |
60 |
63 |
76 |
79 |
82 |
85 |
88 |
91 |
94 |
98 |
99 |
107 |
110 |
113 |
116 |
119 |
122 |
137 |
140 |
143 |
146 |
161 |
164 |
167 |
170 |
173 |
176 |
179 |
183 |
184 |
185 |
186 |
187 |
188 |
193 |
196 |
197 |
198 |
203 |
206 |
207 |
210 |
211 |
212 |
217 |
220 |
221 |
222 |
225 |
226 |
227 |
228 |
229 |
230 |
--------------------------------------------------------------------------------
/VoiceChanger/app/src/main/jni/soundtouch/source/SoundTouch/RateTransposer.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | ///
3 | /// Sample rate transposer. Changes sample rate by using linear interpolation
4 | /// together with anti-alias filtering (first order interpolation with anti-
5 | /// alias filtering should be quite adequate for this application).
6 | ///
7 | /// Use either of the derived classes of 'RateTransposerInteger' or
8 | /// 'RateTransposerFloat' for corresponding integer/floating point tranposing
9 | /// algorithm implementation.
10 | ///
11 | /// Author : Copyright (c) Olli Parviainen
12 | /// Author e-mail : oparviai 'at' iki.fi
13 | /// SoundTouch WWW: http://www.surina.net/soundtouch
14 | ///
15 | ////////////////////////////////////////////////////////////////////////////////
16 | //
17 | // Last changed : $Date: 2009-02-21 18:00:14 +0200 (Sat, 21 Feb 2009) $
18 | // File revision : $Revision: 4 $
19 | //
20 | // $Id: RateTransposer.h 63 2009-02-21 16:00:14Z oparviai $
21 | //
22 | ////////////////////////////////////////////////////////////////////////////////
23 | //
24 | // License :
25 | //
26 | // SoundTouch audio processing library
27 | // Copyright (c) Olli Parviainen
28 | //
29 | // This library is free software; you can redistribute it and/or
30 | // modify it under the terms of the GNU Lesser General Public
31 | // License as published by the Free Software Foundation; either
32 | // version 2.1 of the License, or (at your option) any later version.
33 | //
34 | // This library is distributed in the hope that it will be useful,
35 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
36 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
37 | // Lesser General Public License for more details.
38 | //
39 | // You should have received a copy of the GNU Lesser General Public
40 | // License along with this library; if not, write to the Free Software
41 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
42 | //
43 | ////////////////////////////////////////////////////////////////////////////////
44 |
45 | #ifndef RateTransposer_H
46 | #define RateTransposer_H
47 |
48 | #include
49 | #include "AAFilter.h"
50 | #include "FIFOSamplePipe.h"
51 | #include "FIFOSampleBuffer.h"
52 |
53 | #include "STTypes.h"
54 |
55 | namespace soundtouch
56 | {
57 |
58 | /// A common linear samplerate transposer class.
59 | ///
60 | /// Note: Use function "RateTransposer::newInstance()" to create a new class
61 | /// instance instead of the "new" operator; that function automatically
62 | /// chooses a correct implementation depending on if integer or floating
63 | /// arithmetics are to be used.
64 | class RateTransposer : public FIFOProcessor
65 | {
66 | protected:
67 | /// Anti-alias filter object
68 | AAFilter *pAAFilter;
69 |
70 | float fRate;
71 |
72 | int numChannels;
73 |
74 | /// Buffer for collecting samples to feed the anti-alias filter between
75 | /// two batches
76 | FIFOSampleBuffer storeBuffer;
77 |
78 | /// Buffer for keeping samples between transposing & anti-alias filter
79 | FIFOSampleBuffer tempBuffer;
80 |
81 | /// Output sample buffer
82 | FIFOSampleBuffer outputBuffer;
83 |
84 | BOOL bUseAAFilter;
85 |
86 | virtual void resetRegisters() = 0;
87 |
88 | virtual uint transposeStereo(SAMPLETYPE *dest,
89 | const SAMPLETYPE *src,
90 | uint numSamples) = 0;
91 | virtual uint transposeMono(SAMPLETYPE *dest,
92 | const SAMPLETYPE *src,
93 | uint numSamples) = 0;
94 | inline uint transpose(SAMPLETYPE *dest,
95 | const SAMPLETYPE *src,
96 | uint numSamples);
97 |
98 | void downsample(const SAMPLETYPE *src,
99 | uint numSamples);
100 | void upsample(const SAMPLETYPE *src,
101 | uint numSamples);
102 |
103 | /// Transposes sample rate by applying anti-alias filter to prevent folding.
104 | /// Returns amount of samples returned in the "dest" buffer.
105 | /// The maximum amount of samples that can be returned at a time is set by
106 | /// the 'set_returnBuffer_size' function.
107 | void processSamples(const SAMPLETYPE *src,
108 | uint numSamples);
109 |
110 |
111 | public:
112 | RateTransposer();
113 | virtual ~RateTransposer();
114 |
115 | /// Operator 'new' is overloaded so that it automatically creates a suitable instance
116 | /// depending on if we're to use integer or floating point arithmetics.
117 | static void *operator new(size_t s);
118 |
119 | /// Use this function instead of "new" operator to create a new instance of this class.
120 | /// This function automatically chooses a correct implementation, depending on if
121 | /// integer ot floating point arithmetics are to be used.
122 | static RateTransposer *newInstance();
123 |
124 | /// Returns the output buffer object
125 | FIFOSamplePipe *getOutput() { return &outputBuffer; };
126 |
127 | /// Returns the store buffer object
128 | FIFOSamplePipe *getStore() { return &storeBuffer; };
129 |
130 | /// Return anti-alias filter object
131 | AAFilter *getAAFilter();
132 |
133 | /// Enables/disables the anti-alias filter. Zero to disable, nonzero to enable
134 | void enableAAFilter(BOOL newMode);
135 |
136 | /// Returns nonzero if anti-alias filter is enabled.
137 | BOOL isAAFilterEnabled() const;
138 |
139 | /// Sets new target rate. Normal rate = 1.0, smaller values represent slower
140 | /// rate, larger faster rates.
141 | virtual void setRate(float newRate);
142 |
143 | /// Sets the number of channels, 1 = mono, 2 = stereo
144 | void setChannels(int channels);
145 |
146 | /// Adds 'numSamples' pcs of samples from the 'samples' memory position into
147 | /// the input of the object.
148 | void putSamples(const SAMPLETYPE *samples, uint numSamples);
149 |
150 | /// Clears all the samples in the object
151 | void clear();
152 |
153 | /// Returns nonzero if there aren't any samples available for outputting.
154 | int isEmpty() const;
155 | };
156 |
157 | }
158 |
159 | #endif
160 |
--------------------------------------------------------------------------------
/VoiceChanger/jni/soundtouch/InterpolateShannon.cpp:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | ///
3 | /// Sample interpolation routine using 8-tap band-limited Shannon interpolation
4 | /// with kaiser window.
5 | ///
6 | /// Notice. This algorithm is remarkably much heavier than linear or cubic
7 | /// interpolation, and not remarkably better than cubic algorithm. Thus mostly
8 | /// for experimental purposes
9 | ///
10 | /// Author : Copyright (c) Olli Parviainen
11 | /// Author e-mail : oparviai 'at' iki.fi
12 | /// SoundTouch WWW: http://www.surina.net/soundtouch
13 | ///
14 | ////////////////////////////////////////////////////////////////////////////////
15 | //
16 | // $Id: InterpolateShannon.cpp 195 2014-04-06 15:57:21Z oparviai $
17 | //
18 | ////////////////////////////////////////////////////////////////////////////////
19 | //
20 | // License :
21 | //
22 | // SoundTouch audio processing library
23 | // Copyright (c) Olli Parviainen
24 | //
25 | // This library is free software; you can redistribute it and/or
26 | // modify it under the terms of the GNU Lesser General Public
27 | // License as published by the Free Software Foundation; either
28 | // version 2.1 of the License, or (at your option) any later version.
29 | //
30 | // This library is distributed in the hope that it will be useful,
31 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
32 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
33 | // Lesser General Public License for more details.
34 | //
35 | // You should have received a copy of the GNU Lesser General Public
36 | // License along with this library; if not, write to the Free Software
37 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
38 | //
39 | ////////////////////////////////////////////////////////////////////////////////
40 |
41 | #include
42 | #include "InterpolateShannon.h"
43 | #include "../soundtouch/include/STTypes.h"
44 |
45 | using namespace soundtouch;
46 |
47 |
48 | /// Kaiser window with beta = 2.0
49 | /// Values scaled down by 5% to avoid overflows
50 | static const double _kaiser8[8] =
51 | {
52 | 0.41778693317814,
53 | 0.64888025049173,
54 | 0.83508562409944,
55 | 0.93887857733412,
56 | 0.93887857733412,
57 | 0.83508562409944,
58 | 0.64888025049173,
59 | 0.41778693317814
60 | };
61 |
62 |
63 | InterpolateShannon::InterpolateShannon()
64 | {
65 | fract = 0;
66 | }
67 |
68 |
69 | void InterpolateShannon::resetRegisters()
70 | {
71 | fract = 0;
72 | }
73 |
74 |
75 | #define PI 3.1415926536
76 | #define sinc(x) (sin(PI * (x)) / (PI * (x)))
77 |
78 | /// Transpose mono audio. Returns number of produced output samples, and
79 | /// updates "srcSamples" to amount of consumed source samples
80 | int InterpolateShannon::transposeMono(SAMPLETYPE *pdest,
81 | const SAMPLETYPE *psrc,
82 | int &srcSamples)
83 | {
84 | int i;
85 | int srcSampleEnd = srcSamples - 8;
86 | int srcCount = 0;
87 |
88 | i = 0;
89 | while (srcCount < srcSampleEnd)
90 | {
91 | double out;
92 | assert(fract < 1.0);
93 |
94 | out = psrc[0] * sinc(-3.0 - fract) * _kaiser8[0];
95 | out += psrc[1] * sinc(-2.0 - fract) * _kaiser8[1];
96 | out += psrc[2] * sinc(-1.0 - fract) * _kaiser8[2];
97 | if (fract < 1e-6)
98 | {
99 | out += psrc[3] * _kaiser8[3]; // sinc(0) = 1
100 | }
101 | else
102 | {
103 | out += psrc[3] * sinc(- fract) * _kaiser8[3];
104 | }
105 | out += psrc[4] * sinc( 1.0 - fract) * _kaiser8[4];
106 | out += psrc[5] * sinc( 2.0 - fract) * _kaiser8[5];
107 | out += psrc[6] * sinc( 3.0 - fract) * _kaiser8[6];
108 | out += psrc[7] * sinc( 4.0 - fract) * _kaiser8[7];
109 |
110 | pdest[i] = (SAMPLETYPE)out;
111 | i ++;
112 |
113 | // update position fraction
114 | fract += rate;
115 | // update whole positions
116 | int whole = (int)fract;
117 | fract -= whole;
118 | psrc += whole;
119 | srcCount += whole;
120 | }
121 | srcSamples = srcCount;
122 | return i;
123 | }
124 |
125 |
126 | /// Transpose stereo audio. Returns number of produced output samples, and
127 | /// updates "srcSamples" to amount of consumed source samples
128 | int InterpolateShannon::transposeStereo(SAMPLETYPE *pdest,
129 | const SAMPLETYPE *psrc,
130 | int &srcSamples)
131 | {
132 | int i;
133 | int srcSampleEnd = srcSamples - 8;
134 | int srcCount = 0;
135 |
136 | i = 0;
137 | while (srcCount < srcSampleEnd)
138 | {
139 | double out0, out1, w;
140 | assert(fract < 1.0);
141 |
142 | w = sinc(-3.0 - fract) * _kaiser8[0];
143 | out0 = psrc[0] * w; out1 = psrc[1] * w;
144 | w = sinc(-2.0 - fract) * _kaiser8[1];
145 | out0 += psrc[2] * w; out1 += psrc[3] * w;
146 | w = sinc(-1.0 - fract) * _kaiser8[2];
147 | out0 += psrc[4] * w; out1 += psrc[5] * w;
148 | w = _kaiser8[3] * ((fract < 1e-5) ? 1.0 : sinc(- fract)); // sinc(0) = 1
149 | out0 += psrc[6] * w; out1 += psrc[7] * w;
150 | w = sinc( 1.0 - fract) * _kaiser8[4];
151 | out0 += psrc[8] * w; out1 += psrc[9] * w;
152 | w = sinc( 2.0 - fract) * _kaiser8[5];
153 | out0 += psrc[10] * w; out1 += psrc[11] * w;
154 | w = sinc( 3.0 - fract) * _kaiser8[6];
155 | out0 += psrc[12] * w; out1 += psrc[13] * w;
156 | w = sinc( 4.0 - fract) * _kaiser8[7];
157 | out0 += psrc[14] * w; out1 += psrc[15] * w;
158 |
159 | pdest[2*i] = (SAMPLETYPE)out0;
160 | pdest[2*i+1] = (SAMPLETYPE)out1;
161 | i ++;
162 |
163 | // update position fraction
164 | fract += rate;
165 | // update whole positions
166 | int whole = (int)fract;
167 | fract -= whole;
168 | psrc += 2*whole;
169 | srcCount += whole;
170 | }
171 | srcSamples = srcCount;
172 | return i;
173 | }
174 |
175 |
176 | /// Transpose stereo audio. Returns number of produced output samples, and
177 | /// updates "srcSamples" to amount of consumed source samples
178 | int InterpolateShannon::transposeMulti(SAMPLETYPE *pdest,
179 | const SAMPLETYPE *psrc,
180 | int &srcSamples)
181 | {
182 | // not implemented
183 | assert(false);
184 | return 0;
185 | }
186 |
--------------------------------------------------------------------------------