::source_by_path() was written for MIDI files only. I fixed the call and renamed the two similar functions (one for audio and one for MIDI) to make it more clear.