From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Cecilio Pardo Newsgroups: gmane.emacs.bugs Subject: bug#74863: 31.0.50; Problems with play-sound on MS-Windows Date: Sun, 15 Dec 2024 12:55:35 +0100 Message-ID: <13c75eef-5ba3-4d2b-bc6a-f6e64860552a@imayhem.com> References: <86a5cywt9b.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------Bb0eweXoXw0aQsK4Ve9h9VgN" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19423"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 74863@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 15 12:56:27 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 1tMnEY-0004tN-Ef for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 15 Dec 2024 12:56:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMnEC-0004JZ-E5; Sun, 15 Dec 2024 06:56: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 1tMnEA-0004JQ-Ka for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2024 06:56:02 -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 1tMnEA-0005QG-85 for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2024 06:56:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:From:References:MIME-Version:Date:To:Subject; bh=krxZrilNmy87heneSXp5aM4/1AAPaQVkc6hF+njcJvo=; b=h//SkwVhX1/175GA/Wrv7SyL33Rx0j8FRElAtRsAHSjcBnrJGfbgTrphE4ZMMX6uvC8cUv91qORgN05dZSbEJViiVGLXE8mHC6Iwo5sAPU4Zqwm16LCSWZuEB/P/k+eDdW92+yyZWEWpbyyX5QLXzQ4uA5xcLrwUmKS3el8IbeBPs4AcgNTTDBfWMMAHU6ZoqsG/GNGzSM56tXyv5HJ3JtdC8B7kHHjtNLsavgEyPpIy9tl3bOphLgVvAn+vrxhETO+It5+uiqB1D6sW1RwPXWfOFnnLUZrl2Ewkfq4sjoviq6kMol6DWY3wWkcccp1PoOi2s8gemTzDr0CNHDKzGA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tMnE9-0001HD-OQ for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2024 06:56:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Cecilio Pardo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Dec 2024 11:56: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.17342637574895 (code B ref 74863); Sun, 15 Dec 2024 11:56:01 +0000 Original-Received: (at 74863) by debbugs.gnu.org; 15 Dec 2024 11:55:57 +0000 Original-Received: from localhost ([127.0.0.1]:49761 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMnE4-0001Gs-0X for submit@debbugs.gnu.org; Sun, 15 Dec 2024 06:55:56 -0500 Original-Received: from mail.imayhem.com ([82.223.54.191]:33597 helo=zealous-pike.82-223-54-191.plesk.page) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMnE1-0001GW-OT for 74863@debbugs.gnu.org; Sun, 15 Dec 2024 06:55:55 -0500 Original-Received: from [192.168.68.101] (111.red-88-21-7.staticip.rima-tde.net [88.21.7.111]) by zealous-pike.82-223-54-191.plesk.page (Postfix) with ESMTPSA id A7A4580184; Sun, 15 Dec 2024 11:55:35 +0000 (UTC) Authentication-Results: zealous-pike.82-223-54-191.plesk.page; spf=pass (sender IP is 88.21.7.111) smtp.mailfrom=cpardo@imayhem.com smtp.helo=[192.168.68.101] Received-SPF: pass (zealous-pike.82-223-54-191.plesk.page: connection is authenticated) Content-Language: es-ES In-Reply-To: <86a5cywt9b.fsf@gnu.org> 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:297097 Archived-At: This is a multi-part message in MIME format. --------------Bb0eweXoXw0aQsK4Ve9h9VgN Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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)) --------------Bb0eweXoXw0aQsK4Ve9h9VgN Content-Type: text/plain; charset=UTF-8; name="0001-Add-support-for-the-data-keyword-for-play-sound-in-M.patch" Content-Disposition: attachment; filename*0="0001-Add-support-for-the-data-keyword-for-play-sound-in-M.pa"; filename*1="tch" Content-Transfer-Encoding: base64 RnJvbSAyNzIyNWQyNDRiYWQ3NDdlN2YyNDY5YWZlNmQ4YWQwZDM3NGUyOTEwIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBDZWNpbGlvIFBhcmRvIDxjcGFyZG9AaW1heWhlbS5j b20+CkRhdGU6IFN1biwgMTUgRGVjIDIwMjQgMDE6MTM6MTYgKzAxMDAKU3ViamVjdDogW1BB VENIXSBBZGQgc3VwcG9ydCBmb3IgdGhlICc6ZGF0YScga2V5d29yZCBmb3IgcGxheS1zb3Vu ZCBpbgogTVMtV2luZG93cy4KCkFsc28gZml4IGFuIGVycm9yIG9uIHZvbHVtZSBoYW5kbGlu Zy4KCiogZXRjL05FV1M6IEFkZCBlbnRyeSBmb3IgdGhpcyBjaGFuZ2UuCiogZXRjL1BST0JM RU1TOiBSZW1vdmUgZW50cnkgYWJvdXQgbWlzc2luZyBzdXBwb3J0IGZvciA6ZGF0YS4KKiBz cmMvc291bmQuYyAocGFyc2Vfc291bmQpOiBDaGVjayB0aGF0IGVpdGhlciA6ZmlsZSBvciA6 ZGF0YSBpcwpwcmVzZW50LgooZG9fcGxheV9zb3VuZCk6IEFkZGVkIHBhcmFtZXRlciB0byBz ZWxlY3QgZmlsZSBvciBkYXRhLCBhbmQgY29kZSB0bwpwbGF5IGZyb20gZGF0YS4KKEZwbGF5 X3NvdW5kX2ludGVybmFsKTogRml4ZWQg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V0X2J1Zl93WzUy MF07CisJICB3Y2hhcl90IGZuYW1lX3dbTUFYX1BBVEhdOworCisJICBmaWxlbmFtZV90b191 dGYxNiAocHN6X2ZpbGVfb3JfZGF0YSwgZm5hbWVfdyk7CisJICBtZW1zZXQgKHN6X2NtZF9i dWZfdywgMCwgc2l6ZW9mIChzel9jbWRfYnVmX3cpKTsKKwkgIG1lbXNldCAoc3pfcmV0X2J1 Zl93LCAwLCBzaXplb2YgKHN6X3JldF9idWZfdykpOworCSAgLyogX3N3cHJpbnRmIGlzIG5v dCBhdmFpbGFibGUgb24gV2luZG93cyA5WCwgc28gd2UgY29uc3RydWN0IHRoZQorCSAgICAg VVRGLTE2IGNvbW1hbmQgc3RyaW5nIGJ5IGhhbmQuICAqLworCSAgd2NzY3B5IChzel9jbWRf YnVmX3csIEwib3BlbiBcIiIpOworCSAgd2NzY2F0IChzel9jbWRfYnVmX3csIGZuYW1lX3cp OworCSAgd2NzY2F0IChzel9jbWRfYnVmX3csIEwiXCIgYWxpYXMgR05VRW1hY3NfUGxheVNv dW5kX0RldmljZSB3YWl0Iik7CisJICBtY2lfZXJyb3IgPSBtY2lTZW5kU3RyaW5nVyAoc3pf Y21kX2J1Zl93LAorCQkJCSAgICAgIHN6X3JldF9idWZfdywgQVJSQVlFTFRTIChzel9yZXRf YnVmX3cpICwgTlVMTCk7CisJfQorICAgICAgaWYgKG1jaV9lcnJvciAhPSAwKQorCXsKKwkg IHN0cmNweSAod2Fybl90ZXh0LAorCQkgICJtY2lTZW5kU3RyaW5nOiAnb3BlbicgY29tbWFu ZCBmYWlsZWQgdG8gb3BlbiBzb3VuZCBmaWxlICIpOworCSAgc3RyY2F0ICh3YXJuX3RleHQs IHBzel9maWxlX29yX2RhdGEpOworCSAgU09VTkRfV0FSTklORyAobWNpR2V0RXJyb3JTdHJp bmcsIG1jaV9lcnJvciwgd2Fybl90ZXh0KTsKKwkgIGlfcmVzdWx0ID0gKGludCkgbWNpX2Vy cm9yOworCSAgcmV0d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