2024.05.20 05:44 Flashy_Ad1403 Fix game music bass levels(remove them) with Python and Chatgpt
pip install pydub scipyI put my ffmpeg binaries in a folder then added them to PATH. If you don't want to do this, you can just put the FFMPEG binaries in a folder and then tell chatgpt to modify the script to point to those specific files so you can use them. If you have an error you can just copy the whole error into chatgpt and it will fix it.
import os from pydub import AudioSegment from scipy.signal import butter, lfilter import numpy as np # High-pass filter function def butter_highpass(cutoff, fs, order=5): nyq = 0.5 * fs normal_cutoff = cutoff / nyq b, a = butter(order, normal_cutoff, btype='high', analog=False) return b, a def highpass_filter(data, cutoff, fs, order=5): b, a = butter_highpass(cutoff, fs, order=order) y = lfilter(b, a, data) return y # Function to process a file def process_file(input_path, output_path, cutoff=250, sample_rate=48000): # Load the audio file audio = AudioSegment.from_file(input_path, format="mp3") # Convert to numpy array samples = np.array(audio.get_array_of_samples()) # Apply high-pass filter filtered_samples = highpass_filter(samples, cutoff, sample_rate) # Create new audio segment filtered_audio = audio._spawn(filtered_samples.astype(np.int16).tobytes()) # Export the filtered audio filtered_audio.export(output_path, format="mp3") # Function to process all files in a directory def process_directory(input_dir, output_dir, cutoff=250, sample_rate=48000): if not os.path.exists(output_dir): os.makedirs(output_dir) for filename in os.listdir(input_dir): if filename.endswith(".mp3"): input_path = os.path.join(input_dir, filename) output_path = os.path.join(output_dir, filename) process_file(input_path, output_path, cutoff, sample_rate) # Example usage root_directory = os.path.dirname(os.path.abspath(__file__)) input_directory = os.path.join(root_directory, "_Soundtrack") output_directory = os.path.join(root_directory, "_Soundtrack_Filtered") process_directory(input_directory, output_directory)a
@echo off setlocal REM Directories set "ROOT_DIR=%~dp0" set "ORIGINAL_DIR=%ROOT_DIR%_Soundtrack" set "FILTERED_DIR=%ROOT_DIR%_Soundtrack_Filtered" set "CURRENT_DIR=%ROOT_DIR%_Soundtrack_Current" REM Check current state if exist "%CURRENT_DIR%\filtered" ( REM Switch to original echo Switching to original music... xcopy "%ORIGINAL_DIR%\*" "%CURRENT_DIR%\" /Y del "%CURRENT_DIR%\filtered" ) else ( REM Switch to filtered echo Switching to filtered music... xcopy "%FILTERED_DIR%\*" "%CURRENT_DIR%\" /Y echo.>"%CURRENT_DIR%\filtered" ) echo Done. endlocal pause
2024.05.20 04:36 Active-State9734 I need help with my game
submitted by Active-State9734 to robloxgamedev [link] [comments]
2024.05.20 04:33 bndh Shader Strange Playtest Behaviour
Hello! submitted by bndh to godot [link] [comments] I'm relatively new to Godot and was playing around with vertex shaders for some procedural generation, however have been having quite a headache with mapping said texture to my mesh. I currently have a very barren test where I add a vec2(0.0, 0.1) to the sampling location of the mesh. In the editor, this behaves as I would expect, offsetting the environment by 2m (the mesh is 20x20), but if I try the same while playing the scene, the offset is much, much greater The scene in-editor, with the shader code The scene in playtest uniform vec3 mesh_dimensions = vec3(2, 0, 2); uniform sampler2D heightmap : filter_linear, repeat_disable; uniform vec2 uv_offset = vec2(0, 0); // Not currently used uniform float height = 5.0; void vertex() { vec2 vertex_uvs = VERTEX.xz / mesh_dimensions.xz + vec2(0.5); // 0 <-> 1. Vertex local coordinates were given in relation to the centre pivot of the mesh, therefore we add 0.5 to normalise them 0 <-> 1 vec2 texture_position = vertex_uvs + vec2(0.0, 0.1); VERTEX.y += texture(heightmap, texture_position).r * height;} void fragment() { ALBEDO = texture(heightmap, UV.xy).rrr;} ^ The shader (Sorry for poor formatting, I am not super familiar with Reddit) I've been stuck on this (and similar) scrolling problems for a few days now, so I would really, really appreciate any advice or answers. Thank you! |
2024.05.20 04:14 DoubleSidedTape_ Flashlight issues
2024.05.20 03:28 xiaohanyu Improve website performance by reducing latency of downloading css/js/image/font assets to (almost) zero, with service worker
As title, I am not sure how many are aware of this trick to optimize website performance, so just share some learnings here. submitted by xiaohanyu to webdev [link] [comments] Recently I am upgrading a website to PWA, with Service Worker API - Web APIs MDN (mozilla.org). By adopting proper library and cache strategy, service worker can reduce the network latency and bandwidth cost drastically, which would lead to a performance boost. For my case, share a devtools screenshot: Without service worker and cache: Website load without service worker and cache With service worker and cache: Website load with service worker and cache As you can see, with service worker and cache, the latency of css/js load time reduced from serveral hundreds to several ms, which is 100x improvement. Although browsers often tries to load assets parallelly, this still helps a lot, with additional benefits:
Hope this helps! |
2024.05.20 03:22 Reasonable_Pass_3874 I cannot Edit scenes in the quests
https://preview.redd.it/s3lg0btfgh1d1.png?width=1920&format=png&auto=webp&s=e3fe910c69677380f7d996451d999fc167d9511f submitted by Reasonable_Pass_3874 to CreationKit [link] [comments] I highlight the scene and go to right click in the white canvas but nothing happens... i cannot place a new actor. I even got the CK platform Extension add on to fix bugs but this is still an issue! I Am just trying to make simple quests and character dialogue. Does anyone know how to fix this issue? thanks -T |
2024.05.20 00:43 Impressive_Tart_8363 [1 YOE] Current Software Engineer looking to get a position in a major city
Hi, I currently have about 1 YOE and even though I am very thankful to even have a job in this current market, I desperately want to move to a major city in the usa. I've been applying for a little bit ~300, and have gotten only 2 interviews. Any advice would be very appreciated. Thank you. submitted by Impressive_Tart_8363 to EngineeringResumes [link] [comments] https://preview.redd.it/5oodztikog1d1.jpg?width=9180&format=pjpg&auto=webp&s=0531d4825f1acecb0b5c0641477e7c833d6e91a6 |
2024.05.19 23:59 Julongs help create a sieve filter
2024.05.19 23:46 asterythm All UI elements rendered uninteractible on export
Struggling with an issue in which, upon export, any UI elements that use the BaseButton class are either rendered static and uninteractible, or -- for those that are dynamically created at runtime with a script -- don't appear at all. Beyond regular buttons, the issue also extends to sliders, ChoiceButtons, and TextureButtons. submitted by asterythm to godot [link] [comments] The problem only happens when I export a build; they all run and work fine in the editor. They also still work fine on the main scene, but nowhere else. I've tried changing the mouse filters on parent nodes to make sure the mouse is able to pass through, and no dice; I've also tried setting a different scene as the "main" to see if it's somehow the switching scenes that is breaking the buttons, but that didn't work either -- the buttons are still broken even if we start in the scene. This was for a game jam with a team of absolute beginners, and try as we might, we cannot find a thing online that would even give us a hint as to where to look for a starting place on how to fix this! We put a lot of heart into making our first-ever game and would beyond appreciate guidance to make sure we're still able to get our submission in. Screenshots attached. Run in editor: https://preview.redd.it/gykyosdseg1d1.png?width=2848&format=png&auto=webp&s=46a8ce1d2dbea11852cbb7e547b64ad3235fd4d0 https://preview.redd.it/m13qazucfg1d1.png?width=2848&format=png&auto=webp&s=122b3e6f093e1e9ef793ef6875d50e4ca4e8dd57 Each word here is a toggle button, dynamically created with script from a txt file at runtime. Run in build: https://preview.redd.it/4lu1a42ofg1d1.png?width=2848&format=png&auto=webp&s=08104615b5b990c2f240f35c2a346d7ed76c31a7 Dynamically-created buttons don't appear. Though I couldn't get the mouse in the picture for an options screenshot, it looks the same but none of the buttons can be interacted with. |
2024.05.19 23:11 Ok-Breakfast-990 Resources for learning to write C++ programs
2024.05.19 22:33 tempmailgenerator Fetching Unread Emails Using the Gmail API in Python
Command/Function | Description |
---|---|
build() | Constructs a Resource object for interacting with an API. |
users().messages().list() | Lists all messages in the user's mailbox. |
users().messages().get() | Gets a specific message. |
labelIds | Specifies the labels to filter the messages by. |
from googleapiclient.discovery import build from oauth2client.service_account import ServiceAccountCredentials SCOPES = ['https://www.googleapis.com/auth/gmail.readonly'] credentials = ServiceAccountCredentials.from_json_keyfile_name('credentials.json', SCOPES) service = build('gmail', 'v1', credentials=credentials) results = service.users().messages().list(userId='me', labelIds=['UNREAD'], maxResults=1).execute() messages = results.get('messages', []) if not messages: print('No unread messages.') else: for message in messages: msg = service.users().messages().get(userId='me', id=message['id']).execute() print('Message Snippet: ', msg['snippet'])
2024.05.19 22:24 Good-Wrongdoer-3581 Filter tab
Hey guys stupid quest how do I remove the filter tab on the left hand side it just randomly came up submitted by Good-Wrongdoer-3581 to ModOrganizer [link] [comments] |
2024.05.19 21:24 Confused8634 JavaScript "filtering" vs Network Filtering
! Network - offline service worker youtube.com/sw.js$script,domain=youtube.com www.youtube.com##+js(set, yt.config_.EXPERIMENT_FLAGS.service_worker_enabled, false)To my understanding, they accomplish the same thing.
2024.05.19 20:06 Quick_Work_7491 How do I fix the parsing error when I try to import a .DAE file? (I tried 3 times, which is why there's 3 errors.)
submitted by Quick_Work_7491 to blenderhelp [link] [comments]
2024.05.19 19:47 Varoo_ need some security tips!
2024.05.19 18:58 Chaotic_Control-147 [0 YoE] ME Grad, Needs to land something within 2 months or I'm gone (VISA situation)
I would like some pointers to improve my bullet points and other problems you see. Targeting ME roles in any industry at this point. No internships during college, holding 5 months of project management experience and 1 month of SolidWorks as an ME intern (counting by dates and not entire month). I am on F-1 OPT and it seems next to impossible to find an employer that will sponsor at my degree and experience level. submitted by Chaotic_Control-147 to EngineeringResumes [link] [comments] Answering some expected questions from my resume.
EDIT: Added a question about first role. https://preview.redd.it/ybz1smiwye1d1.png?width=5100&format=png&auto=webp&s=404ec1016c9821264b264ba73884b34a4609fa7c |
2024.05.19 18:28 Background-Hunter-75 Do yall think of drag race in two eras? Pre season 7 and post season 7?
2024.05.19 17:51 Any_Kiwi_8574 Can't see the animation on RenderView
Hello, I have some NIKE logo animation, but the problem is, that logo won't appear at the render, anyone have an answer to such mystery? submitted by Any_Kiwi_8574 to Cinema4D [link] [comments] https://preview.redd.it/v5mjfzz3ne1d1.png?width=1919&format=png&auto=webp&s=5d2cf9457aa51e2f3f1292066a4f39d6ca96614b https://preview.redd.it/0woqszz3ne1d1.png?width=1920&format=png&auto=webp&s=8c228f0cfb0b8445675e87d13726a6e64c4d266b |
2024.05.19 16:51 EchoJobs Hiring Operations Program Manager, Code Quality USD 97k-116k Irving, TX [Machine Learning Java Matlab Python C++ Go HTML Shell C# SQL Ruby Rust PHP Dart JavaScript TypeScript Swift R]
submitted by EchoJobs to JavaScriptJob [link] [comments] |
2024.05.19 16:29 TyranoTitanic42 Obs studio not recording and showing black screen on pipewire capture
``` obs debug: Found portal inhibitor debug: Attempted path: share/obs/obs-studio/locale/en-US.ini debug: Attempted path: /usshare/obs/obs-studio/locale/en-US.ini debug: Attempted path: share/obs/obs-studio/locale.ini debug: Attempted path: /usshare/obs/obs-studio/locale.ini debug: Attempted path: share/obs/obs-studio/locale/en-GB.ini debug: Attempted path: /usshare/obs/obs-studio/locale/en-GB.ini info: Using preferred locale 'en-GB' debug: Attempted path: share/obs/obs-studio/themes debug: Attempted path: /usshare/obs/obs-studio/themes debug: Attempted path: share/obs/obs-studio/themes/Yami.qss debug: Attempted path: /usshare/obs/obs-studio/themes/Yami.qss info: Platform: Wayland info: CPU Name: AMD Ryzen 5 5500U with Radeon Graphics info: CPU Speed: 1397.311MHz info: Physical Cores: 6, Logical Cores: 12 info: Physical Memory: 15317MB Total, 1947MB Free info: Kernel Version: Linux 6.7.12-amd64 info: Distribution: "Debian GNU/Linux" Unknown info: Desktop Environment: KDE (KDE) info: Session Type: wayland info: Qt Version: 6.4.2 (runtime), 6.4.2 (compiled) info: Portable mode: false info: OBS 30.1.2.1-1 (linux) info: --------------------------------- info: --------------------------------- info: audio settings reset: samples per sec: 48000 speakers: 2 max buffering: 960 milliseconds buffering type: dynamically increasing info: --------------------------------- info: Initializing OpenGL... info: Using EGL/Wayland info: Initialized EGL 1.5 info: Loading up OpenGL on adapter AMD AMD Radeon Graphics (radeonsi, renoir, LLVM 17.0.6, DRM 3.57, 6.7.12-amd64) info: OpenGL loaded successfully, version 4.6 (Core Profile) Mesa 24.0.6-1+b1, shading language 4.60 info: --------------------------------- info: video settings reset: base resolution: 1920x1080 output resolution: 1280x720 downscale filter: Bicubic fps: 30/1 format: NV12 YUV mode: Rec. 709/Partial info: NV12 texture support not available info: P010 texture support not available info: Audio monitoring device: name: Default id: default info: --------------------------------- warning: Failed to load 'en-US' text for module: 'decklink-captions.so' warning: Failed to load 'en-US' text for module: 'decklink-output-ui.so' libDeckLinkAPI.so: cannot open shared object file: No such file or directory warning: A DeckLink iterator could not be created. The DeckLink drivers may not be installed warning: Failed to initialize module 'decklink.so' info: [pipewire] Available captures: info: [pipewire] - Desktop capture info: [pipewire] - Window capture warning: v4l2loopback not installed, virtual camera disabled warning: LIBVA_DRIVER_NAME variable is set, this could prevent FFmpeg VAAPI from working correctly info: VAAPI: API version 1.20 info: FFmpeg VAAPI H264 encoding supported info: FFmpeg VAAPI AV1 encoding not supported info: FFmpeg VAAPI HEVC encoding supported info: [obs-websocket] [obs_module_load] you can haz websockets (Version: 5.4.2 RPC Version: 1) info: [obs-websocket] [obs_module_load] Qt version (compile-time): 6.4.2 Qt version (run-time): 6.4.2 info: [obs-websocket] [obs_module_load] Linked ASIO Version: 102801 info: [obs-websocket] [obs_module_load] Module loaded. info: [vlc-video]: VLC 3.0.20 Vetinari found, VLC video source enabled info: --------------------------------- info: Loaded Modules: info: vlc-video.so info: text-freetype2.so info: rtmp-services.so info: obs-x264.so info: obs-websocket.so info: obs-transitions.so info: obs-outputs.so info: obs-filters.so info: obs-ffmpeg.so info: linux-v4l2.so info: linux-pulseaudio.so info: linux-pipewire.so info: linux-jack.so info: linux-capture.so info: linux-alsa.so info: image-source.so info: frontend-tools.so info: decklink-output-ui.so info: decklink-captions.so info: --------------------------------- info: ==== Startup complete =============================================== info: All scene data cleared info: ------------------------------------------------ info: pulse-input: Server name: 'PulseAudio (on PipeWire 1.0.5) 15.0.0' info: pulse-input: Audio format: s32le, 48000 Hz, 2 channels info: pulse-input: Started recording from 'alsa_output.pci-0000_04_00.6.HiFi__hw_Generic_1__sink.monitor' (default) info: [Loaded global audio device]: 'Desktop Audio' info: pulse-input: Server name: 'PulseAudio (on PipeWire 1.0.5) 15.0.0' info: pulse-input: Audio format: s32le, 48000 Hz, 2 channels info: pulse-input: Started recording from 'alsa_input.pci-0000_04_00.6.HiFi__hw_acp__source' (default) info: [Loaded global audio device]: 'Mic/Aux' info: PipeWire initialized info: Switched to scene 'Scene' info: ------------------------------------------------ info: Loaded scenes: info: - scene 'Scene': info: - source: 'Screen Capture (PipeWire)' (pipewire-desktop-capture-source) info: ------------------------------------------------ info: [pipewire] Screencast session created info: [pipewire] Asking for desktop warning: [pipewire] Failed to start screencast, denied or cancelled by user info: adding 21 milliseconds of audio buffering, total audio buffering is now 21 milliseconds (source: Desktop Audi o) warning: [rtmp-services plugin] Remote update of URL "https://obsproject.com/obs2_update/rtmp-services/v5/package.j son" failed: info: PipeWire initialized info: [pipewire] Screencast session created info: [pipewire] Asking for desktop warning: [pipewire] Failed to start screencast, denied or cancelled by user info: PipeWire initialized info: [pipewire] Screencast session created info: [pipewire] Asking for desktop warning: [pipewire] Failed to start screencast, denied or cancelled by user info: ==== Shutting down ================================================== info: pulse-input: Stopped recording from 'alsa_output.pci-0000_04_00.6.HiFi__hw_Generic_1__sink.monitor' info: pulse-input: Got 1221 packets with 1465200 frames info: pulse-input: Stopped recording from 'alsa_input.pci-0000_04_00.6.HiFi__hw_acp__source' info: pulse-input: Got 1220 packets with 1464000 frames info: All scene data cleared info: ------------------------------------------------ info: [obs-websocket] [obs_module_unload] Shutting down... error: Tried to call obs_frontend_remove_event_callback with no callbacks! info: [obs-websocket] [obs_module_unload] Finished shutting down. info: [Scripting] Total detached callbacks: 0 info: Freeing OBS context data info: == Profiler Results ============================= info: run_program_init: 688.679 ms info: ┣OBSApp::AppInit: 4.944 ms info: ┃ ┗OBSApp::InitLocale: 0.901 ms info: ┗OBSApp::OBSInit: 650.323 ms info: ┣obs_startup: 2.632 ms info: ┗OBSBasic::OBSInit: 612.048 ms info: ┣OBSBasic::InitBasicConfig: 0.159 ms info: ┣OBSBasic::ResetAudio: 0.364 ms info: ┣OBSBasic::ResetVideo: 106.805 ms info: ┃ ┗obs_init_graphics: 103.059 ms info: ┃ ┗shader compilation: 31.469 ms info: ┣OBSBasic::InitOBSCallbacks: 0.008 ms info: ┣OBSBasic::InitHotkeys: 0.039 ms info: ┣obs_load_all_modules2: 411.631 ms info: ┃ ┣obs_init_module(decklink-captions.so): 0 ms info: ┃ ┣obs_init_module(decklink-output-ui.so): 0 ms info: ┃ ┣obs_init_module(decklink.so): 0.192 ms info: ┃ ┣obs_init_module(frontend-tools.so): 19.278 ms info: ┃ ┣obs_init_module(image-source.so): 0.012 ms info: ┃ ┣obs_init_module(linux-alsa.so): 0.003 ms info: ┃ ┣obs_init_module(linux-capture.so): 0.001 ms info: ┃ ┣obs_init_module(linux-jack.so): 0.005 ms info: ┃ ┣obs_init_module(linux-pipewire.so): 19.888 ms info: ┃ ┣obs_init_module(linux-pulseaudio.so): 0.006 ms info: ┃ ┣obs_init_module(linux-v4l2.so): 3.116 ms info: ┃ ┣obs_init_module(obs-ffmpeg.so): 29.419 ms info: ┃ ┃ ┗nvenc_check: 0.978 ms info: ┃ ┣obs_init_module(obs-filters.so): 0.028 ms info: ┃ ┣obs_init_module(obs-outputs.so): 0.005 ms info: ┃ ┣obs_init_module(obs-transitions.so): 0.019 ms info: ┃ ┣obs_init_module(obs-websocket.so): 4.634 ms info: ┃ ┣obs_init_module(obs-x264.so): 0.005 ms info: ┃ ┣obs_init_module(rtmp-services.so): 0.641 ms info: ┃ ┣obs_init_module(text-freetype2.so): 0.018 ms info: ┃ ┗obs_init_module(vlc-video.so): 2.247 ms info: ┣OBSBasic::InitService: 1.334 ms info: ┣OBSBasic::ResetOutputs: 0.232 ms info: ┣OBSBasic::CreateHotkeys: 0.029 ms info: ┣OBSBasic::InitPrimitives: 0.09 ms info: ┗OBSBasic::Load: 47.236 ms info: obs_hotkey_thread(25 ms): min=0 ms, median=0.001 ms, max=0.015 ms, 99th percentile=0.002 ms, 100% below 25 ms info: audio_thread(Audio): min=0.013 ms, median=0.047 ms, max=3.06 ms, 99th percentile=0.146 ms info: obs_graphics_thread(33.3333 ms): min=0.275 ms, median=0.982 ms, max=18.942 ms, 99th percentile=2.125 ms, 100% below 33.333 ms info: ┣tick_sources: min=0 ms, median=0.011 ms, max=0.336 ms, 99th percentile=0.036 ms info: ┣output_frame: min=0.141 ms, median=0.352 ms, max=4.685 ms, 99th percentile=0.896 ms info: ┃ ┗gs_context(video->graphics): min=0.141 ms, median=0.351 ms, max=4.679 ms, 99th percentile=0.894 ms info: ┃ ┣render_video: min=0.034 ms, median=0.059 ms, max=0.354 ms, 99th percentile=0.105 ms info: ┃ ┃ ┗render_main_texture: min=0.025 ms, median=0.051 ms, max=0.325 ms, 99th percentile=0.093 ms info: ┃ ┗gs_flush: min=0.003 ms, median=0.007 ms, max=0.084 ms, 99th percentile=0.026 ms info: ┗render_displays: min=0.005 ms, median=0.57 ms, max=18.484 ms, 99th percentile=1.528 ms info: ================================================= info: == Profiler Time Between Calls ================== info: obs_hotkey_thread(25 ms): min=25.045 ms, median=25.102 ms, max=28.376 ms, 99.0354% within ±2% of 25 ms (0% lo wer, 0.96463% higher) info: obs_graphics_thread(33.3333 ms): min=32.449 ms, median=33.333 ms, max=34.169 ms, 99.5717% within ±2% of 33.33 3 ms (0.321199% lower, 0.107066% higher) info: ================================================= info: Number of memory leaks: 0 ```Screenshot of OBS
2024.05.19 16:21 EchoJobs Hiring Operations Program Manager, Code Quality USD 97k-116k Irving, TX [Machine Learning Java Matlab Python C++ Go HTML Shell C# SQL Ruby Rust PHP Dart JavaScript TypeScript Swift R]
submitted by EchoJobs to golangjob [link] [comments] |
2024.05.19 16:10 sillylossy SillyTavern 1.12.0