Mercurial > emacs
comparison src/sound.c @ 34255:cb2b0d1799db
(vox_configure): Set volume for left and right channel.
(sound_cleanup): Return nil.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Wed, 06 Dec 2000 13:31:48 +0000 |
parents | b3aa01baf64c |
children | db2901e01b72 |
comparison
equal
deleted
inserted
replaced
34254:eb9ce988e870 | 34255:cb2b0d1799db |
---|---|
358 if (current_sound_device->close) | 358 if (current_sound_device->close) |
359 current_sound_device->close (current_sound_device); | 359 current_sound_device->close (current_sound_device); |
360 if (current_sound->fd > 0) | 360 if (current_sound->fd > 0) |
361 emacs_close (current_sound->fd); | 361 emacs_close (current_sound->fd); |
362 } | 362 } |
363 | |
364 return Qnil; | |
363 } | 365 } |
364 | 366 |
365 | 367 |
366 DEFUN ("play-sound", Fplay_sound, Splay_sound, 1, 1, 0, | 368 DEFUN ("play-sound", Fplay_sound, Splay_sound, 1, 1, 0, |
367 "Play sound SOUND.\n\ | 369 "Play sound SOUND.\n\ |
785 | 787 |
786 if (sd->channels > 1 | 788 if (sd->channels > 1 |
787 && ioctl (sd->fd, SNDCTL_DSP_STEREO, &sd->channels) < 0) | 789 && ioctl (sd->fd, SNDCTL_DSP_STEREO, &sd->channels) < 0) |
788 sound_perror ("Setting channels"); | 790 sound_perror ("Setting channels"); |
789 | 791 |
790 if (sd->volume > 0 | 792 if (sd->volume > 0) |
791 && ioctl (sd->fd, SOUND_MIXER_WRITE_PCM, &sd->volume) < 0) | 793 { |
792 sound_perror ("Setting volume"); | 794 int volume = sd->volume & 0xff; |
795 volume |= volume << 8; | |
796 if (ioctl (sd->fd, SOUND_MIXER_WRITE_PCM, &volume) < 0) | |
797 sound_perror ("Setting volume"); | |
798 } | |
793 } | 799 } |
794 | 800 |
795 | 801 |
796 /* Close device SD if it is open. */ | 802 /* Close device SD if it is open. */ |
797 | 803 |