-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: Cannot play matched samples in browser on macOS #3
Comments
First, confirm that the playback works in browser on Win10 Log: INFO:werkzeug:127.0.0.1 - - [24/Dec/2024 14:26:23] "GET / HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [24/Dec/2024 14:26:36] "GET /process-folder?folder_path=C:\\Dropbox\\Public\\Production\\Sliced%20beats HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [24/Dec/2024 14:26:40] "GET /process-folder?folder_path=C:\\Dropbox\\Public\\Production\\Sliced%20beats HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [24/Dec/2024 14:26:58] "GET /process-folder?folder_path=C:\\Dropbox\\Public\\Production\\Recorded HTTP/1.1" 200 -
C:\ML\music-classification\sample-browser\venv\lib\site-packages\transformers\models\roberta\modeling_roberta.py:370: UserWarning: 1Torch was not compiled with flash attention. (Triggered internally at C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\transformers\cuda\sdp_utils.cpp:555.)
attn_output = torch.nn.functional.scaled_dot_product_attention(
INFO:werkzeug:127.0.0.1 - - [24/Dec/2024 14:27:25] "POST /search HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [24/Dec/2024 14:27:25] "GET /serve-audio/C:\\Dropbox\\Public\\Production\\Sliced%20beats\\TBP%20-%20RamboGone%20(Vox).wav HTTP/1.1" 206 -
INFO:werkzeug:127.0.0.1 - - [24/Dec/2024 14:27:25] "GET /serve-audio/C:\\Dropbox\\Public\\Production\\Sliced%20beats\\Maaly%20Laugh.wav HTTP/1.1" 206 -
INFO:werkzeug:127.0.0.1 - - [24/Dec/2024 14:27:25] "GET /serve-audio/C:\\Dropbox\\Public\\Production\\Sliced%20beats\\TBP%20-%20RamboGone%20(Vox)_3.wav HTTP/1.1" 206 -
INFO:werkzeug:127.0.0.1 - - [24/Dec/2024 14:27:25] "GET /serve-audio/C:\\Dropbox\\Public\\Production\\Sliced%20beats\\Pooh%20-%20Io%20E%20Te%20Per%20Altri%20Giorni%201%20-%20Loop.wav HTTP/1.1" 206 -
INFO:werkzeug:127.0.0.1 - - [24/Dec/2024 14:27:25] "GET /serve-audio/C:\\Dropbox\\Public\\Production\\Sliced%20beats\\TBP%20-%20RamboGone%20(Vox)_2.wav HTTP/1.1" 206 -
INFO:werkzeug:127.0.0.1 - - [24/Dec/2024 14:27:25] "GET /serve-audio/C:\\Dropbox\\Public\\Production\\Sliced%20beats\\Dev%20-%20Have%20It%20All%201.wav HTTP/1.1" 206 -
INFO:werkzeug:127.0.0.1 - - [24/Dec/2024 14:27:25] "GET /serve-audio/C:\\Dropbox\\Public\\Production\\Sliced%20beats\\Lights%20-%20Until%20The%20Light%201%20-%20Loop.wav HTTP/1.1" 206 -
INFO:werkzeug:127.0.0.1 - - [24/Dec/2024 14:27:26] "GET /serve-audio/C:\\Dropbox\\Public\\Production\\Sliced%20beats\\Oh%20Wonder%20-%20All%20About%20You%20-%20Loop.wav HTTP/1.1" 206 -
INFO:werkzeug:127.0.0.1 - - [24/Dec/2024 14:27:26] "GET /serve-audio/C:\\Dropbox\\Public\\Production\\Sliced%20beats\\Otis%20Blackwell%20-%20Let%20The%20Daddy%20Hold%20You.wav HTTP/1.1" 206 -
INFO:werkzeug:127.0.0.1 - - [24/Dec/2024 14:27:26] "GET /serve-audio/C:\\Dropbox\\Public\\Production\\Recorded\\untitled_EU%2088%20Sound.wav HTTP/1.1" 206 -
INFO:werkzeug:127.0.0.1 - - [24/Dec/2024 14:27:26] "GET /serve-audio/C:\\Dropbox\\Public\\Production\\Sliced%20beats\\snair_7%20-%20Loop.wav HTTP/1.1" 206 -
INFO:werkzeug:127.0.0.1 - - [24/Dec/2024 14:27:26] "GET /serve-audio/C:\\Dropbox\\Public\\Production\\Sliced%20beats\\EddieLicks_3.wav HTTP/1.1" 206 -
INFO:werkzeug:127.0.0.1 - - [24/Dec/2024 14:27:26] "GET /serve-audio/C:\\Dropbox\\Public\\Production\\Recorded\\untitled_Master_3.wav HTTP/1.1" 206 -
INFO:werkzeug:127.0.0.1 - - [24/Dec/2024 14:27:26] "GET /serve-audio/C:\\Dropbox\\Public\\Production\\Sliced%20beats\\Otis%20Blackwell%20-%20Let%20The%20Daddy%20Hold%20You_3.wav HTTP/1.1" 206 -
INFO:werkzeug:127.0.0.1 - - [24/Dec/2024 14:27:26] "GET /serve-audio/C:\\Dropbox\\Public\\Production\\Recorded\\BuiltToLast_Master_3.wav HTTP/1.1" 206 -
INFO:werkzeug:127.0.0.1 - - [24/Dec/2024 14:27:26] "GET /serve-audio/C:\\Dropbox\\Public\\Production\\Recorded\\untitled_Insert%202_5.wav HTTP/1.1" 206 -
INFO:werkzeug:127.0.0.1 - - [24/Dec/2024 14:27:26] "GET /serve-audio/C:\\Dropbox\\Public\\Production\\Sliced%20beats\\EddieLicks_4.wav HTTP/1.1" 206 -
INFO:werkzeug:127.0.0.1 - - [24/Dec/2024 14:27:26] "GET /serve-audio/C:\\Dropbox\\Public\\Production\\Sliced%20beats\\Bioshock%202%20Install%20Music.wav HTTP/1.1" 206 -
INFO:werkzeug:127.0.0.1 - - [24/Dec/2024 14:27:26] "GET /serve-audio/C:\\Dropbox\\Public\\Production\\Recorded\\NeverOver_Xpand!2.wav HTTP/1.1" 206 -
INFO:werkzeug:127.0.0.1 - - [24/Dec/2024 14:27:26] "GET /serve-audio/C:\\Dropbox\\Public\\Production\\Recorded\\untitled_Horn.wav HTTP/1.1" 206 -
INFO:werkzeug:127.0.0.1 - - [24/Dec/2024 14:27:26] "GET /serve-audio/C:\\Dropbox\\Public\\Production\\Sliced%20beats\\half-sleep.wav HTTP/1.1" 206 -
INFO:werkzeug:127.0.0.1 - - [24/Dec/2024 14:27:26] "GET /serve-audio/C:\\Dropbox\\Public\\Production\\Recorded\\Unity_Bass%20Rev.wav HTTP/1.1" 206 -
INFO:werkzeug:127.0.0.1 - - [24/Dec/2024 14:27:26] "GET /serve-audio/C:\\Dropbox\\Public\\Production\\Sliced%20beats\\[CC]%20Terrified%20-%20Loop.wav HTTP/1.1" 206 -
INFO:werkzeug:127.0.0.1 - - [24/Dec/2024 14:27:26] "GET /serve-audio/C:\\Dropbox\\Public\\Production\\Sliced%20beats\\Otis%20Blackwell%20-%20Let%20The%20Daddy%20Hold%20You_2.wav HTTP/1.1" 206 -
INFO:werkzeug:127.0.0.1 - - [24/Dec/2024 14:27:26] "GET /serve-audio/C:\\Dropbox\\Public\\Production\\Recorded\\untitled_Insert%201_13.wav HTTP/1.1" 206 -
INFO:werkzeug:127.0.0.1 - - [24/Dec/2024 14:27:26] "GET /serve-audio/C:\\Dropbox\\Public\\Production\\Sliced%20beats\\Maaly%20Laugh.wav HTTP/1.1" 206 - |
@app.route('/serve-audio/<path:filepath>')
def serve_audio(filepath):
# Remove any leading slash to normalize the path
filepath = filepath.lstrip('/')
return send_file('/' + filepath) Sonnet came up with a simpler solution that doesnt work on Windows. Going to test something with this.
|
This might be the ugliest solution I've ever seen: @app.route('/serve-audio/<path:filepath>')
def serve_audio(filepath):
# Remove any leading slashes or backslashes
filepath = filepath.lstrip('/').lstrip('\\')
# If path starts with a drive letter on Windows (e.g., C:), use it as is
if len(filepath) >= 2 and filepath[1] == ':':
return send_file(filepath)
# For Unix paths, add a leading slash
return send_file('/' + filepath) |
Ok I gotta run so I think I'm settling on this for now: @app.route('/serve-audio/<path:filepath>')
def serve_audio(filepath):
# Check if this is a relative path on macOS or Linux
if os.name == 'posix':
# Convert to absolute path by adding the root slash
filepath = '/' + filepath
return send_file(filepath) Tested on macOS and Win10 and it works for both. Probably a more elegant way to do this but would take a bit more time. Sonnet says the issue stems from
|
In the process of installing to macOS I came across an audio playback bug here: #1 (comment)
Sonnet 3.5 suggested this change to the
sound-similarity-browser.py
file, which works on macOS:The problem is, the original code works on Windows:
The plan is to change this code on Windows and see if it works on both.
The text was updated successfully, but these errors were encountered: