Fixed a crash during audio download/encode process
This commit is contained in:
parent
d6858aca3d
commit
1c64bb07a0
|
@ -1,6 +1,9 @@
|
||||||
MumbleDJ Changelog
|
MumbleDJ Changelog
|
||||||
==================
|
==================
|
||||||
|
|
||||||
|
### October 18, 2014
|
||||||
|
* Fixed a crash when an error occurs during the audio downloading & encoding process.
|
||||||
|
|
||||||
### October 13, 2014
|
### October 13, 2014
|
||||||
* Added `SETUP.md` which contains a guide on how to configure MumbleDJ and install its dependencies.
|
* Added `SETUP.md` which contains a guide on how to configure MumbleDJ and install its dependencies.
|
||||||
* Deleted song_queue.lua and moved all contents to mumbledj.lua. In the end this will make the script simpler.
|
* Deleted song_queue.lua and moved all contents to mumbledj.lua. In the end this will make the script simpler.
|
||||||
|
|
|
@ -127,7 +127,7 @@ config.NO_PERMISSION_MSG = "You do not have permission to execute that command."
|
||||||
config.CHANNEL_DOES_NOT_EXIST_MSG = "The channel you specified does not exist."
|
config.CHANNEL_DOES_NOT_EXIST_MSG = "The channel you specified does not exist."
|
||||||
|
|
||||||
-- Message shown to users when they attempt to add an invalid URL to the queue.
|
-- Message shown to users when they attempt to add an invalid URL to the queue.
|
||||||
config.INVALID_URL_MSG = "The URL you submitted does not match the required format. Please submit a valid YouTube URL."
|
config.INVALID_URL_MSG = "The URL you submitted does not match the required format. Either you did not provide a YouTube URL, or an error occurred during the downloading & encoding process."
|
||||||
|
|
||||||
-- Message shown to users when they attempt to use the stop command when no music is playing.
|
-- Message shown to users when they attempt to use the stop command when no music is playing.
|
||||||
config.NO_MUSIC_PLAYING_MSG = "There is no music playing at the moment."
|
config.NO_MUSIC_PLAYING_MSG = "There is no music playing at the moment."
|
||||||
|
|
|
@ -29,11 +29,17 @@ except:
|
||||||
|
|
||||||
while isfile('song.ogg.temp'):
|
while isfile('song.ogg.temp'):
|
||||||
sleep(1)
|
sleep(1)
|
||||||
|
|
||||||
system('ffmpeg -i song.ogg -codec:a libvorbis -ar 48000 -ac 1 -loglevel quiet -vol ' + str(volume) + ' song-converted.ogg -y')
|
|
||||||
|
|
||||||
while not isfile('song-converted.ogg') and not isfile(".video_fail"):
|
if isfile('song.ogg'):
|
||||||
sleep(1)
|
system('ffmpeg -i song.ogg -codec:a libvorbis -ar 48000 -ac 1 -loglevel quiet -vol ' + str(volume) + ' song-converted.ogg -y')
|
||||||
|
else:
|
||||||
|
with open('.video_fail', 'w+') as f:
|
||||||
|
f.close()
|
||||||
|
|
||||||
remove('song.ogg')
|
if not isfile('.video_fail'):
|
||||||
|
while not isfile('song-converted.ogg'):
|
||||||
|
sleep(1)
|
||||||
|
|
||||||
|
if isfile('song.ogg'):
|
||||||
|
remove('song.ogg')
|
||||||
|
|
||||||
|
|
|
@ -292,10 +292,10 @@ end
|
||||||
-- Downloads/encodes the audio file and then begins to play it.
|
-- Downloads/encodes the audio file and then begins to play it.
|
||||||
function start_song(info)
|
function start_song(info)
|
||||||
os.execute("python download_audio.py " .. info.id .. " " .. config.VOLUME)
|
os.execute("python download_audio.py " .. info.id .. " " .. config.VOLUME)
|
||||||
while not file_exists("song-converted.ogg") do
|
|
||||||
os.execute("sleep " .. tonumber(2))
|
|
||||||
end
|
|
||||||
if not file_exists(".video_fail") then
|
if not file_exists(".video_fail") then
|
||||||
|
while not file_exists("song-converted.ogg") do
|
||||||
|
os.execute("sleep " .. tonumber(2))
|
||||||
|
end
|
||||||
if piepan.Audio:isPlaying() then
|
if piepan.Audio:isPlaying() then
|
||||||
piepan.Audio:stop()
|
piepan.Audio:stop()
|
||||||
end
|
end
|
||||||
|
|
Reference in a new issue