|
| 1 | +#!/usr/bin/env python |
1 | 2 | # Credits!!! |
2 | | -# Google Bard - Help |
3 | | -# OpenAI ChatGPT - Help |
4 | | -# Microsoft Bing AI Chat Copilot - Help |
5 | 3 | # (YT) Clear Code - Particle System |
6 | 4 | # jay3332 - Number Abbreviation |
7 | 5 | # Cryptogrounds / Considera Core |
|
20 | 18 | import json |
21 | 19 | import csv |
22 | 20 | import asyncio |
| 21 | +import pydub |
| 22 | +from pydub import AudioSegment |
23 | 23 | #pynanosvg |
| 24 | +import ffmpeg |
| 25 | +#from ffprobe import FFProbe |
| 26 | +sys.path.append('./frameworks/ffmpeg') |
| 27 | +sys.path.append('./frameworks/ffprobe') |
24 | 28 |
|
25 | 29 | GameFPS = 60 |
26 | 30 |
|
@@ -522,6 +526,7 @@ def constrain(val, min_val, max_val): |
522 | 526 | pygamemixermusic = 1 |
523 | 527 | musicfilepath = "" |
524 | 528 | musicintrofilepath = "" |
| 529 | +pymusictype = "" |
525 | 530 | def PlayMusic(musNum): |
526 | 531 | pygame.mixer.music.stop() |
527 | 532 | global pygamemixermusic, musicfilepath, musicintrofilepath |
@@ -550,15 +555,17 @@ def PlayMusic(musNum): |
550 | 555 | pygamemixermusic = .9 |
551 | 556 | pymusictype = "mp3" |
552 | 557 | musicfilepath = "./assets/audio/(radzlan - Miami Hotline Vol.3 (feat. Demonicity)) 673473_-Miami-Hotline--Vol3.mp3" |
553 | | - musicintrofilepath = "./assets/audio/nosound.wav" |
| 558 | + musicintrofilepath = "./assets/audio/nosound.mp3" |
554 | 559 | elif musNum == 6: |
555 | 560 | pygamemixermusic = .9 |
556 | 561 | pymusictype = "wav" |
557 | 562 | musicfilepath = "./assets/audio/INOSSI - Got you-loop.wav" |
558 | 563 | musicintrofilepath = "./assets/audio/INOSSI - Got you-start.wav" |
559 | | - pygame.mixer.music.load(musicintrofilepath) |
560 | | - pygame.mixer.music.set_volume(Decimal(pygamemixermusic)) |
561 | | - pygame.mixer.music.play() |
| 564 | + musicintro = AudioSegment.from_file(musicintrofilepath, format=pymusictype) |
| 565 | + musicintro = AudioSegment.from_file(musicintrofilepath, format=musicintrofilepath[-3:]) |
| 566 | + #pygame.mixer.music.load(musicintrofilepath) |
| 567 | + #pygame.mixer.music.set_volume(Decimal(pygamemixermusic)) |
| 568 | + #pygame.mixer.music.play() |
562 | 569 |
|
563 | 570 | PlayMusic(random.randint(1,6)) |
564 | 571 | pygame.mixer.music.set_volume(Decimal(pygamemixermusic) * (Settings[1]["value"] / 100)) |
|
0 commit comments