This isn’t really tested but should give a good starting point. If node-red has access to the directory where you’re storing the files you could replace the change node, set flow.musicList, with a node that scans the directory and returns the file list in an array. The timeout on the wait-until node might be useful, so the whole flow doesn’t get stuck in the disable position.
[{"id":"1ee17272.5e600e","type":"trigger-state","z":"ffbd7f06.4a014","name":"Bathroom Motion","entityid":"sensor.motion","entityidfiltertype":"exact","debugenabled":false,"constraints":[],"constraintsmustmatch":"all","outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","x":250,"y":832,"wires":[["7116a743.9a35d8","aeb6c4fd.2386f8"],[]]},{"id":"7116a743.9a35d8","type":"function","z":"ffbd7f06.4a014","name":"","func":"// Get Array from flow variable or set to empty array\nconst array = flow.get(\"musicList\") || [];\n\n// If empty array send to second output\nif(array.length === 0) return [null, msg];\n\n// get a random index of array\nconst index = Math.floor(Math.random() * array.length);\n\n// remove the the random index from array \n// and save it to msg.payload\nmsg.payload = array.splice(index, 1)[0];\n\n// save new array to flow var minus the previous\n// selected item\nflow.set(\"musicList\", array);\n\nreturn [msg, null];","outputs":2,"noerr":0,"x":434,"y":832,"wires":[["6e8c847e.9d8b0c"],["88c785ce.d806a8"]]},{"id":"88c785ce.d806a8","type":"change","z":"ffbd7f06.4a014","name":"","rules":[{"t":"set","p":"musicList","pt":"flow","to":"[\"filename1.mp3\",\"filename2.mp3\",\"filename3.mp3\",\"filename4.mp3\",\"filename5.mp3\"]","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":602,"y":880,"wires":[["7116a743.9a35d8"]]},{"id":"6e8c847e.9d8b0c","type":"api-call-service","z":"ffbd7f06.4a014","name":"Play media","service_domain":"media_player","service":"play_media","data":"{\"entity_id\":\"media_player.bathroom\",\"media_content_id\":\"{{payload}}\",\"media_content_type\":\"music\"}","mergecontext":"","output_location":"","output_location_type":"none","x":582,"y":832,"wires":[["1e0deb83.41c724"]]},{"id":"1e0deb83.41c724","type":"ha-wait-until","z":"ffbd7f06.4a014","name":"","outputs":2,"entityId":"media_player.bathroom","property":"state","comparator":"is_not","value":"playing","valueType":"str","timeout":"5","timeoutUnits":"minutes","entityLocation":"","entityLocationType":"none","checkCurrentState":false,"x":752,"y":832,"wires":[["e398c78d.ce3998"],["b1228530.56cc88"]]},{"id":"aeb6c4fd.2386f8","type":"change","z":"ffbd7f06.4a014","name":"disable","rules":[{"t":"set","p":"payload","pt":"msg","to":"disable","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":444,"y":784,"wires":[["1ee17272.5e600e"]]},{"id":"b1228530.56cc88","type":"change","z":"ffbd7f06.4a014","name":"enable","rules":[{"t":"set","p":"payload","pt":"msg","to":"enable","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1058,"y":832,"wires":[["1ee17272.5e600e"]]},{"id":"e398c78d.ce3998","type":"delay","z":"ffbd7f06.4a014","name":"","pauseType":"delay","timeout":"20","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":908,"y":800,"wires":[["b1228530.56cc88"]]}]