From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#74863: 31.0.50; Problems with play-sound on MS-Windows Date: Sun, 15 Dec 2024 14:50:11 +0200 Message-ID: <861py9rtz0.fsf@gnu.org> References: <86a5cywt9b.fsf@gnu.org> <13c75eef-5ba3-4d2b-bc6a-f6e64860552a@imayhem.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16402"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 74863@debbugs.gnu.org To: Cecilio Pardo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 15 13:51:22 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tMo5i-00049F-Ai for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 15 Dec 2024 13:51:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMo5V-00035x-7b; Sun, 15 Dec 2024 07:51:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMo5P-00034n-HO for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2024 07:51:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tMo5P-00057k-08 for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2024 07:51:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=em8CjxdVz+LR4R8at9tSd64DwY/VUXrfbR/4CiKBRLU=; b=Dq6yiY7FA1avgWTE5dbF5b50+gnScZsLJZeX8ePtR/+d29iEhc7QfeB7azqu55Clf1mVLcrgfo48nVkCSweyhw0ygANEOybEdCpWl2SpvoYx+SEWMcr5M6v3FiF6/m0OcoHuWZ8YLYvOaspPGw1NpEdmtw3xM7YjAw6S1oAfNs0VFXq7WiMcLXg8K1IsvZY/iqmiRi+Qfbhw+yTfRiIqW4xQkxKkWUvVImmyLMuQiWr/qQ5wtTCAyB6welwh3jfZ69xO+AJJRwMBDHO/PQUDbKsxV71exJjYyIacIDcdMkeaU7KLDzUvDiOslHGwS1D86tOCkHEKYEWsrql0yjoyKw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tMo5N-0003tV-WB for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2024 07:51:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Dec 2024 12:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74863 X-GNU-PR-Package: emacs Original-Received: via spool by 74863-submit@debbugs.gnu.org id=B74863.173426702214900 (code B ref 74863); Sun, 15 Dec 2024 12:51:01 +0000 Original-Received: (at 74863) by debbugs.gnu.org; 15 Dec 2024 12:50:22 +0000 Original-Received: from localhost ([127.0.0.1]:49857 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMo4j-0003sF-L6 for submit@debbugs.gnu.org; Sun, 15 Dec 2024 07:50:21 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:41488) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMo4h-0003oq-Kb for 74863@debbugs.gnu.org; Sun, 15 Dec 2024 07:50:20 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMo4b-000557-Lw; Sun, 15 Dec 2024 07:50:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=em8CjxdVz+LR4R8at9tSd64DwY/VUXrfbR/4CiKBRLU=; b=ZLjyEjmB0CJm QC5H5SFdid0J2ZhxBIRFj+MQDIbj6g6iAC4rxYVojAUJIVmkoqN7ZKS2N25f5Af4O5quVbNH2ssYV 8BLzvZ8FkSXXVCnraaVS3czeAtqre4pytXJOdt1e9AXHhQRDmKSIa8xjPmTtZFKM5DgXslpHak4z5 NDPBBUONjeUHTtK3VBBpbS6+61PpKxIzZ3pHlHgITILmCi/vlT0oxs5qUZrrbFs6jLHHB9gcIUjy/ tpxX4KOnzPNKyrQx6AxkaJktUqh4gQiamQew87pIugj5mk6maopIB4fbE2s0SF3Som8dv3HoywIT0 p0RQTHcq4sgtwgmpBkQjGg==; In-Reply-To: <13c75eef-5ba3-4d2b-bc6a-f6e64860552a@imayhem.com> (message from Cecilio Pardo on Sun, 15 Dec 2024 12:55:35 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:297100 Archived-At: > Date: Sun, 15 Dec 2024 12:55:35 +0100 > Cc: 74863@debbugs.gnu.org > From: Cecilio Pardo > > 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)?