Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Quentin Aristote
Soundscapes
Commits
18dc24b5
Commit
18dc24b5
authored
Dec 27, 2019
by
Quentin Aristote
Browse files
first generations
parent
e1fe89d1
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
18dc24b5
...
...
@@ -52,6 +52,38 @@ flycheck_*.el
/network-security.data
### Git ###
# Created by git for backups. To disable backups in Git:
# $ git config --global mergetool.keepBackup false
*.orig
# Created by git when using merge tools for conflicts
*.BACKUP.*
*.BASE.*
*.LOCAL.*
*.REMOTE.*
*_BACKUP_*.txt
*_BASE_*.txt
*_LOCAL_*.txt
*_REMOTE_*.txt
# machine-specific gitignore file
.gitignore
### JupyterNotebooks ###
# gitignore template for Jupyter Notebooks
# website: http://jupyter.org/
.ipynb_checkpoints
*/.ipynb_checkpoints/*
# IPython
profile_default/
ipython_config.py
# Remove previous ipynb_checkpoints
# git rm -r .ipynb_checkpoints/
### Linux ###
# temporary files which can be created if a process still has a handle open of a deleted file
...
...
@@ -189,7 +221,4 @@ env.bak/
venv.bak/
pip-selfcheck.json
# End of https://www.gitignore.io/api/linux,python,virtualenv,emacs
# Project-specific
results
\ No newline at end of file
# End of https://www.gitignore.io/api/linux,python,virtualenv,emacs
\ No newline at end of file
ae.ipynb
View file @
18dc24b5
This diff is collapsed.
Click to expand it.
data/
requirements.txt
→
requirements.txt
View file @
18dc24b5
bs4
torch
torchaudio
librosa
results/spectrogram_to_sound.ipynb
0 → 100644
View file @
18dc24b5
{
"cells": [
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"autoscroll": false,
"collapsed": false,
"ein.hycell": false,
"ein.tags": "worksheet-0",
"slideshow": {
"slide_type": "-"
}
},
"outputs": [],
"source": [
"import librosa\n",
"import numpy as np"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {
"autoscroll": false,
"collapsed": false,
"ein.hycell": false,
"ein.tags": "worksheet-0",
"slideshow": {
"slide_type": "-"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(128, 2400)\n"
]
}
],
"source": [
"spectrogram = np.load('test3.npy')[0]\n",
"print(spectrogram.shape)\n",
"audio = librosa.feature.inverse.mel_to_audio(spectrogram, sr = 16000, n_fft = 400, hop_length = 200, win_length = 400)\n",
"librosa.output.write_wav('test3.wav', audio, 16000)"
]
}
],
"metadata": {
"kernelspec": {
"argv": [
"/usr/bin/python3",
"-m",
"ipykernel_launcher",
"-f",
"{connection_file}"
],
"display_name": "Python 3",
"env": null,
"interrupt_mode": "signal",
"language": "python",
"metadata": null,
"name": "python3"
},
"name": "spectrogram_to_sound.ipynb"
},
"nbformat": 4,
"nbformat_minor": 2
}
%% Cell type:code id: tags:
```
python
import
librosa
import
numpy
as
np
```
%% Cell type:code id: tags:
```
python
spectrogram
=
np
.
load
(
'test3.npy'
)[
0
]
print
(
spectrogram
.
shape
)
audio
=
librosa
.
feature
.
inverse
.
mel_to_audio
(
spectrogram
,
sr
=
16000
,
n_fft
=
400
,
hop_length
=
200
,
win_length
=
400
)
librosa
.
output
.
write_wav
(
'test3.wav'
,
audio
,
16000
)
```
%%%% Output: stream
(128, 2400)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment