GNU bug report logs - #74863
31.0.50; Problems with play-sound on MS-Windows

Previous Next

Package: emacs;

Reported by: Cecilio Pardo <cpardo <at> imayhem.com>

Date: Fri, 13 Dec 2024 23:51:01 UTC

Severity: normal

Found in version 31.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #43 received at 74863-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Cecilio Pardo <cpardo <at> imayhem.com>
Cc: 74863-done <at> debbugs.gnu.org
Subject: Re: bug#74863: 31.0.50; Problems with play-sound on MS-Windows
Date: Sat, 21 Dec 2024 12:37:37 +0200
> Date: Sun, 15 Dec 2024 19:33:35 +0100
> Cc: 74863 <at> debbugs.gnu.org
> From: Cecilio Pardo <cpardo <at> imayhem.com>
> 
> On 15/12/2024 13:50, Eli Zaretskii wrote:
> 
> >> (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))
> > 
> > What's wrong with insert-file-contents-literally?
> 
> Nothing. So many functions...
> 
> > 
> >> +  if (in_memory)
> >> +    i_result = !PlaySound (psz_file_or_data, NULL, SND_MEMORY);
> > 
> > AFAIU, the documentation seems to say that the string passed as the
> > first argument to PlaySound is limited to 256 characters (i.e. bytes)?
> > If so, how do we play longer sounds?
> 
> I think this limitation applies only when the argument points to a 
> string, and not when using SND_MEMORY, which is documented with: "The 
> pszSound parameter points to a sound loaded in memory."
> 
> It's true the documentation doesn't say so, and I haven't found any 
> clarification by Microsoft, but SND_MEMORY would be useless otherwise. 
> Also I see normal usage searching the internet.
> 
> > Should we also use SND_SENTRY flag (on Vista and later)?
> 
> Yes, done in the attached patch.

Thanks, installed on master, and closing the bug.




This bug report was last modified 209 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.