Skip to content

Commit

Permalink
Merge pull request #8 from jason-kane/beta
Browse files Browse the repository at this point in the history
Beta
  • Loading branch information
jason-kane authored Jun 1, 2024
2 parents 01d50f4 + 3889cf3 commit af832ab
Show file tree
Hide file tree
Showing 15 changed files with 2,208 additions and 1,225 deletions.
40 changes: 20 additions & 20 deletions aliases.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
{
"PsychicClockwork": "Clockwork",
"5thColumn": "Random Any",
"5thColumnEndgame": "Random Any",
"ArachnosEndgame": "Arachnos",
"TsooEndgame": "Random Any",
"BanishedPantheon": "Random Any",
"Behavioral Adjustees": "Random Any",
"CircleOfThorns": "Circle of Thorns",
"Civilian": "Random Any",
"Council Member": "Random Any",
"Council": "Random Any",
"Crey": "Random Any",
"DecayingEidolons": "Vahzilok",
"Outcasts": "Random Any",
"Warriors": "Random Any",
"TheDestroyers": "Random Any",
"Freakshow": "Random Any",
"Tsoo": "Random Any",
"Council": "Random Any",
"The Lost": "Random Any",
"Civilian": "Random Any",
"5thColumn": "Random Any",
"Hellions": "Random Any",
"5thColumnEndgame": "Random Any",
"Council Member": "Random Any",
"TheFamily": "Random Any",
"Hero": "Random Any",
"MAGI": "Random Any",
"Nemesis": "Random Any",
"BanishedPantheon": "Random Any",
"Outcasts": "Random Any",
"ParagonPolice": "Random Any",
"Prisoners": "Random Any",
"Behavioral Adjustees": "Random Any",
"Crey": "Random Any",
"Hero": "Random Any",
"PracticeRobots": "Random Any",
"PraetorianDUSTIDFEndgame": "Random Any",
"MAGI": "Random Any",
"PracticeRobots": "Random Any"
"Prisoners": "Random Any",
"PsychicClockwork": "Clockwork",
"The Lost": "Random Any",
"TheDestroyers": "Random Any",
"TheFamily": "Random Any",
"Tsoo": "Random Any",
"TsooEndgame": "Random Any",
"Warriors": "Random Any"
}
1 change: 1 addition & 0 deletions dirty.bat
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
rmdir /s /q venv
rename venv_backup venv
100 changes: 32 additions & 68 deletions presets.json
Original file line number Diff line number Diff line change
@@ -1,96 +1,60 @@
{
"Random Any": {
"engine": "any",
"BaseTTSConfig": {
"voice_name": [
"random",
"any"
],
"rate": "1"
}
},
"Random Any": {},
"Random Female": {
"engine": "any",
"BaseTTSConfig": {
"voice_name": [
"random",
"female"
],
"rate": "1"
}
"gender": "Female"
},
"Random Male": {
"engine": "any",
"BaseTTSConfig": {
"voice_name": [
"random",
"male"
],
"rate": "1"
}
"gender": "Male"
},
"Clockwork": {
"engine": "any",
"BaseTTSConfig": {
"voice_name": [
"random",
"any"
],
"rate": "1"
},
"Effects": {
"Vocoder": {
"carrier_freq": "160",
"min_freq": "80",
"max_freq": "8000",
"Effects": [
{
"name": "Vocoder",
"carrier_freq": "100",
"min_freq": "135",
"max_freq": "6100",
"bands": "40",
"bandwidth": "0.5",
"bandpass_filter_order": "3"
},
"RingMod": {
"carrier_freq": "160",
"blend": "0.5",
}, {
"name": "RingMod",
"carrier_freq": "86",
"blend": "0.3",
"carrier_wave": "sin"
},
"Normalize": {
}, {
"name": "Normalize",
"max_amplitude": "1.0",
"remove_dc_offset": true
}
}
]
},
"Vahzilok": {
"engine": "any",
"BaseTTSConfig": {
"voice_name": [
"random",
"any"
],
"rate": "2"
},
"Effects": {
"Chorus": {
"Effects": [
{
"name": "Chorus",
"rate_hz": "10.0",
"mix": "0.5",
"depth": "0.25",
"feedback": "0.0"
}
}
]
},
"Circle of Thorns": {
"engine": "any",
"BaseTTSConfig": {
"voice_name": [
"random",
"any"
],
"rate": "1.25"
},
"Effects": {
"Delay": {
"Effects": [
{
"name": "Delay",
"delay_seconds": "0.1",
"feedback": "0.1",
"mix": "0.1"
}
}
]
},
"Trolls": {
"Effects": [
{
"name": "PitchShift",
"semitones": "-3.0"
}
]
}
}
19 changes: 11 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ altgraph==0.17.4
annotated-types==0.6.0
anyio==4.3.0
asttokens==2.4.1
boto3==1.34.103
build==1.2.1
cachetools==5.3.3
certifi==2024.2.2
Expand All @@ -23,8 +24,8 @@ google-auth==2.29.0
google-cloud-texttospeech==2.16.3
googleapis-common-protos==1.63.0
greenlet==3.0.3
grpcio==1.62.1
grpcio-status==1.62.1
grpcio==1.62.1
h11==0.14.0
httpcore==1.0.5
httpx==0.27.0
Expand All @@ -41,11 +42,12 @@ kiwisolver==1.4.5
Mako==1.3.2
markdown-it-py==3.0.0
MarkupSafe==2.1.5
matplotlib==3.8.4
matplotlib-inline==0.1.7
matplotlib==3.8.4
mdurl==0.1.2
more-itertools==10.2.0
mp3play==0.1.15
mypy-boto3-polly==1.34.101
nh3==0.2.17
nltk==3.8.1
numpy==1.26.4
Expand All @@ -60,24 +62,25 @@ prompt-toolkit==3.0.43
proto-plus==1.23.0
protobuf==4.25.3
pure-eval==0.2.2
pyasn1==0.5.1
pyasn1-modules==0.3.0
pyasn1==0.5.1
pycparser==2.21
pydantic==2.7.0
pydantic_core==2.18.1
pydantic==2.7.0
pydub==0.25.1
pyfiglet==1.0.2
Pygments==2.17.2
pyinstaller-hooks-contrib==2024.3
pyparsing==3.1.2
pypiwin32==223
pyproject_hooks==1.0.0
python-dateutil==2.9.0.post0
pywin32==306
pywin32-ctypes==0.2.2
pywin32==306
readme_renderer==43.0
regex==2023.12.25
requests==2.31.0
requests-toolbelt==1.0.0
requests==2.31.0
rfc3986==2.0.0
rich==13.7.1
rsa==4.9
Expand All @@ -86,8 +89,8 @@ setuptools==69.2.0
six==1.16.0
sniffio==1.3.1
sounddevice==0.4.6
SQLAlchemy==2.0.29
SQLAlchemy-Utils==0.41.2
SQLAlchemy==2.0.29
stack-data==0.6.3
tqdm==4.66.2
traitlets==5.14.3
Expand All @@ -98,4 +101,4 @@ urllib3==2.2.1
voicebox-tts==0.0.7
wcwidth==0.2.13
websockets==12.0
zipp==3.18.1
zipp==3.18.1
42 changes: 42 additions & 0 deletions src/coh_npc_voices/audio.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
"""
These are high level manipulations of audio files.
"""
from pedalboard.io import AudioFile
from voicebox.tts.utils import get_audio_from_wav_file
import logging

log = logging.getLogger(__name__)


def mp3file_to_wavfile(mp3filename, wavfilename=None):
"""
Pedelboard can convert mp3 to wav pretty quickly/easily.
This is more or less straight from the README.md for pedalboard.
Spotify - Props for pedalboard open source.
"""
log.info('Converting from mp3 to wav...')
if wavfilename is None:
wavfilename = mp3filename + ".wav"

with AudioFile(mp3filename) as input:
with AudioFile(
filename=wavfilename,
samplerate=input.samplerate,
num_channels=input.num_channels
) as output:
while input.tell() < input.frames:
output.write(input.read(1024))
log.info(f'Wrote {wavfilename}')

return wavfilename


def mp3file_to_Audio(mp3filename):
"""
We want this mp3 as a voicebox Voice() object.
"""
wavfilename = mp3file_to_wavfile(mp3filename)
return get_audio_from_wav_file(
wavfilename
)
3 changes: 2 additions & 1 deletion src/coh_npc_voices/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
handlers=[logging.StreamHandler(sys.stdout)],
)

log = logging.getLogger("__name__")
log = logging.getLogger(__name__)

def build_migrate():
# it really doesn't exist.
Expand All @@ -32,6 +32,7 @@ def build_migrate():
default = models.Character(
name="default",
engine="Windows TTS",
engine_secondary="Windows TTS",
category=3
)
session.add(default)
Expand Down
Loading

0 comments on commit af832ab

Please sign in to comment.