a year ago
And you closed my post without even addressing the issue. WTF? This app works in a fully containerized docker service but fails to play audio on Railway. This is obviously not simple user error, but you just close the post without addressing it or even allowing other users to chime in. This is the definition of a lack of support and shows me you have no interest in me coming of the trial plan. And it is something I have seen in multiple support requests. So, unless you want me to look at other providers rather than start paying you to host my sites/apps then I suggest you give me a real response!
"Original Post"
I have a Flask web app I wrote using python that takes a user's input text and converts it to a list of mp3 files to play back the morse code audio of that text. I am using FFmpeg for the audio playback.
It works fine locally and in a Docker container on my local machine. But when I try it on Railway my debug statements tell me it is playing each file as intended but there is no audio I can hear.
This is the code that plays the mp3s
from data import MORSE_AUDIO_DICT
import subprocess
import time
import logging
logging.basicConfig(level=logging.DEBUG)
class MorseAudio:
@classmethod
def play_audio(cls, text_to_encode: str):
for char in text_to_encode.lower():
if char in MORSE_AUDIO_DICT:
m_char = MORSE_AUDIO_DICT[char]
audio_file = f'static/audio/morse_code/32-bit/{m_char}.mp3'
logging.debug(f"Playing audio file: {m_char}.mp3") # Debug testing
print(f"Playing audio file: {m_char}.mp3", flush=True)
result = subprocess.run(["ffplay", "-nodisp", "-autoexit", audio_file], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
print(result.stdout, flush=True)
print(result.stderr, flush=True)
time.sleep(0.05) # Short delay after playback
time.sleep(0.1) # Delay between characters
And this is the log I get back
Playing audio file: s.mp3
DEBUG:root:Playing audio file: s.mp3
None
None
Playing audio file: o.mp3
DEBUG:root:Playing audio file: o.mp3
None
None
Playing audio file: s.mp3
DEBUG:root:Playing audio file: s.mp3
None
None
So, it appears to be working fine. Can anyone help me understand why there is no sound?
2 Replies
furstukinFREE
7 hours ago
Bump
Would really love to know if this is a limitation of Railway
Reply
2 hours ago
Hey!
This is an issue with your project/application. Unfortunately, we're unable to offer first-party support for issues unrelated to the Railway product or platform.
Other communities such as Stackoverflow might be able to help you out further.
Best,
Brody
Reply
5 Replies
a year ago
Apologies but this looks like an issue with the application level code. Due to volume, we can only answer platform level issues here
I've made this thread public so that the community might be able to help
Status changed to Awaiting User Response Railway • 11 months ago
a year ago
Ok again it runs in a fully containerized docker application so not a code level issue...I assume you understand what a docker containerized app means. I.e. it has nothing to do with my operating system installed components etc. It runs as if it were on a universal OS.
a year ago
It is a simple user error. You're attempting to play the sound on the server. It won't magically play in the browser.
a year ago
Ok that is helpful thank you for making that connection, that is something i can certainly research.
furstukin
Ok that is helpful thank you for making that connection, that is something i can certainly research.
a year ago
And now things are golden. If anyone runs into this, the issue was trying to play the audio in a python class. Sure, it was playing the files but on some server bank in a closet with no speaker. Even if it had speakers the user won't hear it lol. Instead, I needed to have that class pass a list of files to play and use a script in my html to play the audio in the browser from that list.