fix import
This commit is contained in:
parent
a3b9948b6d
commit
e079f948bc
@ -96,7 +96,7 @@ python3 -m venv venv
|
|||||||
venv/bin/pip install wheel
|
venv/bin/pip install wheel
|
||||||
venv/bin/pip install -r requirements.txt
|
venv/bin/pip install -r requirements.txt
|
||||||
(cd web && npm install && npm run build)
|
(cd web && npm install && npm run build)
|
||||||
./scripts/translate_templates.py --lang-dir lang/ --template-dir templates/
|
venv/bin/python3 ./scripts/translate_templates.py --lang-dir lang/ --template-dir templates/
|
||||||
```
|
```
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
@ -24,10 +24,10 @@ from packaging import version
|
|||||||
import util
|
import util
|
||||||
import command
|
import command
|
||||||
import constants
|
import constants
|
||||||
|
import media.playlist
|
||||||
from constants import tr_cli as tr
|
from constants import tr_cli as tr
|
||||||
from database import SettingsDatabase, MusicDatabase, DatabaseMigration
|
from database import SettingsDatabase, MusicDatabase, DatabaseMigration
|
||||||
from media.item import ValidationFailedError, PreparationFailedError
|
from media.item import ValidationFailedError, PreparationFailedError
|
||||||
from media.playlist import BasePlaylist
|
|
||||||
from media.cache import MusicCache
|
from media.cache import MusicCache
|
||||||
|
|
||||||
|
|
||||||
@ -385,7 +385,7 @@ class MumbleBot:
|
|||||||
ffmpeg_debug = "warning"
|
ffmpeg_debug = "warning"
|
||||||
|
|
||||||
channels = 2 if self.stereo else 1
|
channels = 2 if self.stereo else 1
|
||||||
self.pcm_buffer_size = 960*channels
|
self.pcm_buffer_size = 960 * channels
|
||||||
|
|
||||||
command = ("ffmpeg", '-v', ffmpeg_debug, '-nostdin', '-i',
|
command = ("ffmpeg", '-v', ffmpeg_debug, '-nostdin', '-i',
|
||||||
uri, '-ss', f"{start_from:f}", '-ac', str(channels), '-f', 's16le', '-ar', '48000', '-')
|
uri, '-ss', f"{start_from:f}", '-ac', str(channels), '-f', 's16le', '-ar', '48000', '-')
|
||||||
@ -615,7 +615,7 @@ class MumbleBot:
|
|||||||
pcm_data = bytearray(_pcm_data)
|
pcm_data = bytearray(_pcm_data)
|
||||||
if stereo:
|
if stereo:
|
||||||
if not fadein:
|
if not fadein:
|
||||||
mask = [math.exp(-x/60) for x in range(0, int(len(pcm_data) / 4))]
|
mask = [math.exp(-x / 60) for x in range(0, int(len(pcm_data) / 4))]
|
||||||
else:
|
else:
|
||||||
mask = [math.exp(-x / 60) for x in reversed(range(0, int(len(pcm_data) / 4)))]
|
mask = [math.exp(-x / 60) for x in reversed(range(0, int(len(pcm_data) / 4)))]
|
||||||
|
|
||||||
@ -625,7 +625,7 @@ class MumbleBot:
|
|||||||
pcm_data[4 * i + 2:4 * i + 4] = struct.pack("<h", round(
|
pcm_data[4 * i + 2:4 * i + 4] = struct.pack("<h", round(
|
||||||
struct.unpack("<h", pcm_data[4 * i + 2:4 * i + 4])[0] * mask[i]))
|
struct.unpack("<h", pcm_data[4 * i + 2:4 * i + 4])[0] * mask[i]))
|
||||||
else:
|
else:
|
||||||
mask = [math.exp(-x/60) for x in range(0, int(len(pcm_data) / 2))]
|
mask = [math.exp(-x / 60) for x in range(0, int(len(pcm_data) / 2))]
|
||||||
for i in range(int(len(pcm_data) / 2)):
|
for i in range(int(len(pcm_data) / 2)):
|
||||||
pcm_data[2 * i:2 * i + 2] = struct.pack("<h",
|
pcm_data[2 * i:2 * i + 2] = struct.pack("<h",
|
||||||
round(struct.unpack("<h", pcm_data[2 * i:2 * i + 2])[0] * mask[i]))
|
round(struct.unpack("<h", pcm_data[2 * i:2 * i + 2])[0] * mask[i]))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user