On 14/12/2024 9:42, Eli Zaretskii wrote: >> - To support :data, we can use the PlaySound function, but we will lose >> the ability to play files other than wav. We can maintain the current >> code for files, and use PlaySound for :data. Another option would be to >> simply save data to a temp file and play the file. > > I'd say the former is preferable, but without losing the ability to > play the files we can today. That is, maintain the current code for > files and add new code for :data. This patch adds support for :data using PlaySound, keeping the current code for files. It also fixes a problem in the handling of the volume. Let me know if I have to make a separate patch/bug. Tested with mingw64 and mingw32. To test: (defun load-file-into-unibyte-string (file-path) (with-temp-buffer (set-buffer-multibyte nil) (insert-file-contents file-path) (buffer-string))) (play-sound `(sound :data ,(load-file-into-unibyte-string "awav.wav") :volume 100)) (play-sound '(sound :file "awav.wav" :volume 100))