Play ambience mp3 in a loop on dungeon #79

Closed
opened 2018-10-29 00:26:00 +01:00 by mishi · 3 comments
mishi commented 2018-10-29 00:26:00 +01:00 (Migrated from git.mattzz.de)

Dungeon should continuously play the mp3 ambience. It could do so automatically after starting up or it could be enabled/disabled from the Master Screen.

Ideally, we could start, stop and restart the playback at any time in the Master Screen by using a slider like the one for the auto_mode.

Alternative solution would be a button to start it and a button to stop it. We need to define two scary actions for dungeon: One to start a looped playback of the mp3 (mpg321 --loop 0 ambience.mp3 &) and one to kill the playback using an appropriate os-command. That should be easier to do an would be nice, even though there are two buttons and not a slider.

Additional scary actions playing more sounds and generating fog can be played while the ambience mp3 is playing in the background without a problem.

Dungeon should continuously play the mp3 ambience. It could do so automatically after starting up or it could be enabled/disabled from the Master Screen. Ideally, we could start, stop and restart the playback at any time in the Master Screen by using a slider like the one for the auto_mode. Alternative solution would be a button to start it and a button to stop it. We need to define two scary actions for dungeon: One to start a looped playback of the mp3 (`mpg321 --loop 0 ambience.mp3 &`) and one to kill the playback using an appropriate os-command. That should be easier to do an would be nice, even though there are two buttons and not a slider. Additional scary actions playing more sounds and generating fog can be played while the ambience mp3 is playing in the background without a problem.
mattzz commented 2018-10-29 22:34:42 +01:00 (Migrated from git.mattzz.de)

@mishi - Please make sure you run sudo apt-get install python3-psutil first.

Right now I'm not using threads but shell subprocesses. Stopping the process is done via kill() so I don't know what happens if there is another sound playing back at the same time...

@mishi - Please make sure you run `sudo apt-get install python3-psutil` first. Right now I'm not using threads but shell subprocesses. Stopping the process is done via kill() so I don't know what happens if there is another sound playing back at the same time...
mattzz commented 2018-10-29 22:47:45 +01:00 (Migrated from git.mattzz.de)

Just tested it :)
If two sounds are playing back at the same time and ambience sound is toggled off, then all sounds are stopped/killed.
But multiple sound playback is possible.

Just tested it :) If two sounds are playing back at the same time and ambience sound is toggled off, then all sounds are stopped/killed. But multiple sound playback *is* possible.
mishi commented 2018-10-30 00:21:39 +01:00 (Migrated from git.mattzz.de)

Awesome! I like this. It's simple. Like me.

Awesome! I like this. It's simple. Like me.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mattzz/halloween#79
No description provided.