emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to play sound from string correctly?


From: Richard Stallman
Subject: Re: How to play sound from string correctly?
Date: Sat, 5 Jan 2002 17:36:26 -0700 (MST)

                (save-excursion
                  (set-buffer bufval)
                  (erase-buffer)
                  (set-buffer-multibyte nil)
                  (insert-file-contents-literally value)
                  (delete-file value)
                  (setq value (buffer-string)))

    First question: Is this correct way to read the contents of the binary
    file?

It is the correct way to read it and delete it.
(I am surprised you want to delete it.)
You might want to kill the buffer afterward;
you might want to use with-temp-buffer.

    it is played without any problem. I suppose there is bug wrt
    multibyte/encoding somewhere. Am I right? Where?

Try comparing the temporary file using cmp with the original file.
If they are different, then encoding has changed the contents.
But I expect you'll find that no multibyte encoding or decoding occurs
and the contents are unchanged.

I would suspect there is a bug in play-sound in the handling of :data.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]