unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Cecilio Pardo <cpardo@imayhem.com>
Cc: 74863@debbugs.gnu.org
Subject: bug#74863: 31.0.50; Problems with play-sound on MS-Windows
Date: Sun, 15 Dec 2024 14:50:11 +0200	[thread overview]
Message-ID: <861py9rtz0.fsf@gnu.org> (raw)
In-Reply-To: <13c75eef-5ba3-4d2b-bc6a-f6e64860552a@imayhem.com> (message from Cecilio Pardo on Sun, 15 Dec 2024 12:55:35 +0100)

> Date: Sun, 15 Dec 2024 12:55:35 +0100
> Cc: 74863@debbugs.gnu.org
> From: Cecilio Pardo <cpardo@imayhem.com>
> 
> This patch adds support for :data using PlaySound, keeping the current 
> code for files.

Thanks.

> It also fixes a problem in the handling of the volume. Let me know if I 
> have to make a separate patch/bug.

No need.

> 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))

What's wrong with insert-file-contents-literally?

> +  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?

Should we also use SND_SENTRY flag (on Vista and later)?





  reply	other threads:[~2024-12-15 12:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-13 23:50 bug#74863: 31.0.50; Problems with play-sound on MS-Windows Cecilio Pardo
2024-12-14  8:42 ` Eli Zaretskii
2024-12-14 14:07   ` Cecilio Pardo
2024-12-14 14:56     ` Eli Zaretskii
2024-12-15  1:35       ` Stefan Kangas
2024-12-15 11:55   ` Cecilio Pardo
2024-12-15 12:50     ` Eli Zaretskii [this message]
2024-12-15 18:33       ` Cecilio Pardo
2024-12-15 18:48         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=861py9rtz0.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=74863@debbugs.gnu.org \
    --cc=cpardo@imayhem.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).