* `play-sound-file', no mp3 support, sets global volume w/o reset
@ 2024-09-04 21:52 Emanuel Berg
2024-09-11 12:07 ` Emanuel Berg
0 siblings, 1 reply; 5+ messages in thread
From: Emanuel Berg @ 2024-09-04 21:52 UTC (permalink / raw)
To: emacs-devel
`play-sound-file' doesn't play mp3 files, but it could, as the
MP3 patent expired in 2017. (So between 6y 8m 4d and 7y 8m 3d ago.)
But you can easily convert convert an .mp3 file into an .au
file with
$ ffmpeg -i src.mp3 dst.au
But play-sound-file has another problem, namely, if you do e.g.
(play-sound-file (file-name-concat bad-dir "data" "up.au") 0.4)
it sets the global volume to 40% and worse, after it is done,
it isn't reset.
--
underground experts united
https://dataswamp.org/~incal
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: `play-sound-file', no mp3 support, sets global volume w/o reset
2024-09-04 21:52 `play-sound-file', no mp3 support, sets global volume w/o reset Emanuel Berg
@ 2024-09-11 12:07 ` Emanuel Berg
2024-09-11 20:43 ` Stefan Kangas
2024-09-22 12:19 ` Björn Bidar
0 siblings, 2 replies; 5+ messages in thread
From: Emanuel Berg @ 2024-09-11 12:07 UTC (permalink / raw)
To: emacs-devel
> But play-sound-file has another problem, namely, if you do
> e.g.
>
> (play-sound-file (file-name-concat bad-dir "data" "up.au") 0.4)
>
> it sets the global volume to 40% and worse, after it is
> done, it isn't reset.
Did anyone check this out?
If unsolved, in practice it means one cannot use it.
My Russian eurodance plays loud and clear at 30-40%.
Just imagine I execute some code that plays a sound at 100%
and then don't reset. The whole block would be dancing.
So while most people would probably just never use a program
again if they know they have to reset their settings
afterwards, it actually could be even dangerous.
Also, another bad thing is that the command monopolizes
execution. I know Elisp is single-threaded and the idle timer
and C threads don't change that, but what about
a child process?
Would that work?
--
underground experts united
https://dataswamp.org/~incal
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: `play-sound-file', no mp3 support, sets global volume w/o reset
2024-09-11 12:07 ` Emanuel Berg
@ 2024-09-11 20:43 ` Stefan Kangas
2024-09-12 4:50 ` Emanuel Berg
2024-09-22 12:19 ` Björn Bidar
1 sibling, 1 reply; 5+ messages in thread
From: Stefan Kangas @ 2024-09-11 20:43 UTC (permalink / raw)
To: Emanuel Berg, emacs-devel
Emanuel Berg <incal@dataswamp.org> writes:
>> But play-sound-file has another problem, namely, if you do
>> e.g.
>>
>> (play-sound-file (file-name-concat bad-dir "data" "up.au") 0.4)
>>
>> it sets the global volume to 40% and worse, after it is
>> done, it isn't reset.
>
> Did anyone check this out?
Please report this to the bug tracker, with all the details.
> Also, another bad thing is that the command monopolizes
> execution. I know Elisp is single-threaded and the idle timer
> and C threads don't change that, but what about
> a child process?
See etc/TODO:
** Make play-sound asynchronous and non-blocking
Patches welcome.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: `play-sound-file', no mp3 support, sets global volume w/o reset
2024-09-11 20:43 ` Stefan Kangas
@ 2024-09-12 4:50 ` Emanuel Berg
0 siblings, 0 replies; 5+ messages in thread
From: Emanuel Berg @ 2024-09-12 4:50 UTC (permalink / raw)
To: emacs-devel
Stefan Kangas wrote:
>> Did anyone check this out?
>
> Please report this to the bug tracker, with all the details.
Okay, sure!
>> Also, another bad thing is that the command monopolizes
>> execution. I know Elisp is single-threaded and the idle
>> timer and C threads don't change that, but what about
>> a child process?
>
> See etc/TODO:
>
> ** Make play-sound asynchronous and non-blocking
>
> Patches welcome.
I'm busy with another project that is already huge but I just
can't finnish it, it seems, but when I do I want to contribute
to Emacs in some way or another, God willing.
Here is a screenshot - it looks OK - well, more than OK - but
when I started out with eieio there were so many things
I didn't know, so I made it work anyway, but now I see how to
do it their way, the right/intended way, and more often than
not I agree, so now I an cleaning up certain habits from 34
files that worked excellently, just to impose tons of bug
trying to do it in a better way :)
https://dataswamp.org/~incal/emacs-init/bad/meta/cat.png
--
underground experts united
https://dataswamp.org/~incal
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: `play-sound-file', no mp3 support, sets global volume w/o reset
2024-09-11 12:07 ` Emanuel Berg
2024-09-11 20:43 ` Stefan Kangas
@ 2024-09-22 12:19 ` Björn Bidar
1 sibling, 0 replies; 5+ messages in thread
From: Björn Bidar @ 2024-09-22 12:19 UTC (permalink / raw)
To: emacs-devel
Emanuel Berg <incal@dataswamp.org> writes:
>> But play-sound-file has another problem, namely, if you do
>> e.g.
>>
>> (play-sound-file (file-name-concat bad-dir "data" "up.au") 0.4)
>>
>> it sets the global volume to 40% and worse, after it is
>> done, it isn't reset.
> Also, another bad thing is that the command monopolizes
> execution. I know Elisp is single-threaded and the idle timer
> and C threads don't change that, but what about
> a child process?
I recently looked into this as I wanted to play a sound when sending a
notification in Emacs.
There's package that implements a async play-sound using the async
package:
https://github.com/jcs-elpa/sound-async/blob/master/sound-async.el#L43
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-09-22 12:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-04 21:52 `play-sound-file', no mp3 support, sets global volume w/o reset Emanuel Berg
2024-09-11 12:07 ` Emanuel Berg
2024-09-11 20:43 ` Stefan Kangas
2024-09-12 4:50 ` Emanuel Berg
2024-09-22 12:19 ` Björn Bidar
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).