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: Sat, 21 Dec 2024 12:37:37 +0200 Message-ID: <861py18gpa.fsf@gnu.org> References: <86a5cywt9b.fsf@gnu.org> <13c75eef-5ba3-4d2b-bc6a-f6e64860552a@imayhem.com> <861py9rtz0.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31441"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 74863-done@debbugs.gnu.org To: Cecilio Pardo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 21 11:38:41 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 1tOwsa-00083Z-I7 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 21 Dec 2024 11:38:40 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOws0-000835-Tv; Sat, 21 Dec 2024 05:38:04 -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 1tOwrz-00082e-Fb for bug-gnu-emacs@gnu.org; Sat, 21 Dec 2024 05:38: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 1tOwry-0001iL-W6 for bug-gnu-emacs@gnu.org; Sat, 21 Dec 2024 05:38: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=X/QKbLgqp0sSk33jJdyux3y966COGbMhoousM6pNrw4=; b=VAcbQArQLvu4gRNBRjfjcNuO2v0Zte1spEHzIG+9TmeFnlwUgJePqmtXsV9yoWTwZABqUiyE1UeFtc9cA16u97ipLmgvV0BJrBXfvPTEb2t1fPe1O1i8zi+jB3JtiN21C4FTaG+MQZFajeuVxeMktLiZDSSaCCiWzfu6J57zFvdqkD/vw7aPNDi0O7v8Bn0WBtK1scJAnRaGXR7mQ352fUgCdQqE3n2oz7U0/JziNz/MTxHTQNgdn0dezq910niFbNzej9TN+Hvkan1Bd+9QnqbbAnerTwWf+9+WOWkfhYawtR+/scvjyJ1f7Ryh8rAYCI6Nto1Ud9QGADbTlrnJJg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tOwry-00026d-PC for bug-gnu-emacs@gnu.org; Sat, 21 Dec 2024 05:38:02 -0500 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Dec 2024 10:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 74863 X-GNU-PR-Package: emacs Mail-Followup-To: 74863@debbugs.gnu.org, eliz@gnu.org, cpardo@imayhem.com Original-Received: via spool by 74863-done@debbugs.gnu.org id=D74863.17347774698059 (code D ref 74863); Sat, 21 Dec 2024 10:38:02 +0000 Original-Received: (at 74863-done) by debbugs.gnu.org; 21 Dec 2024 10:37:49 +0000 Original-Received: from localhost ([127.0.0.1]:45403 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tOwrl-00025t-2w for submit@debbugs.gnu.org; Sat, 21 Dec 2024 05:37:49 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58908) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tOwrj-00025f-9Q for 74863-done@debbugs.gnu.org; Sat, 21 Dec 2024 05:37:47 -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 1tOwre-0001gZ-3Z; Sat, 21 Dec 2024 05:37:42 -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=X/QKbLgqp0sSk33jJdyux3y966COGbMhoousM6pNrw4=; b=AIZtHkq8NOgu sOOP6VDKhbpECAL79OlgH5xLzeU2Bgr8U1TgdPN5JkAj+oc9w6PKsJqLJIuIqMtG7qSi0AJ9T9kWD OIk0B/By4SeJR54i3f+INnvR/iyQJPYL5u10AnrfUL2OYYCBr/UaLY5F/t6ebfAqNTY9ts7RP7pZ0 Og1Q874WeFeNJQ1l2t/9gHeNBXVBzsY0YeHSVGSJGc7HaUVUKcS520E9rmS3QTMcxMFA0V/ZjB1u9 YCxjZnLusvUqW7SkeYc7ViJDQ873fj+bvXXEtXQ0zsQ9oG6Yz0OGhrQmVenY4786d/ECo+2L7W+0N Z4Z+gotIXn/mfbYL74IUYg==; In-Reply-To: (message from Cecilio Pardo on Sun, 15 Dec 2024 19:33: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:297515 Archived-At: > Date: Sun, 15 Dec 2024 19:33:35 +0100 > Cc: 74863@debbugs.gnu.org > From: Cecilio Pardo > > 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.