Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102859646
D47639.id146596.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
922 B
Referenced Files
None
Subscribers
None
D47639.id146596.diff
View Options
diff --git a/usr.bin/beep/beep.c b/usr.bin/beep/beep.c
--- a/usr.bin/beep/beep.c
+++ b/usr.bin/beep/beep.c
@@ -152,7 +152,7 @@
int
main(int argc, char **argv)
{
- int32_t *buffer;
+ float *buffer;
size_t slope;
size_t size;
size_t off;
@@ -208,9 +208,9 @@
if (ioctl(f, SOUND_PCM_WRITE_CHANNELS, &c) != 0)
errx(1, "ioctl SOUND_PCM_WRITE_CHANNELS(1) failed");
- c = AFMT_S32_NE;
+ c = AFMT_FLOAT;
if (ioctl(f, SNDCTL_DSP_SETFMT, &c) != 0)
- errx(1, "ioctl SNDCTL_DSP_SETFMT(AFMT_S32_NE) failed");
+ errx(1, "ioctl SNDCTL_DSP_SETFMT(AFMT_FLOAT) failed");
if (ioctl(f, SNDCTL_DSP_SPEED, &sample_rate) != 0)
errx(1, "ioctl SNDCTL_DSP_SPEED(%d) failed", sample_rate);
@@ -251,7 +251,7 @@
else if (off > (size - slope))
sample = sample * (size - off - 1) / (float)slope;
- buffer[off] = sample * 0x7fffff00;
+ buffer[off] = sample;
}
if (write(f, buffer, size * sizeof(buffer[0])) !=
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 19, 2:37 AM (6 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14683071
Default Alt Text
D47639.id146596.diff (922 B)
Attached To
Mode
D47639: beep(1): Use AFMT_FLOAT
Attached
Detach File
Event Timeline
Log In to Comment